@@ -150,6 +150,7 @@ SILE.input = {
150150 filenames = {},
151151 evaluates = {},
152152 evaluateAfters = {},
153+ luarocksTrees = {},
153154 uses = {},
154155 options = {},
155156 preambles = {}, -- deprecated, undocumented
@@ -209,6 +210,9 @@ function SILE.init ()
209210 SU .deprecated (" SILE.backend" , " SILE.input.backend" , " 0.15.7" , " 0.17.0" )
210211 SILE .input .backend = SILE .backend
211212 end
213+ for _ , tree in ipairs (SILE .input .luarocksTrees ) do
214+ _G [" extendSilePathRocks" ](tree )
215+ end
212216 if not SILE .input .backend then
213217 SILE .input .backend = " libtexpdf"
214218 end
@@ -267,12 +271,22 @@ local function suggest_luarocks (module)
267271
268272 eval $(luarocks --lua-version %s --tree path)
269273
270- Thereafter running SILE as normal in the same shell should work as
271- expected:
274+ Thereafter running `sile` as normal in the same shell should work as
275+ expected. This code can be used in your shell's initialization script
276+ to avoid having to do it manually in each new shell. This is true for
277+ user home directory installations using `--local` or any specific values
278+ for `--tree` other than 'lua_modules'.
279+
280+ As an anternative to setting up environment variables when using a
281+ non-default tree location, you can use the `--luarocks-tree` option to
282+ add path(s) at runtime. This is simpler to type, but must be used on each
283+ and every invocation. The value for tree should be the same as used when
284+ installing the LuaRock(s), or an appropriate full path to the location
285+ used by `--local` (generally "$HOME/.luarocks"):
272286
273- sile %s
287+ sile --luarocks-tree path %s
274288
275- ]] ):format (SILE .lua_version , guessed_module_name , SILE .lua_version , pl .stringx .join (" " , _G .arg or {}))
289+ ]] ):format (SILE .lua_version , guessed_module_name , SILE .lua_version , pl .stringx .join (" " , _G .arg or {}))
276290end
277291
278292--- Multi-purpose loader to load and initialize modules.
0 commit comments