summaryrefslogtreecommitdiff
path: root/macros/generic/markdown/examples
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-04-28 03:01:37 +0000
committerNorbert Preining <norbert@preining.info>2023-04-28 03:01:37 +0000
commitecdd3beb4fb3bcd9ea2f1c6349a68f74a40f1679 (patch)
treef9f048d640b29aaf501c9db5491a351fa48fb2fd /macros/generic/markdown/examples
parente947b2310e888cd5b10265d596eb332da9f6bdec (diff)
CTAN sync 202304280301
Diffstat (limited to 'macros/generic/markdown/examples')
-rw-r--r--macros/generic/markdown/examples/context-mkii.tex70
-rw-r--r--macros/generic/markdown/examples/context-mkiv.tex2
-rw-r--r--macros/generic/markdown/examples/latex-luatex.tex56
-rw-r--r--macros/generic/markdown/examples/latex-pdftex.tex (renamed from macros/generic/markdown/examples/latex.tex)22
l---------macros/generic/markdown/examples/latex-xetex.tex1
5 files changed, 65 insertions, 86 deletions
diff --git a/macros/generic/markdown/examples/context-mkii.tex b/macros/generic/markdown/examples/context-mkii.tex
deleted file mode 100644
index e4f953c9a2..0000000000
--- a/macros/generic/markdown/examples/context-mkii.tex
+++ /dev/null
@@ -1,70 +0,0 @@
-\enableregime[utf]
-\usetypescript[modern][ec]
-\setupbodyfont[10pt,rm]
-\setupexternalfigures[location={local,global,default}]
-
-% Load the Markdown module.
-\usemodule[t][markdown]
-
-% Set options of the Markdown module.
-\setupmarkdown
- [
- contentBlocks = yes,
- debugExtensions = yes,
- definitionLists = yes,
- fancy_lists = yes,
- fencedCode = yes,
- hashEnumerators = yes,
- inlineNotes = yes,
- lineBlocks = yes,
- notes = yes,
- pipeTables = yes,
- rawAttribute = yes,
- smartEllipses = yes,
- strikethrough = yes,
- subscripts = yes,
- superscripts = yes,
- tableCaptions = yes,
- taskLists = yes,
- texMathDollars = yes,
- texMathDoubleBackslash = yes,
- texMathSingleBackslash = yes,
- ]
-
-% Set renderers of the Markdown module.
-\definetyping
- [latex]
-
-\setuptyping
- [latex]
- [option=TEX]
-
-\starttext
-
-% Typeset the document `example.md` by letting the Markdown package handle
-% the conversion internally.
-\inputmarkdown{./example.md}
-
-% Typeset the document `example.tex` that we prepared separately using the
-% Lua command-line interface and that contains a plain TeX representation
-% of the document `example.md`.
-\catcode`\%=12\relax
-\catcode`\#=12\relax
-\doiffileelse{./example.tex}{\input example}{}
-\catcode`\%=14\relax
-\catcode`\#=6\relax
-
-% Typeset inline markdown text.
-\startmarkdown
-
-Here are some non-ASCII characters: *ěščřžýáíé*
-and ConTeXt special characters: *|*.
-
-Here is a hard line break that we inserted directly from the TeX source
-by typing two spaces at the end of a line.
-This is stretching TeX's abilities and is only supported in ConTeXt MkIV
-and later.
-
-\stopmarkdown
-
-\stoptext
diff --git a/macros/generic/markdown/examples/context-mkiv.tex b/macros/generic/markdown/examples/context-mkiv.tex
index 9d485820cf..4c05059f3a 100644
--- a/macros/generic/markdown/examples/context-mkiv.tex
+++ b/macros/generic/markdown/examples/context-mkiv.tex
@@ -70,7 +70,7 @@ kpse.set_program_name("luatex")
\catcode`\%=14\relax
\catcode`\#=6\relax
-% Typeset inline markdown text.
+% Typeset some further examples with inline markdown text.
\startmarkdown
Here are some non-ASCII characters: *ěščřžýáíé*
diff --git a/macros/generic/markdown/examples/latex-luatex.tex b/macros/generic/markdown/examples/latex-luatex.tex
new file mode 100644
index 0000000000..18b16bf776
--- /dev/null
+++ b/macros/generic/markdown/examples/latex-luatex.tex
@@ -0,0 +1,56 @@
+\documentclass{book}
+\usepackage{polyglossia}
+\setmainlanguage{english}
+\usepackage{fontspec}
+\usepackage{booktabs}
+% Load the Markdown package and set its options.
+\usepackage[
+ contentBlocks,
+ debugExtensions,
+ definitionLists,
+ fancy_lists,
+ fencedCode,
+ hashEnumerators,
+ inlineNotes,
+ jekyllData,
+ lineBlocks,
+ notes,
+ pipeTables,
+ rawAttribute,
+ smartEllipses,
+ strikeThrough,
+ subscripts,
+ superscripts,
+ tableCaptions,
+ taskLists,
+ texMathDollars,
+ texMathDoubleBackslash,
+ texMathSingleBackslash,
+]{markdown}
+% Set the document metadata using a YAML metadata block.
+\begin{markdown*}{hybrid}
+---
+title: An Example *Markdown* Document
+author: Vít Novotný
+date: \today
+---
+\end{markdown*}
+\begin{document}
+% Typeset the document `example.md` by letting the Markdown package handle
+% the conversion internally.
+\markdownInput{./example.md}
+
+% Typeset the document `example.tex` that we prepared separately using the
+% Lua command-line interface of the Markdown package and that contains a
+% plain TeX representation of the document `example.md`.
+\catcode`\%=12\relax
+\catcode`\#=12\relax
+\InputIfFileExists{./example.tex}{}{}
+\catcode`\%=14\relax
+\catcode`\#=6\relax
+
+% Typeset some further examples with inline markdown text.
+\begin{markdown}
+Here are some non-ASCII characters: *ěščřžýáíé*.
+\end{markdown}
+\end{document}
diff --git a/macros/generic/markdown/examples/latex.tex b/macros/generic/markdown/examples/latex-pdftex.tex
index 44736c61dc..db6cbea8c8 100644
--- a/macros/generic/markdown/examples/latex.tex
+++ b/macros/generic/markdown/examples/latex-pdftex.tex
@@ -1,20 +1,10 @@
\documentclass{book}
-\usepackage{ifxetex,ifluatex}
-\ifxetex
- \usepackage{polyglossia}
- \setmainlanguage{english}
- \usepackage{fontspec}
-\else\ifluatex
- \usepackage{polyglossia}
- \setmainlanguage{english}
- \usepackage{fontspec}
-\else
- \usepackage[english]{babel}
- \usepackage[utf8]{inputenc}
- \usepackage[T1]{fontenc}
- \usepackage{lmodern}
-\fi\fi
+\usepackage[english]{babel}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
\usepackage{booktabs}
+% Load the Markdown package and set its options.
\usepackage[
contentBlocks,
debugExtensions,
@@ -38,6 +28,7 @@
texMathDoubleBackslash,
texMathSingleBackslash,
]{markdown}
+% Set the document metadata using a YAML metadata block.
\begin{markdown*}{hybrid}
---
title: An Example *Markdown* Document
@@ -59,6 +50,7 @@ date: \today
\catcode`\%=14\relax
\catcode`\#=6\relax
+% Typeset some further examples with inline markdown text.
\begin{markdown}
Here are some non-ASCII characters: *ěščřžýáíé*.
\end{markdown}
diff --git a/macros/generic/markdown/examples/latex-xetex.tex b/macros/generic/markdown/examples/latex-xetex.tex
new file mode 120000
index 0000000000..d18d544a19
--- /dev/null
+++ b/macros/generic/markdown/examples/latex-xetex.tex
@@ -0,0 +1 @@
+latex-luatex.tex \ No newline at end of file