1+ # Markdown plug-in
2+
13# TeXmacs markdown plugin
24
35This plugin is a (for now one-way) converter to markdown format for
@@ -10,8 +12,9 @@ and pasting into the markdown file.
1012The plugin has been developed for its use in two specific websites,
1113[ Paperwhy] ( https://paperwhy.8027.org/ ) and appliedAI's
1214[ TransferLab] ( https://transferlab.appliedai.de/ ) , and can use multiple
13- extensions specific to the static website generator [ Hugo] ( https://gohugo.io/ ) .
14- There might still be some code very specific to those sites, YMMV.
15+ extensions specific to the static website generator
16+ [ Hugo] ( https://gohugo.io/ ) . There might still be some code very specific to
17+ those sites, YMMV.
1518
1619## Setup
1720
@@ -30,6 +33,18 @@ For Windows, the path (usually?) is
3033
3134You can activate a menu with ` Tools -> Markdown plugin ` .
3235
36+ ## Extensions to vanilla markdown
37+
38+ Besides standard Markdown, this plugins does the following:
39+
40+ * Footnotes (and marginal notes, exported as footnotes for vanilla markdown).
41+ * Links to equations and equation arrays. Labels are exported as HTML
42+ ` <span> ` with identifiers sanitized and custom CSS. See
43+ ` extensions/tmmarkdown.css ` .
44+ * Support for most standard environments, both numbered and unnumbered.
45+ Localized and with support for references and ` <smart-ref> ` .
46+ * Probably more…
47+
3348## Hugo support
3449
3550In addition to standard markdown, almost everything that Hugo supports can be
@@ -40,55 +55,45 @@ Setting values for the frontmatter is suported via a dedicated macro defined
4055in ` hugo.ts ` . To use it first insert the ` Markdown -> Hugo ` package in
4156` Document -> Style -> Add package ` or using the plus sign in the focus bar.
4257
43- Now you can type ` \hugo-front ` and input any number of key|value pairs as
44- arguments, one argument each. That is: type ` \hugo-front ` , then use structured
45- insert right to add two arguments and use the first for the key and the second
46- for the value. Repeat as needed. Currently, only strings, lists of strings and
47- dates (insert with ` \date ` ) are supported as values. To enter a list, input
48- ` \tuple ` as the value and use structured insert right to add items.
58+ Now you can use ` <hugo-front> ` to input any number of ` key|value ` pairs as
59+ arguments, one argument each. That is: insert the tag ` <hugo-front> ` , then use
60+ structured insert right to add two arguments and use the first for the key and
61+ the second for the value. Repeat as needed. It is possible to use strings,
62+ booleans (“true”, “false”) or dates (insert with ` <date> ` ). Additionally, the
63+ macro ` <pdf-name> ` inserts the name of the file with ` .pdf ` appended. To enter
64+ a list, input ` <tuple> ` as the value and use structured insert right to add
65+ items. To input a dictionary, use ` <dict> ` and again use structured insert to
66+ create tuples of ` key|value ` .
4967
5068### Supported shortcodes
5169
52- Some of the texmacs markdown requires custom shortcodes and layouts. You can
53- find them in ` extensions/hugo ` . Just copy the partials and shortcodes to your
54- Hugo project.
55-
56- * Figures are converted to ` {{< tmfigure … >}} ` . This is a simplified version
57- of Hugo's ` {{<figure>}} ` , which can have ` .Inner ` content. This is required
58- e.g. to have citations in captions or arbitrary markup.
59- * To introduce any shortcode in a TeXmacs document, you can use the macro
60- ` \hugo-short ` .
61- * Citations are automatically detected and converted to
62- ` {{< cite ref1 ref2 ... >}} ` , and all of them are gathered in the frontmatter
63- as well, for indization by Hugo's taxonomy system. The presentation of the
64- label itself is done using CSS. Include the partial ` ref_labels.html.html `
65- in the document ` <head> ` for that.
66- * Bibliography is rendered with the ` references.html.html ` template.
70+ All custom shortcodes are in ` extensions/hugo/ ` .
71+
72+ * Figures are converted to ` {{< figure … >}} ` .
73+ * For arbitrary shortcodes, use ` <hugo-short> ` , e.g. ` <hugo-short|toc> ` for
74+ ` {{< toc >}} ` .
75+ * Citations are automatically detected and converted to `{{< cite ref
76+ > }}`, and all of them are gathered in the frontmatter as well, for
77+ indization by Hugo's taxonomy system. The rendering of bibliography is done
78+ by ` {{< references >}} ` .
79+ * Marginal notes and figures are converted to ` {{< sidenote … >}} `
80+ and ` {{< sidefigure … >}} ` .
6781
6882# Known issues
6983
70- * The converter can break with malformed or unexpected input, like markup
71- inside tags whose values should be strings, although some cases are (a bit
72- sloppily) handled.
73- * Error reporting is rather lacking. Run TeXmacs in a console to see stack
84+ For an up-to date list, see the [ issue tracker in
85+ GitHub] ( https://github.com/texmacs/markdown/issues/ ) .
86+
87+ * The converter can break with malformed or unexpected input, like markup
88+ inside tags whose values should be strings (although many cases are
89+ “handled”)
90+ * Error reporting is rather lacking. Run TeXmacs in a console to see stack
7491 traces and such in case you are running into problems.
75- * No tables (yet)!
76- * Images must be linked, not embedded in the document.
77-
78- # To do
79-
80- * Reverse markdown to TeXmacs conversion.
81- * Declare converter options in init file, and use.
82- * Make behaviour of all tags configurable, e.g. to support different styles.
83- For instance, should titles, chapters or sections be ` h1 ` ?
84- * Extract all Hugo extensions to a separate file, use overloading and
85- extension of the dispatch hashmaps.
86- * Use “converter environments”?
87- * Use TeXmacs' ` logic-dispatch ` ?
88- * line-breaks and other markup in doc-data (e.g. in the doc-title) need to be
89- properly handled if included in YAML metadata for Hugo.
90- * Support for tables.
91- * Extract embedded images.
92+ * EPS and PDF images are not supported by browsers. As a workaround allowing
93+ to have both, use ` <md-alt-image> ` . The first argument is for TeXmacs and
94+ the second one for the markdown export.
95+ * The converter supports only one style. For instance all environments have
96+ emphasized bodies and bold names, ` <section> ` is exported as ` h1 ` , etc.
9297
9398# License
9499
0 commit comments