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: about 2 months ago
JSON representation
A collection of lua filters for pandoc
- Host: GitHub
- URL: https://github.com/hason/pandoc-filters
- Owner: hason
- License: mit
- Created: 2019-01-11T22:34:31.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-15T11:24:44.000Z (about 7 years ago)
- Last Synced: 2025-01-19T16:38:09.013Z (over 1 year ago)
- Topics: context, lua, pandoc, pandoc-citeproc, pandoc-filter, tex
- Language: Lua
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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()
```