You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module of course needs eval() to evaluate function and parameter descriptions, meaning that no other than the built-in functions can be called.
Also, the filesystem cannot be accessed within eval()ed code. Despite that, image() currently works through a workaround but since packages don't have access to the filesystem as well, this will cease to work when installed as a package (which will soon be possible) :/
Luckily the next Typst version (0.7.0) adds a scope parameter to eval() that allows passing a dictionary of symbols to be passed that are then available in the eval context. I plan on allowing a similar parameter for the function parse-module().
If everything goes well, then the user may even pass a module here and then use all of its definitions which will mean that rendering of code examples will be possible in function or parameter descriptions.
This feature could also be used to include images in some way.
Please give feedback if this would be useful and maybe what form would be best regarding your project's requirements :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This module of course needs
eval()
to evaluate function and parameter descriptions, meaning that no other than the built-in functions can be called.Also, the filesystem cannot be accessed within
eval()
ed code. Despite that,image()
currently works through a workaround but since packages don't have access to the filesystem as well, this will cease to work when installed as a package (which will soon be possible) :/Luckily the next Typst version (0.7.0) adds a scope parameter to
eval()
that allows passing a dictionary of symbols to be passed that are then available in the eval context. I plan on allowing a similar parameter for the functionparse-module()
.If everything goes well, then the user may even pass a module here and then use all of its definitions which will mean that rendering of code examples will be possible in function or parameter descriptions.
This feature could also be used to include images in some way.
Please give feedback if this would be useful and maybe what form would be best regarding your project's requirements :)
Beta Was this translation helpful? Give feedback.
All reactions