ipypublish.filters_pandoc.main module¶
pandoc filters used in converting markdown to a target format
Other sources of information:
[Pandoc User Guide](https://pandoc.org/MANUAL.html#citations)
[List of Pandoc Elements](https://metacpan.org/pod/Pandoc::Elements)
[reStructuredText Primer](http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html)
[reStructuredText Directives](http://docutils.sourceforge.net/docs/ref/rst/directives.html#figure)
[sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/en/latest/usage.html)
-
ipypublish.filters_pandoc.main.
jinja_filter
(source, to_format, nb_metadata, cell_metadata, from_format='markdown', strip=True)[source]¶ run a set of ipypublish pandoc filters as a Jinja2 filter
We convert the source to an intermediary pandoc-json AST format, run the pandocfilters, then convert to the to_format
- Parameters
Notes
Available Meta Options
The following options are available in {“ipub”: {}}
- apply_filters=True: bool
apply filters to markdown
- convert_raw=True: bool
if True attempt to extract non-markdown formats and convert them to the target format, e.g. rst roles to latex tags
- at_notation=True: bool
interpret @label as a reference type based on its prefix modifier, latex: ‘’ = cite ‘+’ = cref, ‘^’ = Cref, ‘!’ = ref, ‘=’ = eqref rst: ‘’ = :cite: ‘+’ = :numref: ‘^’ = :numref: ‘!’ = :ref: ‘=’ = :eq:
- reftag=”cite”: str
default latex tag for references
- use_numref=True: bool
whether to use the
:numref:
role or just:ref:
:numref:
requiresnumfig = True
in conf.py and, for section numbering, a toc tree with:numbered:
- strip_meta=True: bool
if True strip any source metadata, contained in the top matter
The options will be taken in order of preference from: source.metadata > cell.metadata > nb.metadata
For source.metadata, see https://pandoc.org/MANUAL.html#metadata-blocks:
--- ipub: pandoc: use_numref: True --- +@label