Closed kjambunathan closed 4 years ago
pandoc-zotxt
does work on my machine)~$ cat ww.md
[@wrigstad2017mastery]
~$ pandoc -s --lua-filter=pandoc-zotxt.lua -F pandoc-citeproc ww.md -t plain
(Wrigstad and Castegren 2017)
Wrigstad, Tobias, and Elias Castegren. 2017. “Mastery Learning-Like
Teaching with Achievements.” In SPLASH-E.
~$ echo 'See [@wrigstad2017mastery].' | pandoc -f markdown -t native ww.md
[Para [Cite [Citation {citationId = "wrigstad2017mastery", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[@wrigstad2017mastery]"]]]
In @retorquere's machines the Inlines function does work. But it doesn't work on my machine.
I want to reitrate this observation.
This issue is very subtle.
@retorquere was kind enough to help me /in real-time/. Otherwise, I wouldn't have progressed this far.
can you try with the newest pandoc release?
Lua filter's Inlines callback is not getting called
can you try with the newest pandoc release?
Instead of compiling from source, I would prefer to use the binaries at https://github.com/jgm/pandoc/releases/latest
I see following remark:
Note: because of the static linking, the pandoc binary from this package cannot use lua filters that require external lua modules written in C.
I cannot make out the implications of that remark. Can I use that version for current purposes ...
Ok ... I should have asked this.
Do you want me to compile and install from git. Or, does testing with released tar work for you
The MWE filter posted here doesn't use any external modules at all.
huh, are you people having a project-specific discussion in the pandoc issue tracker, or..?
The bug goes away once I upgraded.
~$ dpkg -l | grep pandoc
ii libghc-pandoc-citeproc-data 0.16.4.1-1 all Pandoc support for Citation Style Language - data files
ii pandoc 2.10-1 amd64 general markup converter
ii pandoc-citeproc 0.16.4.1-1+b1 amd64 Pandoc support for Citation Style Language - tools
ii pandoc-data 2.9.1.1-2 all general markup converter - data files
~$ pandoc --version
pandoc 2.10
Compiled with pandoc-types 1.21, texmath 0.12.0.2, skylighting 0.8.5
Default user data directory: /home/kjambunathan/.local/share/pandoc or /home/kjambunathan/.pandoc
Copyright (C) 2006-2020 John MacFarlane
Web: https://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.
~$ cat test.lua
function Inlines_holler(inlines)
print('inlines')
return inlines
end
return {
{ Inlines = Inlines_holler },
}
~$ cat ww.md
[@wrigstad2017mastery]
~$ pandoc -s --lua-filter=./test.lua ww.md -t plain
inlines
inlines
inlines
inlines
[@wrigstad2017mastery]
The bug goes away once I upgraded.
great, closing this then...
huh, are you people having a project-specific discussion in the pandoc issue tracker, or..?
Not really -- the discussion originated in the other repo but the MWE showed the problem to be reproducible with a simple lua filter that used only pandoc facilities. In any case, 2.10 seems to have solved it.
The facility to filter on Inlines
was added in 2.9.2.
This bug is a result of https://github.com/retorquere/zotero-better-bibtex/issues/1581. In @retorquere's machines the
Inlines
function does work. But it doesn't work on my machine.(You can take a look at the above issue if you want further details)
Pandoc version
Download
test.lua
Look at
test.lua
. It registers forInlines
Create an
md
file with a loan citaiton keysRun the
pandoc
with the abovetest.lua
Expected output
inlines
in the output streamActual behaviour
No
inlines
in the output stream. This impliesInlines_holler
is not getting called.