summaryrefslogtreecommitdiff
path: root/macros/generic/markdown/examples
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/generic/markdown/examples
Initial commit
Diffstat (limited to 'macros/generic/markdown/examples')
-rw-r--r--macros/generic/markdown/examples/README.md7
-rw-r--r--macros/generic/markdown/examples/context-mkii.pdfbin0 -> 237090 bytes
-rw-r--r--macros/generic/markdown/examples/context-mkiv.pdfbin0 -> 67910 bytes
-rw-r--r--macros/generic/markdown/examples/context.tex31
-rw-r--r--macros/generic/markdown/examples/example.md131
-rw-r--r--macros/generic/markdown/examples/latex-luatex.pdfbin0 -> 63088 bytes
-rw-r--r--macros/generic/markdown/examples/latex-pdftex.pdfbin0 -> 265094 bytes
-rw-r--r--macros/generic/markdown/examples/latex-xetex.pdfbin0 -> 60564 bytes
-rw-r--r--macros/generic/markdown/examples/latex.tex42
-rw-r--r--macros/generic/markdown/examples/scientists.csv4
10 files changed, 215 insertions, 0 deletions
diff --git a/macros/generic/markdown/examples/README.md b/macros/generic/markdown/examples/README.md
new file mode 100644
index 0000000000..0d32d16ec4
--- /dev/null
+++ b/macros/generic/markdown/examples/README.md
@@ -0,0 +1,7 @@
+This directory contains example LaTeX and ConTeXt documents. These documents
+can be typeset by running the GNU `make` program in this directory. It is
+expected that your TeX installation contains the `pdflatex`, `xelatex`,
+`lualatex`, `texexec`, and `context` executables.
+
+The `markdown.dtx` file in the root directory contains documentation in the
+markdown language and can also serve as an example LaTeX document.
diff --git a/macros/generic/markdown/examples/context-mkii.pdf b/macros/generic/markdown/examples/context-mkii.pdf
new file mode 100644
index 0000000000..a17e5fc469
--- /dev/null
+++ b/macros/generic/markdown/examples/context-mkii.pdf
Binary files differ
diff --git a/macros/generic/markdown/examples/context-mkiv.pdf b/macros/generic/markdown/examples/context-mkiv.pdf
new file mode 100644
index 0000000000..ad965f37fe
--- /dev/null
+++ b/macros/generic/markdown/examples/context-mkiv.pdf
Binary files differ
diff --git a/macros/generic/markdown/examples/context.tex b/macros/generic/markdown/examples/context.tex
new file mode 100644
index 0000000000..7ed432344a
--- /dev/null
+++ b/macros/generic/markdown/examples/context.tex
@@ -0,0 +1,31 @@
+\enableregime[utf]
+\usetypescript[modern][ec]
+\setupbodyfont[10pt,rm]
+\setupexternalfigures[location={local,global,default}]
+\usemodule[t][markdown]
+\def\markdownOptionHashEnumerators{true}
+\def\markdownOptionDefinitionLists{true}
+\def\markdownOptionSmartEllipses{true}
+\def\markdownOptionFootnotes{true}
+\def\markdownOptionInlineFootnotes{true}
+\def\markdownOptionFencedCode{true}
+\def\markdownOptionContentBlocks{true}
+\def\markdownOptionPipeTables{true}
+\def\markdownOptionTableCaptions{true}
+\definetyping [latex]
+\setuptyping [latex] [option=TEX]
+\starttext
+% 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 and that contains a plain TeX representation
+% of the document `example.md`.
+\doiffileelse{./example.tex}{\input example}{}
+
+\startmarkdown
+Here are some non-ASCII characters: *ěščřžýáíé*
+and ConTeXt special characters: *|*.
+\stopmarkdown
+\stoptext
diff --git a/macros/generic/markdown/examples/example.md b/macros/generic/markdown/examples/example.md
new file mode 100644
index 0000000000..8aeb423a20
--- /dev/null
+++ b/macros/generic/markdown/examples/example.md
@@ -0,0 +1,131 @@
+This is an H1
+=============
+
+This is an H2
+-------------
+
+### This is an H3
+#### This is an H4
+##### This is an H5
+###### This is an H6
+
+This is a text paragraph containing an ellipsis ... and followed by a horizontal rule.
+
+***
+
+This is inline `code`. This is a [link](http://google.cz "Google"). _This is an *emphasized* span of text_. __This is a **strongly emphasized** span of text__.
+
+ ![example image](example-image.pdf "An example image from Martin Scharrer's mwe package")
+
+ /scientists.csv (The great minds of the 19th century rendered via a content block)
+
+This is a fenced code block:
+
+``` latex
+\documentclass{article}
+\begin{document}
+ Hello world!
+\end{document}
+```
+
+This is a table:
+
+| Right | Left | Default | Center |
+|------:|:-----|---------|:------:|
+| 12 | 12 | 12 | 12 |
+| 123 | 123 | 123 | 123 |
+| 1 | 1 | 1 | 1 |
+
+ : Demonstration of pipe table syntax.
+
+This is a bullet list:
+
+ * The first item of a bullet list
+
+ that spans several paragraphs,
+ * the second item of a bullet list,
+ * the third item of a bullet list.
+
+This is a compact bullet list:
+
+ * The first item of a bullet list,
+ * the second item of a bullet list,
+ * the third item of a bullet list.
+
+This is an ordered list:
+
+ 5. The first item of an ordered list
+
+ that spans several paragraphs,
+ 6. the second item of an ordered list,
+ 7. the third item of an ordered list.
+
+This is an ordered list using hash enumerators:
+
+ #. The first item of an ordered list
+
+ that spans several paragraphs,
+ #. the second item of an ordered list,
+ #. the third item of an ordered list.
+
+This is a compact ordered list:
+
+ 5. The first item of an ordered list,
+ 6. the second item of an ordered list,
+ 7. the third item of an ordered list.
+
+This is a compact ordered list using hash enumerators:
+
+ #. The first item of an ordered list,
+ #. the second item of an ordered list,
+ #. the third item of an ordered list.
+
+This is a definition list:
+
+Term 1
+
+: Definition 1
+
+*Term 2*
+
+: Definition 2
+
+ Some code, part of Definition 2
+
+ Third paragraph of Definition 2.
+
+: Definition 3
+
+This is a compact definition list:
+
+Term 1
+: Definition 1
+*Term 2*
+: Definition 2
+: Definition 3
+
+This is a block quote:
+
+> This is the first level of quoting.
+>
+> > This is nested blockquote.
+>
+> Back to the first level.
+
+Here is a footnote reference[^1] and another.[^longnote]
+Here is an inline note.^[Inlines notes are easier to
+write, since you don't have to pick an identifier and
+move down to type the note.]
+
+[^1]: Here is the footnote.
+
+[^longnote]: Here's one with multiple blocks.
+
+ Subsequent paragraphs are indented to show that they
+belong to the previous footnote.
+
+ Some code
+
+ The whole paragraph can be indented, or just the first
+ line. In this way, multi-paragraph footnotes work like
+ multi-paragraph list items.
diff --git a/macros/generic/markdown/examples/latex-luatex.pdf b/macros/generic/markdown/examples/latex-luatex.pdf
new file mode 100644
index 0000000000..1ce6e43d49
--- /dev/null
+++ b/macros/generic/markdown/examples/latex-luatex.pdf
Binary files differ
diff --git a/macros/generic/markdown/examples/latex-pdftex.pdf b/macros/generic/markdown/examples/latex-pdftex.pdf
new file mode 100644
index 0000000000..f5eca2597a
--- /dev/null
+++ b/macros/generic/markdown/examples/latex-pdftex.pdf
Binary files differ
diff --git a/macros/generic/markdown/examples/latex-xetex.pdf b/macros/generic/markdown/examples/latex-xetex.pdf
new file mode 100644
index 0000000000..3c9f0ff75d
--- /dev/null
+++ b/macros/generic/markdown/examples/latex-xetex.pdf
Binary files differ
diff --git a/macros/generic/markdown/examples/latex.tex b/macros/generic/markdown/examples/latex.tex
new file mode 100644
index 0000000000..07ebe631f9
--- /dev/null
+++ b/macros/generic/markdown/examples/latex.tex
@@ -0,0 +1,42 @@
+\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{booktabs}
+\usepackage[
+ hashEnumerators,
+ definitionLists,
+ footnotes,
+ inlineFootnotes,
+ smartEllipses,
+ fencedCode,
+ contentBlocks,
+ pipeTables,
+ tableCaptions,
+]{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`.
+\InputIfFileExists{./example.tex}{}{}
+
+\begin{markdown}
+Here are some non-ASCII characters: *ěščřžýáíé*.
+\end{markdown}
+\end{document}
diff --git a/macros/generic/markdown/examples/scientists.csv b/macros/generic/markdown/examples/scientists.csv
new file mode 100644
index 0000000000..dee7830edf
--- /dev/null
+++ b/macros/generic/markdown/examples/scientists.csv
@@ -0,0 +1,4 @@
+Name,Surname,Born
+Albert,Einstein,1879
+Marie,Curie,1867
+Thomas,Edison,1847