An open API service indexing awesome lists of open source software.

https://github.com/hason/pandoc-filters

A collection of lua filters for pandoc
https://github.com/hason/pandoc-filters

context lua pandoc pandoc-citeproc pandoc-filter tex

Last synced: 3 months ago
JSON representation

A collection of lua filters for pandoc

Awesome Lists containing this project

README

        

Pandoc Lua filters
==================

Universal filters
-----------------

### [Filters](filters.lua)
### [Meta to header](meta2headers.lua)
### [Equal size of table columns](equalsizecolumns.lua)

ConTeXt filters
---------------

### [Bibliography](context/bibliography.lua)
Replace `pandoc-citeproc` by native MkIV bibliography.

### [Citations](context/citations.lua)

### [Comments](context/comments.lua)
Convert MS Word "Track Changes " comments to PDF comments.

```bash
pandoc --lua-filter context/comments.lua -t context
```

```markdown
Lorem ipsum dolor sit amet, [Comment text]{.comment-start id=1 author="Martin Hasoň"}consectetuer adipiscing elit[]{.comment-end id=1}.
```

```tex
Lorem ipsum dolor sit amet, \comment[author={Martin Hasoň}]{Comment text}consectetuer adipiscing elit.
```

### [References](context/references.lua)

Creates an invisible, referencable anchor texts from span with id.

```bash
pandoc --lua-filter context/references.lua -t context
```

```markdown
The various [canal houses]{#houses} houses at the canal have nice interior.
```

```tex
The various \textreference[houses]{canal houses} houses at the canal have nice interior.
```

### [Sections](context/sections.lua)
Use new MkIV commands for sections.

```bash
pandoc --lua-filter context/sections.lua -t context
```

```markdown
# Section
Text

## SubSection 1

### SubSubSection {-}
Text

## SubSection 2
Text
```

```tex
\startsection[title={Section}, reference={section}]
Text
\startsubsection[title={SubSection 1}, reference={subsection-1}]
\startsubsubsubject[title={SubSubSection}, reference={subsubsection}]
Text
\stopsubsubsubject
\stopsubsection
\startsubsection[title={SubSection 2}, reference={subsection-2}]
Text
\stopsubsection
\stopsection

```

Usage
-----

```lua
package.path = package.path .. ";pandoc/?.lua"

local filters = require("filters")

filters.import("meta2header")
filters.import("context/bibliography")
filters.import("context/citations")
filters.import("context/sections")
filters.import("context/rawcontext")
filters.import("context/references")

return filters.all()

```