diff --git a/.gitignore b/.gitignore index 1d0b49c..3ec6e7f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,4 @@ __pycache__ *.log -*.pdf -*.rtf *.tex diff --git a/README.md b/README.md new file mode 100644 index 0000000..21cef92 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# legalmd + +An extension of Markdown to notate Australian-style legal markup, using the Python [mistletoe](https://github.com/miyuchina/mistletoe) Markdown parser. + +legalmd can process Markdown files into LaTeX source code, and RTF. The output style is based on, but separate from, the [latex-legal](https://gitlab.com/RunasSudo/latex-legal) style. + +## Examples + +See example.md for example markup. + +To generate LaTeX output, run: + +``` +python -m legalmd example.md > example.tex +``` + +The LaTeX output file can then be compiled as usual into a PDF document. Note that the generated code utilises *fontspec* for font support, so LuaLaTeX or XeLaTeX will be required. + +To generate RTF output, run: + +``` +python -m legalmd --format rtf example.md > example.rtf +``` + +The RTF output file can then be directly viewed in a compatible RTF editor. diff --git a/example.md b/example.md index c05c94a..759f7a7 100644 --- a/example.md +++ b/example.md @@ -25,3 +25,10 @@ This is the *blah blah*. Continued (2) DEF + +### 3 Table example + +| 1 First column | 2 Second column | +|----------------|-----------------| +| 1 First row | Foo bar | +| 2 Second row | Baz qux | diff --git a/example.pdf b/example.pdf new file mode 100644 index 0000000..c23c983 Binary files /dev/null and b/example.pdf differ diff --git a/example.rtf b/example.rtf new file mode 100644 index 0000000..6ef723a --- /dev/null +++ b/example.rtf @@ -0,0 +1 @@ +{\rtf1\deff0{\fonttbl{\f0 TeX Gyre Heros{\*\falt FreeSans}{\*\falt Liberation Sans}{\*\falt Arial};}}\paperw11905\paperh16837\margl1133\margr1133\margt1133\margb1133{\header\f0\fs16\tqr\tx9637 Example Legal Document\tab }{\footer\f0\fs16\tqr\tx9637 \tab\chpgn}\sa198\fs1\~\fs24 {\fs20\li0{\b Note:} This is a note.\par}{\sb566\keepn\b\fs26\qc\caps Part 1\u8212?Preliminary\par}{\keepn\b\fi-566\li566 1\tab Short title\par}{\li566 This is the {\i blah blah}.\par}{\keepn\b\fi-566\li566 2\tab Another heading\par}{\fi-566\li1133 (1)\tab ABC\par}{\li1133 Continued\par}{\fi-566\li1700 (a)\tab asdf\par}{\fi-566\li1700 (b)\tab abcdefg\par}{\li1700 hijkl\par}{\li1133 Continued\par}{\fi-566\li1133 (2)\tab DEF\par}{\keepn\b\fi-566\li566 3\tab Table example\par}{\sa0\trowd\trgaph120\trleft566\clbrdrt\brdrs\clbrdrb\brdrs\cellx5101\clbrdrt\brdrs\clbrdrb\brdrs\cellx9636 {\b Column 1\intbl\cell}{\b Column 2\intbl\cell}\row{\b First column\intbl\cell}{\b Second column\intbl\cell}\row {1. First row\intbl\cell}{Foo bar\intbl\cell}\row {2. Second row\intbl\cell}{Baz qux\intbl\cell}\row }}