Lua filter collection for pandoc
Project description
pandocker-lua-filters
Lua filters for pandoc
Install
pip install git+https://github.com/pandocker/pandocker-lua-filters.git
General use
Convert AAFigure ascii art
- requires
aafigure
python package
Convert CSV into table
- requires
csv
luarocks package
Replace title
subtitle
date
author
metadata
Text file listing
Concatenate text files
Removable note block
Convert svgbob ascii art
Convert SVG images to other formats
- requires
rsvg-convert
in$PATH
Applies table attributes to a table
Wavedrom / Bit-Field
- requires
wavedrom
(version later than 2.0.3r1) python package - requires
lyaml
andlua-cjson2
luarocks packages
LaTeX output only
Landscape pages
Applies underline to .underline
class span
Docx output only
Inserts a comment
Apply custom (paragraph) styles for each table cell
Apply custom (paragraph) styles for image and its caption
Apply custom (character) styles for any span
Apply custom (paragraph) styles for any unnumbered bullet lists
Finds unnumbered bullet lists down to 3rd level and applies custom paragraph styles. 4th level and lower list items are escalated to 3rd level.
Requirement for template
- Prepare
Bullet List 1
toBullet List 3
paragraph styles (by the way this is 1st level list item)- Otherwise these headers inherit
Body
style (this is 2nd level)
- Otherwise these headers inherit
Level | Unnumbered |
---|---|
1 | Bullet List 1 |
2 | Bullet List 2 |
3+ | Bullet List 3 |
TOC / Pagebreak
- Adds TOC(Table Of Contents) or a pagebreak at any point of document
Requirement for template
TOC title is set to "Table of Contents" by default. Metadata toc-title
overrides this setting.
Appendix headings
- Makes
appendix
class work to appendix headings in DOCX format - Limited to level-1 to 5 headings
Requirement for template
- Prepare
Appendix Heading 1
toAppendix Heading 5
heading styles- Otherwise these headers inherit
Body
style
- Otherwise these headers inherit
Level | Numbered | Unnumbered |
---|---|---|
1 | Heading 1 | Appendix Heading 1 |
2 | Heading 2 | Appendix Heading 2 |
3 | Heading 3 | Appendix Heading 3 |
4 | Heading 4 | Appendix Heading 4 |
5 | Heading 5 | Appendix Heading 5 |
6 | Heading 6 |
Unnumbered headings
- Makes
UnnumberHeadings
class work to unnumber headings in DOCX format - Limited to level-1 to 5 headings
Requirement for template
- Prepare
Heading Unnumbered 1
toHeading Unnumbered 5
heading styles- Otherwise these headers inherit
Body
style
- Otherwise these headers inherit
Level | Numbered | Unnumbered |
---|---|---|
1 | Heading 1 | Heading Unnumbered 1 |
2 | Heading 2 | Heading Unnumbered 2 |
3 | Heading 3 | Heading Unnumbered 3 |
4 | Heading 4 | Heading Unnumbered 4 |
5 | Heading 5 | Heading Unnumbered 5 |
6 | Heading 6 |
Figure styles
- Processes only paragraph having single image link
- Blank lines required before and after image link
- Requires
Graphic Anchor
andFigure Caption
paragraph styles in template otherwise these styles inheritBody
style- the filter creates two divs having
custom-style
attribute - after process the image is placed in
custom-style="Graphic Anchor"
div and its caption is incustom-style="Figure Caption"
div respectively
- the filter creates two divs having
Requirement for template
- Prepare
Graphic Anchor
andFigure Caption
styles
samples
![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.
DIY
As lua filters only requires pandoc itself, it is relatively easy
to try develop a new filter. I recommend to use k4zuki/pandocker-alpine
docker image like
docker pull k4zuki/pandocker-alpine
to get image- clone this repo
git clone git@github.com:pandocker/pandocker-lua-filters.git
cd pandocker-lua-filters
docker run --rm -it -v/$PWD:/workdir k4zuki/pandocker-alpine
to start docker imagemake install
to install filters in image. They are installed in/usr/local/share/lua/5.3/pandocker/
make reinstall
to reinstall so that filters will be updatedmake uninstall
to uninstall filtersmake html|pdf|docx
to compile test document- edit
tests/Makefile
to configure options for pandoc
You don't have to reinstall
for every source code updates. Instead edit tests/Makefile
to run your new filter from inside repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for pandocker_lua_filters-0.0.16-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02f5f5b30b86d9122be2251331dd4fcddc8f33735d1710afd56224cbb9c69553 |
|
MD5 | d23b2e70987a1e877acff39a5b0f7b8c |
|
BLAKE2b-256 | 90e1770a662626953355a69a9b945d03e913fe57756589ce1b38ae811a248f19 |