Am 11.11.25 um 11:35 schrieb Henning Hraban Ramm:
Another first time for me:
I’m processing some data with text snippets that might use Markdown formatting. I thought I could simply:

\usemodule[markdown]

\startluacode
moduledata.markdown.typesetstring("Hello *world!*")
\stopluacode

… and that even works.

But in my real project, I try to call moduledata.markdown.typesetstring in a function that is defined in a lua file that I load via require(),
and that fails, because moduledata.markdown is nil.

So I guess I have a scoping or load order problem.
How should I load a module from lua code or ensure that it is loaded?

Ok, found it: lua.registercode("m-markdown.lmt")

Sorry for the noise.

Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to