extract-inline-styles.pl - Move inline CSS styles to a stylesheet
0.001
#!/usr/bin/env perl | |
=encoding UTF-8 | |
=head1 DOCUMENTATION | |
# DESCRIPTION | |
Pandoc filter which 'converts' span and div classes with a | |
trailing period into LaTeX commands (for spans) or environments |
#!/usr/bin/env perl | |
# pandoc-class2style.pl - filter to translate single span/div classes into LaTeX commands and attribute lists | |
# POD documentation below the code! | |
use utf8; | |
use autodie 2.29; | |
use 5.010001; | |
use strict; |
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$} | |
$if(beamerarticle)$ | |
\usepackage{beamerarticle} % needs to be loaded first | |
$endif$ | |
$if(fontfamily)$ | |
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$} | |
$else$ | |
\usepackage{lmodern} | |
$endif$ | |
$if(linestretch)$ |
#!/usr/bin/env perl | |
=head1 SYNOPSIS | |
pandoc -f opml -t markdown --atx-headers [PANDOC OPTIONS] input.opml \ | |
| perl md-head2dl.pl [OPTIONS] > output.md | |
=head1 DESCRIPTION | |
Massage Markdown converted with Pandoc L<http://pandoc.org> from OPML exported from Dynalist <https://dynalist.io>. |
#!/usr/bin/env perl | |
# version 0.4 | |
use utf8; | |
use autodie 2.29; | |
use 5.010001; | |
use strict; | |
use warnings; | |
use warnings qw(FATAL utf8); |
--[[ | |
# pandoc-texlogo2html.lua -- convert `\TeX` logo and friends to HTML | |
TL;DR: type `\LaTeX` in your Pandoc Markdown document and get sensible HTML! | |
This Pandoc filter replaces raw tex/latex blocks and inlines whose content | |
are tex logo commands like `\TeX`, `\LaTeX`, `\XeLaTeX`, `\LuaTeX` etc. | |
(The ones shown in the tex_logos table below, you can easily add more!) | |
with a raw block/inline with `html` as format and an HTML string which |
--[[ | |
pandoc options-anchors.lua | |
Pandoc filter which walks all definition lists in all divs with a class | |
`options-list` (or `optionslist` or `option-list` or `optionlist`) and | |
wraps all DL terms whose stringification starts with what looks like a | |
CLI option name[^1] in a span with an id `option-LONG-OPTION-NAME`, | |
where `LONG-OPTION-NAME` is the first long option name[^2] in the | |
stringified term. e.g. | |
This Makefile does the trick of producing a file with Pandoc from a directory of Markdown files, with some Markdown appended after the content of each Markdown file — by default three blocks of raw markup which will insert a pagebreak in DOCX, HTML or LaTeX output, but it can be taken from a file and so can be anything — before producing a single output file (by default a DOCX file) from the combined inputs with the appendage file inserted after each input file.
The content to append is taken from the file ./append.md
. If it doesn’t already exist it will be created with the following content:
````{=openxml}
<w:p><w:r><w:br w:type="page" /></w:r></w:p>
````
````{=html}
#!/usr/bin/env perl | |
use utf8; | |
use v5.14; | |
use strict; | |
use warnings; | |
use warnings qw(FATAL utf8); | |
use open qw(:std :utf8); | |
use charnames qw(:full :short); |