Beyond Markdown
johnmacfarlane.net2 pointsby fiddlosopher0 comments
\newcommand{\pair}[2]{\langle #1, #2\rangle}
$$\pair{a^2}{\frac{\pi}{2}}$$
pandoc will give you the Typst $ chevron.l a^2 \, pi / 2 chevron.r $
which is correct. Tylax, on the other hand, seems to have problems with this example, producing $ angle.l^()frac(pi,)angle.r $
which does not compile with typst. Going the other direction, pandoc also understands typst scripting. For example, from #let count = 8
#let nums = range(1, count + 1)
#let fib(n) = (
if n <= 2 { 1 }
else { fib(n - 1) + fib(n - 2) }
)
The first #count numbers of the sequence are:
#align(center, table(
columns: count,
..nums.map(n => $F_#n$),
..nums.map(n => str(fib(n))),
))
pandoc produces this LaTeX: The first 8 numbers of the sequence are:
{\def\LTcaptype{none} % do not increment counter
\begin{longtable}[]{@{}llllllll@{}}
\toprule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
\(F_{1}\) & \(F_{2}\) & \(F_{3}\) & \(F_{4}\) & \(F_{5}\) & \(F_{6}\) &
\(F_{7}\) & \(F_{8}\) \\
1 & 1 & 2 & 3 & 5 & 8 & 13 & 21 \\
\end{longtable}
}
With the same input, Tylax produces: The first 8 numbers of the sequence are:
\begin{center}
\begin{tabular}{|c|}
\hline
\hline
\end{tabular}\end{center}
which is just an empty table. pandoc -f html -t gfm-raw_html https://www.fsf.org | grep div
gives no output. (If you get different results, it is possible that you are using an earlier pandoc version and something changed in this regard.) pandoc -f html -t gfm https://www.fsf.org
Or, to get rid of the divs and spans altogether, disable raw HTML as well: pandoc -f html -t gfm-raw_html https://www.fsf.org pandoc --shift-heading-level-by=-1 input.md -o output.docx
This will promote level-2 headings to level-1, and promote a level-1 heading at the top of the document to the document's title. # Usage
See [Usage].
https://pandoc.org/MANUAL.html#extension-implicit_header_ref... 1. List item one.
+
List item one continued with a second paragraph followed by an
Indented block.
+
.................
$ ls *.sh
$ mv *.sh ~/tmp
.................
+
List item continued with a third paragraph.
2. List item two continued with an open block.
+
--
This paragraph is part of the preceding list item.
a. This list is nested and does not require explicit item continuation.
+
This paragraph is part of the preceding list item.
b. List item b.
This paragraph belongs to item two of the outer list.
--
Markdown equivalent: 1. List item one.
List item one continued with a second paragraph followed by an
Indented block.
$ ls *.sh
$ mv *.sh ~/tmp
List item continued with a third paragraph.
2. List item two continued with an open block.
This paragraph is part of the preceding list item.
1. This list is nested and does not require explicit item continuation.
This paragraph is part of the preceding list item.
2. List item b.
This paragraph belongs to item two of the outer list.
Note that the AsciiDoc is at least as easy to write, perhaps easier, because you don't need to worry about indentation. But the Markdown source is more readable; the indentation makes clear the structure of the list in a way that mirrors how it would be displayed in a browser or on the page.
- the app cannot fetch resources using HTTP
- JSON filters are not supported, as they involve external programs
- Lua filters are supported, but only if they don't try to do system IO operations or run external programs
- Output to PDF is supported only via Typst (using the WASM version of Typst).