Closed jerri closed 4 years ago
It seems that pandoc.utils.stringify
has to be used (according to other examples in this repository). So maybe diagram-generator.lua
has to be updated to be compatible with newer versions of pandoc?
Thanks for the report. Your analysis is on point, everything after the equal-sign in line 85 should be wrapped into a call to pandoc.utils.stringify
. I hope to fix that soon.
Thanks for the bugfix. I tried to use this with my usecase, but now I get an error message:
Error running filter /home/gerhard/external/git/lua-filters/diagram-generator/diagram-
generator.lua:
PandocLuaError "Error during function call: Expected an AST element, but could not parse value as such."
stack traceback:
[C]: in function 'pandoc.utils.stringify'
.../git/lua-filters/diagram-generator/diagram-generator.lua:88: in function 'Meta'
I tried my own implementation of your approach which seems to work:
dotPath = (meta.dotPath and pandoc.utils.stringify(meta.dotPath)) or dotPath
Or is my setup somehow wrong?
The first fix had a bug, which in turn was fixed this morning. Did you try the current version?
Yes, I tested with the latest version. Just retried and nothing new was pulled by git. So the problem happened with the latest version of the code.
I rechecked the approach and found the problem. It coughs up at a different location now. stringify is upset about meta.python_path
, meta.pythonPath
or python_path, which are all nil
in my case. The old version of diagram_generator.lua that I patched as mentioned above doesn't have this problem.
I am using pandoc 2.10 together with the current version of lua-filters/diagram-generator. I try to create diagrams using graphviz. But for one page I need the
neato
-binary from graphviz instead ofdot
. According to the documentation I should be able to set metadatadotPath
to affect this. This works cool from the command line via--metadata dotPath=/usr/bin/neato
. But if I try to add the information inside the file as follows