pandoc-lua-filters/composite-paragraphs
2022-02-09 22:56:25 +01:00
..
tests Add composite-paragraphs 2022-02-09 22:56:25 +01:00
composite-paragraphs.lua Add composite-paragraphs 2022-02-09 22:56:25 +01:00
LICENSE.txt Add composite-paragraphs 2022-02-09 22:56:25 +01:00
Makefile Add composite-paragraphs 2022-02-09 22:56:25 +01:00
output.docx Add composite-paragraphs 2022-02-09 22:56:25 +01:00
README.md Add composite-paragraphs 2022-02-09 22:56:25 +01:00
sample.md Add composite-paragraphs 2022-02-09 22:56:25 +01:00

Composite paragraphs from Pandoc

Definition

Composite paragraphs are paragraphs composed of different blocks: normal text, quotations, tables,... This filter unindents all text blocks but the first in a composite paragraph.

This concept makes sense only if you want to indent all paragraphs by default, including paragraphs beginning after a quotation block or a table, for instance. In that case, unindenting a text block means that it is not to be seen as a new paragraph, but as a the continuation of the previous text block that has been interrupted by another block. If you want to prevent the indentation of all paragraphs following certain types of blocks, please consider using the first-line-indent filter instead.

How to use this filter

To create a composite paragraph in your MD file, simply wrap its components in a Div with class .composite-paragraph. Some examples are given in sample.md.

What it does

For the moment, it only prevents the indentation of text blocks other than the first one. More features can be requested.

The Div itself is not removed from the AST, so that you can pass it through other filters.

Output formats

The following output formats are supported:

  • context
  • docx
  • latex

Other formats can be added. PRs are welcome. If you prefer to submit an issue instead, please specify what code should be used in the targeted format in order to achieve what this filter does.