Package: pandocker-lua-filters
pandocker-lua-filtersLua filters for pandocInstallinstalls as a python package for ease of usepip install pandocker-lua-filtersLua filters should be installed under<sys.prefix>/share/lua/{5.3|5.4}/pandockerwhere<sys.prefix>can be confirmed bypython -c "import sys; print(sys.prefix)". It installboth5.3 and 5.4
directories no matter of actual lua versions in system.
This<sys.prefix>/share/lua/{5.3|5.4}should be added topackage.pathwhich can be confirmed
bylua -e "print(package.path)".General useConvert AAFigure ascii artrequiresaafigurepython packageaafigure.luaConvert CSV into tablerequirescsvandpenlightluarocks packagesPandoc below 2.10 applies "simple" filterscsv2table.luacsv2table-simple.luaReplacetitlesubtitledateauthormetadatahide-frontpage-metadataText file listingrequirespenlightluarocks packagelistingtable.luaConcatenate text filespreprocess.luaRemovable note blockremovable-note.luaConvert svgbob ascii artsvgbob.luaConvert SVG images to other formatsrequiresrsvg-convertin$PATHsvgconvert.luaApplies table attributes to a tablerequirespenlightluarocks packagePandoc below 2.10 applies "simple" filterstable-width.luatable-width-simple.luaWavedrom / Bit-Fieldrequireswavedrom-cliin$PATH(npm i -g wavedrom-cli)requireslyamlandlua-cjson2luarocks packageswavedrom.luaLaTeXoutput onlyLandscape pagestex-landscape.luaApplies underline to.underlineclass spantex-underline.luaDocxoutput onlyInserts a commentdocx-comment.luaApply custom (paragraph) styles for each table celldocx-apply-cell-styles.luaApply custom (paragraph) styles for image and its captiondocx-image-styles.luaApply custom (character) styles for any spandocx-custom-span-styles.luaApply in-place color for any spandocx-colored-span.luaApply custom (paragraph) styles for any unnumbered bullet listsFinds unnumbered bullet lists down to 3rd level and applies custom paragraph styles.4th level and lower list items are escalated to 3rd level.docx-extract-bullet-lists.luaRequirement for templatePrepareBullet List 1toBullet List 3paragraph styles (by the way this is 1st level list item)Otherwise these headers inheritBodystyle (this is 2nd level)LevelUnnumbered1Bullet List 12Bullet List 23+Bullet List 3TOC / Pagebreak / Linebreak / Sub section TOCdocx-pagebreak-toc.luaAdds TOC(Table Of Contents), sub sections, a line break or a page break at any point of documentRequirement for templateTOC title is set to "Table of Contents" by default. Metadatatoc-titleoverrides this setting.Appendix headingsdocx-appendixheadings.luaMakesappendixclass work toappendixheadings in DOCX formatLimited to level-1 to 5 headingsRequirement for templatePrepareAppendix Heading 1toAppendix Heading 5heading stylesOtherwise these headers inheritBodystyleLevelNumberedUnnumbered1Heading 1Appendix Heading 12Heading 2Appendix Heading 23Heading 3Appendix Heading 34Heading 4Appendix Heading 45Heading 5Appendix Heading 56Heading 6Unnumbered headingsdocx-unnumberedheadings.luaMakesUnnumberHeadingsclass work tounnumberheadings in DOCX formatLimited to level-1 to 5 headingsRequirement for templatePrepareHeading Unnumbered 1toHeading Unnumbered 5heading stylesOtherwise these headers inheritBodystyleLevelNumberedUnnumbered1Heading 1Heading Unnumbered 12Heading 2Heading Unnumbered 23Heading 3Heading Unnumbered 34Heading 4Heading Unnumbered 45Heading 5Heading Unnumbered 56Heading 6Figure stylesdocx-image-styles.luaProcesses only paragraph having single image linkBlank lines required before and after image linkRequiresGraphic AnchorandFigure Captionparagraph styles in template
otherwise these styles inheritBodystylethe filter creates two divs havingcustom-styleattributeafter process the image is placed incustom-style="Graphic Anchor"div and its caption is
incustom-style="Figure Caption"div respectivelyRequirement for templatePrepareGraphic AnchorandFigure Captionstylessamples![Centered image](https://github.com/pandocker/pandoc-docx-utils-py/raw/master/qr.png){width=100mm#fig:centered}Want a new feature?Feature request (via issues) and PRs are welcome. Post questions in issues with[Q]in issue title.DIYAs lua filters only requires pandoc itself, it is relatively easy
to try develop a new filter. I recommend to usek4zuki/pandocker-alpinedocker imagelikedocker pull k4zuki/pandocker-alpineto get imageclone this repogit clone git@github.com:pandocker/pandocker-lua-filters.gitcd pandocker-lua-filtersdocker run --rm -it -v/$PWD:/workdir k4zuki/pandocker-alpineto start docker imagemake installto install filters in image. They are installed in/usr/local/share/lua/5.3/pandocker/make reinstalltoreinstallso that filters will be updatedmake uninstallto uninstall filtersmake html|pdf|docxto compile test documentedittests/Makefileto configure options for pandocYou don't have toreinstallfor every source code updates. Instead edittests/Makefileto run your new filter from inside repository.