Closed rkingett closed 1 year ago
What version of pandoc are you using? And which operating system?
EDIT: I just realized you are using 0.4.0 of the templates which was released in March 2022, there was a bug in the code that was fixed in May 2022, can you try the latest branch?
I got it to work by downloading the main master branch and not a branch in one of the releases. Also, for others, it should be worth noting the below string works when converting a whole folder of files.
.\bin\md2long.ps1 -overwrite -modern -output $env:USERPROFILE/Documents/short-out-ps.docx './test/long/*.md'
I entered,
.\bin\md2short.ps1 -overwrite -modern -output $env:USERPROFILE/Documents/short-out-ps.docx './test/short/guidelines.md'
The output was this.
Mode LastWriteTime Length Name
---- ------------- ------ ----
------ 3/12/2022 5:34 PM 55161 guidelines-modern.pdf
------ 3/12/2022 5:34 PM 9839 guidelines.md
------ 3/12/2022 5:34 PM 48943 guidelines.pdf
------ 3/12/2022 5:34 PM 1505 shunnshort.lua
------ 3/12/2022 5:34 PM 22883 template-modern.docx
------ 3/12/2022 5:34 PM 22891 template.docx
Creating temporary directory.
Directory created: XXX\XXXAppData\Local\Temp\07c480ce-a9f2-4ef4-a16c-041182d9fc74
Running Pandoc.
Error running filter XXX/XXX/pandoc-templates-0.4.0\shunn\short/shunnshort.lua:
...t\Downloads\pandoc-templates-0.4.0/filters\wordcount.lua:26: bad argument #2 to 'format'
(number expected, got nil)
stack traceback:
...t\Downloads\pandoc-templates-0.4.0/filters\wordcount.lua:26: in function 'format_word_count'
...nloads\pandoc-templates-0.4.0\shunn\short/shunnshort.lua:15: in function 'Pandoc'
ERROR: exit 83
PS XXX/XXX/pandoc-templates-0.4.0>