Lua files as examples

Karl Berry karl at freefriends.org
Thu Jul 18 23:50:16 CEST 2019


Hi Urs - yes, it is no problem to keep the doc .lua files in the doc
tree.

   how would I indicate this? 

The best place to describe intended installation layout is in the README
file, although assuming the CTAN upload will have (something like)
doc/luaexamples/*.lua vs. tex/subfolder/*.lua, it will be evident to me
what to do.

   Also, what would be the appropriate link
   to point to in the manual (you'll find the example files in ...)?

It depends on the appropriate subdirectory of doc, e.g.,
texmf-dist/doc/latex/yourpkgname/luaexamples, but "latex" might be
"generic" or "support" or whatever. It depends on what your package does :).
I usually use something corresponding to the main CTAN subtree location.
(Suggesting something is fine.)

Another thing that can be useful to mention is running "texdoc -l
yourpkgname", which should show all the relevant files (and maybe some
irrelevant ones), including the examples.

On another front:

    require(subfolder.module-name) from the main .lua file. 

Does that actually work? Does your script do something to put subfolder
in the Lua input path, or similar(*)? If not, or even if so, I strongly
recommend making the file basenames be unique, like
yourpkg-module-name.lua.

If you have a preference, the runtime .lua files can end up either under
scripts/ or under tex/. Let me know. --best, karl.


(*) It is possible to use kpsewhich --subdir=yourpkg to filter the possible
extraneous matches, which I implemented years ago for Heiko, but from a
quick grep, I didn't see anything actually using it ...


More information about the tex-live mailing list