Closed kbro237 closed 3 years ago
Hi,
Panda does not know the current file since it works on the AST, not on the file. A workaround would be to set an environment variable before calling panda.
On the other side, pandoc provides a Lua table PANDOC_STATE
which contains information about the input files. I can check if this table can be made available to panda.
I'm testing something in the branch input_and_output_files
:
icmd
instead of cmd
to include the result of the command as a markdown text instead of in a code blockinput_file
and output_file
Thus we can write:
% test mdate
% someone
% `date -r {{input_file}} "+%Y-%m-%d"`{icmd=sh}
I've merged the branch input_and_output_files
.
I've also added similar variables to upp.
Thanks for this project! I'm currently evaluating whether I can replace
pp
withpanda
or if I still need a preprocessor likeupp
.Is there a way to access the name of the current file from
panda
? For example, withpp
I used the macro!exec(date -r !file "+%Y-%m-%d")
to set the metadata date to the date of the file's last modification.