This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[===[# `no-fig-pandoc.lua` | |
Pandoc filter implementing a better logic for image-in-a-para vs. figure in Markdown | |
This Pandoc filter strips the Figure around an Image if the Figure | |
has no other practical child than that Image, by replacing the Figure | |
with a paragraph containing the Image and a non-breaking space (U+00A0) | |
An Image with a class `.fig` will cause the Figure to be preserved. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.014; | |
# use utf8; | |
use utf8::all; | |
use strict; | |
use warnings; | |
use warnings FATAL => 'utf8'; | |
use autodie; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[==============================[ | |
Pandoc filter which converts select raw LaTeX environments into Pandoc native divs, | |
with the evironment name as first/only class and a possible | |
mandatory argument after the environment name converted to a first | |
paragraph in the div. This was in response to a question on how to | |
convert certain environments into ReStructuredText directives, so some | |
of the comments relate to that. | |
To use this filter run pandoc like this: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[==============================[ | |
# attr-color.lua | |
A Pandoc filter which sets LaTeX text/background/frame color(s) on | |
Span and Div elements based on Pandoc attributes. | |
## Usage | |
See https://git.io/JI4yA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- DWIM selective table item copying for Moonscript (and Lua) | |
import_select = (target, source, ...) -> | |
names = {...} | |
-- allow passing a table of names, | |
-- possibly with renames | |
if 1 == #names and 'table' == type names[1] | |
names = names[1] | |
-- map keys are "new" names |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
#=============================================================================== | |
# Perl used to not support variable-length lookbehind (VLLB) in | |
# regexes. Version 5.30 supports *limited length* | |
# VLLB, but this trick emulates VLLB in older versions too, | |
# and apparently without any arbitrary | |
# length limit! | |
# | |
# See <http://www.drregex.com/2019/02/variable-length-lookbehinds-actually.html?m=1> | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# pandoc-texlive.sh | |
# TeXLive packages needed to produce PDFs with Pandoc | |
# using different *TeX `--pdf-engine` options. | |
tlmgr install \ | |
scheme-basic \ | |
amsfonts \ | |
amsmath \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Pandoc filter which prevents code blocks containing backticks being mangled in Markdown output. | |
| This software is Copyright (c) 2019 by Benct Philip Jonsson. | |
| | |
| This is free software, licensed under: | |
| | |
| The MIT (X11) License |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Pandoc Lua filter which converts docx with poetry as found in the wild | |
where each line is a paragraph and each verse is separated by an empty | |
paragraph into one Pandoc line block per verse, if run like this: | |
pandoc -r docx+empty_paragraphs --lua-filter pandoc-poetry-line-blocks.lua poetry.docx -so poetry.md | |
Note the `+empty_paragraphs` extension! It is necessary for this filter to | |
do its work correctly! |
NewerOlder