This commit is contained in:
randogoth 2025-10-20 17:48:57 +03:00
parent 5067b9ec65
commit 8283dd45ea
6 changed files with 808 additions and 60 deletions

View file

@ -1,47 +1,45 @@
# md2txt
```
                    $$\  $$$$$$\    $$\                 $$\     
                    $$ |$$  __$$\   $$ |                $$ |    
$$$$$$\$$$$\   $$$$$$$ |\__/  $$ |$$$$$$\   $$\   $$\ $$$$$$\   
$$  _$$  _$$\ $$  __$$ | $$$$$$  |\_$$  _|  \$$\ $$  |\_$$  _|  
$$ / $$ / $$ |$$ /  $$ |$$  ____/   $$ |     \$$$$  /   $$ |    
$$ | $$ | $$ |$$ |  $$ |$$ |        $$ |$$\  $$  $$<    $$ |$$\ 
$$ | $$ | $$ |\$$$$$$$ |$$$$$$$$\   \$$$$  |$$  /\$$\   \$$$$  |
\__| \__| \__| \_______|\________|   \____/ \__/  \__|   \____/ 
```
This repository contains the `md2txt` command line tool and supporting libraries for transforming Markdown into formats that work well on retro hardware or constrained text viewers. A small plugin API lets you mix-and-match parsers and renderers so additional formats can plug into the same preprocessing pipeline.
## CLI
- `md2txt` converts Markdown into 80-column, DOS-compatible plain text with extensive formatting support. It ships with the default `markdown` parser and `text` renderer plugins, registers optional `micron` and `ama` renderers for Micron/Ancient Machine Book output, and exposes the core pipeline so you can add your own parser or renderer modules:
- FIGlet-rendered headings (H1H3) driven by optional YAML frontmatter (`h1_font`, `h2_font`, `h3_font`).
- H4+ headings rendered in uppercase with dashed underlines.
- Emphasis styles converted to spaced or delimited characters, e.g. `**bold**``B O L D`, `__strong__``_s_t_r_o_n_g_`, `~~strike~~``~s~t~r~i~k~e~`.
- Blockquotes prefixed by `|    `, lists preserved, inline code untouched.
- Code blocks numbered (`01 | line`), with both fenced and indented fences supported (see “Rendering Controls” for customisation).
- Links transformed into `[label](n)` references, with footnote-style URL list at the end.
- `md2txt` converts Markdown into plain text with extensive formatting support. It ships with the default `markdown` parser and `text` renderer plugins, registers optional `micron` and `ama` renderers for Micron/Ancient Machine Book output, and exposes the core pipeline so you can add your own parser or renderer modules:
- FIGlet-rendered headings.
- Emphasis styles converted to spaced or delimited characters.
- Optional alignment and margin controls via HTML `<p>` attributes or MultiMarkdown attribute blocks (e.g. `{:.center margin=20px}`) applied as leading spaces.
- ASCII art injection with `#[label :align](art.txt)` syntax, supporting multiple art pieces per line and optional `{: .right}` style annotations.
- Per-document toggles for code block wrapping, numbering, blockquote decoration, and list indentation spacing.
## Requirements
- Python 3.9+.
- Optional: `PyHyphen` (preferred) or `pyphen` for dictionary-driven hyphenation.
- Optional: `pyfiglet` for FIGlet headings (`pip install pyfiglet`). When unavailable, headings fall back to the H4-style renderer automatically.
## Usage
```bash
md2txt input.md -o output.txt # convert to DOS-friendly text
md2txt input.md # write result to stdout
md2txt input.md --width 72 # override column width
md2txt input.md --parser markdown --renderer micron # emit Micron-formatted output
md2txt input.md --renderer ama # emit AMB/AMA markup
md2txt input.md --renderer-option width=68 # pass KEY=VALUE to a renderer
# If the project is not installed yet:
python -m md2txt input.md
md2txt input.md -o output.txt # convert to DOS-friendly text
md2txt input.md # write result to stdout
md2txt input.md --width 72 # override column width
md2txt input.md --renderer micron # emit Micron-formatted output
md2txt input.md --renderer ama # emit AMB/AMA markup
md2txt input.md --renderer-option width=68 # pass KEY=VALUE to a renderer
```
`--parser` and `--renderer` select a plugin by name (defaults are `markdown` and `text`). Repeatable `--parser-option KEY=VALUE` and `--renderer-option KEY=VALUE` pairs are forwarded to the plugin factories as keyword arguments in addition to the defaults supplied by the CLI. The CLI accepts `--help` for the full option list.
- `--parser` and `--renderer` select a plugin by name (defaults are `markdown` and `text`).
- Repeatable `--parser-option KEY=VALUE` and `--renderer-option KEY=VALUE` pairs are forwarded to the plugin factories as keyword arguments in addition to the defaults supplied by the CLI.
- The CLI accepts `--help` for the full option list.
## FIGlet Fonts via Frontmatter
## Rendering Controls via Frontmatter
You can set FIGlet fonts for H1H3 per document using YAML frontmatter:
Fine-tune formatting by adding keys to frontmatter:
```markdown
```yaml
---
h1_font: slant
h2_font: standard
@ -51,13 +49,25 @@ margin_right: 4
hyphenate: true
hyphen_lang: en_US
---
# Main Title
## Section Heading
### Subsection
```
Font names also accept the special keywords `caps` (force uppercase) and `title` (title case) for any heading. `margin_left` and `margin_right` add leading/trailing spaces to body text, `paragraph_spacing` (or `lines_between_paragraphs`) inserts blank lines between paragraphs, enabling `hyphenate` activates PyHyphen-based wrapping (optional `hyphen_lang` defaults to `en_US`), and `header_spacing` controls how many blank lines precede headings (default `2`). Set `figlet_fallback: true` to force an H4-style fallback when a FIGlet banner would overflow; when omitted (the default), the banner is kept even if it extends beyond the width.
| Key | Description |
| --- | --- |
| `blockquote_bars: false` | Replace the default `|` prefix with three spaces. |
| `code_block_line_numbers: false` | Disable the `01 |` gutter in wrapped or unwrapped code blocks. |
| `code_block_wrap: <bool or int>` | Enables wrapping; when set to an integer it also controls the extra indentation applied to wrapped continuation lines. |
| `figlet_fallback: true` | force an H4-style fallback when a FIGlet banner would overflow; when omitted (the default), the banner is soft wrapping to honor width and margins. |
| `h#_font: <font>` | Accepts any known figlet font name or one of the keywords `caps` (force uppercase) and `title` (title case) to define headings.
| `hyphenate: true` | activates PyHyphen-based wrapping (optional `hyphen_lang` defaults to `en_US`) |
| `header_spacing` | controls how many blank lines precede headings (default `2`). |
| `list_marker_indent: <int>` | Extra spaces inserted before list markers. |
| `list_text_spacing: <int>` | Spaces between the marker and the wrapped list text. |
| `margin_left`/`margin_right` | add leading/trailing spaces to body text |
| `paragraph_spacing` | inserts blank lines between paragraphs |
| `wrap_code_blocks: true` | Wrap fenced/indented code blocks to fit the page width instead of using a gutter. |
All values are optional—defaults maintain the legacy behaviour.
## Styling via Attribute Blocks
@ -98,22 +108,6 @@ Inline or block-level ASCII art can be embedded directly in Markdown:
- `#[label](file)` loads the contents of the text file and inserts it as a preformatted block.
- Colon tags inside the label (`:left`, `:center`, `:right`) steer the alignment of each art piece. Additional colon tags are ignored.
- When multiple directives appear on the same line, the pieces are laid out side-by-side when space permits, otherwise they fall back to stacked blocks.
- A trailing MultiMarkdown attribute block (e.g. `{:.center}`) is applied to the combined block after the art has been injected.
## Rendering Controls via Frontmatter
Fine-tune formatting by adding keys to frontmatter:
| Key | Description |
| --- | --- |
| `wrap_code_blocks: true` | Wrap fenced/indented code blocks to fit the page width instead of using a gutter. |
| `code_block_wrap: <bool or int>` | Enables wrapping; when set to an integer it also controls the extra indentation applied to wrapped continuation lines. |
| `code_block_line_numbers: false` | Disable the `01 |` gutter in wrapped or unwrapped code blocks. |
| `blockquote_bars: false` | Replace the default `|` prefix with three spaces. |
| `list_marker_indent: <int>` | Extra spaces inserted before list markers. |
| `list_text_spacing: <int>` | Spaces between the marker and the wrapped list text. |
All values are optional—defaults maintain the legacy behaviour.
## Output Line Endings

254
examples/loremipsum.ama Normal file
View file

@ -0,0 +1,254 @@
___ _ _ _ _
/ __| __ _| (_)___ _ _| |_(_)__ _
\__ \/ _` | | / -_) ' \ _| / _` |
|___/\__,_|_|_\___|_||_\__|_\__,_|
%h Structa hinc vetitus factum
Lorem markdownum omnes tellus, in, Herculeis `=reciprocalPower`= neque
promissa est Latiae caput umero talia fidissima, nymphae. Foedera et
sagittas tenetur adde matri esse: talia manibus.
%h Fuit video longique dedisse
Ille stupet, ultra %!INCUNABULA AGENDUM URBES%t mirer %!APER%t, metu.
Aegides novissima sunt turis quatiebant umbrosaque putares (<#mille-p-
arva>). Metuunt eruiturque maximus velit, ater Vesta vulnus rustica v-
erba! Mei vincite nulla, in Iovem: fama exurunt vernum!
De instat ubi induit fugientia inertes columbas tarda %!terga Parnasia
%! sententia%t omnia inmotusque, est et aetas sonus. Exhibuit coeperunt,
canis. Suis minora, tempore fateor neve moderamine erit. Non %!hoc ra-
%! diis%t, Aenea etiamnum cogeris superinposita origine nec `=hardening_-
search`= dixit vicina. Heros subito populifer adeunt quicquam cum %!A-
%! LES%t Ixion angulus placet reddere.
%h Tractaque serpens arva quoque
_ _ _ _ _ _ ___ __
| |_ / | | || |___ __ _ __| (_)_ _ __ _ ( _ )__\ \
| ' \| | | __ / -_) _` / _` | | ' \/ _` | / _ \___| |
|_||_|_| |_||_\___\__,_\__,_|_|_||_\__, | \___/ | |
|___/ /_/
%h h2 Heading
%h h3 Heading
_ _ _ _ _ _ _
| |__ | || | | | | | ___ __ _ __| (_)_ __ __ _
| '_ \| || |_ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
| | | |__ _| | _ | __/ (_| | (_| | | | | | (_| |
|_| |_| |_| |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|___/
_ ____ _ _ _ _
| |__ | ___| | | | | ___ __ _ __| (_)_ __ __ _
| '_ \|___ \ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
| | | |___) | | _ | __/ (_| | (_| | | | | | (_| |
|_| |_|____/ |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|___/
_ __ _ _ _ _
| |__ / /_ | | | | ___ __ _ __| (_)_ __ __ _
| '_ \| '_ \ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
| | | | (_) | | _ | __/ (_| | (_| | | | | | (_| |
|_| |_|\___/ |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|___/
%h Horizontal Rules
----------------------------------------------------------------------
----------------------------------------------------------------------
----------------------------------------------------------------------
%h Emphasis
%!THIS IS BOLD TEXT%t %bTHIS IS BOLD TEXT%t %!This is italic text%t %-
bThis is italic text%t Strikethrough
%h Blockquotes
Blockquotes can also be nested...
by using additional greater-than signs right next to each oth-
er...
or with spaces between arrows.
%h Lists
%h Unordered
+ Create a list by starting a line with `=+`=, `=-`=, or `=*`=
- Marker character change forces new list start:
* Ac tristique libero volutpat at
+ Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
+ Very easy
%h Ordered
1. Lorem ipsum dolor sit amet
2. Consectetur adipiscing elit
3. Integer molestie lorem at massa
%h Code
Inline `=code`=
Indented code
`=
// Some comments
line 1 of code
line 2 of code
line 3 of code
`=
Block code "fences"
`=
Sample text here...
`=
Syntax highlighting
`=
var foo = function (bar) {
return bar++;
};
console.log(foo(5));
`=
%h Links
link text (<http://dev.nodeca.com>)
link with title (<http://nodeca.github.io/pica/demo/ "title text!">)
%h Images
Minion (<https://octodex.github.com/images/minion.png>) Stormtroopocat
(<https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroo-
pocat">)
Inprudens dum memor alma, casses dedi Sinuessa iam quid adicit `=gate-
_truncate_wave`=. Geratur de (<#salientia-iungit-contra-et>), insolida
temptat `=open`= carentia; genitorem solet, potens. Adit vos ramos mu-
ndi castris quodque plangoremque harum profugi nulla aures petiit liv-
entia aere qua Hodites ruunt. Achaidos dilexisse `=redundancy`= prae-
sagia tenuatus necis %!CAPYS RECORDOR%t tenebras actis signis, reliq-
uit, placidissime iram liquefactis longe nervi famem. Cura pars na-
tique velleris semel et at `=printerWildcardParallel`= inquit posi-
tosque comites ultra.
%h Quantaque augent
Acuti ignotis ignis, ostendit nostras terras nondum, petit utque utero
(<#structa-hinc-vetitus-factum>) sepulcrales, pluma reseratis Ismario.
Tria silentia duae %!nymphe%t: certe parva cernam et dixit. Verborum
sedisti (<#mille-parva>).
`=
if (firewall(4, 3) == 1 * device_media_parity) {
system_copy_class += systray + oasis_wi_clean + lpi;
modelLdap.search_secondary_socket *=
bounce.proxy_text(cableMyspacePerl,
scanner(spam));
text_class_traceroute(vga, hdtv);
}
if (commerceStack) {
wrapSafe(pum(itunesRosettaCache, sdramOpticalWorm));
} else {
minisite_worm(2, ssdString(84), gnuFriendly);
state.qwerty(moduleJavascriptFloating + ugc, koffice,
mail_system.prebinding_service_teraflops(mediaIcmpB
oot));
}
memoryHexadecimalMultitasking += oop_android;
var passive_vdu = bar;
var ddrJava = leaf(unc_web);
`=
%h Mille parva
%!MINETUR ET%t aurum! Charaxi sanguine quo; vires subnectite %!PIGNOR-
%! A%t, omnique hostibus loquerentur aquae Solis ferox? %!CUM NE%t, putat
utar ex ad aede mane. Vitalesque geminas exstimulat, iam vivunt dat a-
rtes et quem! Iam violas molire ipse, spoliabitur dente nervis regis,
factos quae.
Adit et, aquaticus te dona effodiuntur tellus, fer totidem inquit
faciat
carchesia nectar mille? Indestrictus vestes ut et offensasque in-
tibaque deum
agitur linguae maiestas te rictus %!tecum laniatque dixit%t ad dat-
as `=adsl`=.
Vino %!ut%t quod iaculi mutua armis uno est vos totidemque
exhortor (<#tractaque-serpens-arva-quoque>). Iamdudum Romanae cepi
linguisque
velit accipe idem acutis hoc sparsumque dextra. Minoide sponte col-
lo sequitur
et intus flere sanguineaque herba, nox Quas adsiduo %!cunctantem%t
tibi; enim.

View file

@ -1,15 +1,13 @@
---
h1_font: big
h2_font: small
h3_font: caps
margin_left: 12
margin_right: 12
h1_font: small
h2_font: caps
h3_font: title
margin_left: 4
margin_right: 4
paragraph_spacing: 2
code_block_line_numbers: false
code_block_wrap: 4
blockquote_bars: false
list_marker_indent: 2
list_text_spacing: 3
list_text_spacing: 1
hyphenate: true
---
@ -41,10 +39,6 @@ populifer adeunt quicquam cum **ales** Ixion angulus placet reddere.
## Tractaque serpens arva quoque
{:.center}
# Include
#[d1 :left](dragon.txt) #[d1 :center :mirror](dragon.txt) #[d1 :right](dragon.txt)
![[markdown.md]]
Inprudens dum memor alma, casses dedi Sinuessa iam quid adicit

230
examples/loremipsum.mu Normal file
View file

@ -0,0 +1,230 @@
___ _ _ _ _
/ __| __ _| (_)___ _ _| |_(_)__ _
\__ \/ _` | | / -_) ' \ _| / _` |
|___/\__,_|_|_\___|_||_\__|_\__,_|
>> Structa hinc vetitus factum
Lorem markdownum omnes tellus, in, Herculeis `=reciprocalPower`= neque
promissa est Latiae caput umero talia fidissima, nymphae. Foedera et sa-
gittas tenetur adde matri esse: talia manibus.
>> Fuit video longique dedisse
Ille stupet, ultra `!incunabula agendum urbes`! mirer `!aper`!, metu. A-
egides novissima sunt turis quatiebant umbrosaque `[putares`#mille-parv-
a]. Metuunt eruiturque maximus velit, ater Vesta vulnus rustica verba!
Mei vincite nulla, in Iovem: fama exurunt vernum!
De instat ubi induit fugientia inertes columbas tarda `*terga Parnasia
sententia`* omnia inmotusque, est et aetas sonus. Exhibuit coeperunt, c-
anis. Suis minora, tempore fateor neve moderamine erit. Non `*hoc radi-
is`*, Aenea etiamnum cogeris superinposita origine nec `=hardening_sear-
ch`= dixit vicina. Heros subito populifer adeunt quicquam cum `!ales`!
Ixion angulus placet reddere.
>> Tractaque serpens arva quoque
_ _ _ _ _ _ ___ __
| |_ / | | || |___ __ _ __| (_)_ _ __ _ ( _ )__\ \
| ' \| | | __ / -_) _` / _` | | ' \/ _` | / _ \___| |
|_||_|_| |_||_\___\__,_\__,_|_|_||_\__, | \___/ | |
|___/ /_/
>> h2 Heading
>>> h3 Heading
_ _ _ _ _ _ _
| |__ | || | | | | | ___ __ _ __| (_)_ __ __ _
| '_ \| || |_ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
| | | |__ _| | _ | __/ (_| | (_| | | | | | (_| |
|_| |_| |_| |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|___/
_ ____ _ _ _ _
| |__ | ___| | | | | ___ __ _ __| (_)_ __ __ _
| '_ \|___ \ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
| | | |___) | | _ | __/ (_| | (_| | | | | | (_| |
|_| |_|____/ |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|___/
_ __ _ _ _ _
| |__ / /_ | | | | ___ __ _ __| (_)_ __ __ _
| '_ \| '_ \ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
| | | | (_) | | _ | __/ (_| | (_| | | | | | (_| |
|_| |_|\___/ |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|___/
>> Horizontal Rules
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
>> Emphasis
`!This is bold text`! `!This is bold text`! `*This is italic text`* `*T-
his is italic text`* ~~Strikethrough~~
>> Blockquotes
>>>>Blockquotes can also be nested...
>>>>>>>>by using additional greater-than signs right next to each oth-
>>>>>>>>er...
>>>>>>>>>>>>or with spaces between arrows.
>> Lists
>>> Unordered
+ Create a list by starting a line with `=+`=, `=-`=, or `=*`=
- Marker character change forces new list start:
* Ac tristique libero volutpat at
+ Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
+ Very easy
>>> Ordered
1. Lorem ipsum dolor sit amet
2. Consectetur adipiscing elit
3. Integer molestie lorem at massa
>> Code
Inline `=code`=
Indented code
`=
// Some comments
line 1 of code
line 2 of code
line 3 of code
`=
Block code "fences"
`=
Sample text here...
`=
Syntax highlighting
`=
var foo = function (bar) {
return bar++;
};
console.log(foo(5));
`=
>> Links
`[link text`http://dev.nodeca.com]
`[link with title`http://nodeca.github.io/pica/demo/ "title text!"]
>> Images
`[Minion`https://octodex.github.com/images/minion.png] `[Stormtroopocat-
`https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopoc-
at"]
Inprudens dum memor alma, casses dedi Sinuessa iam quid adicit `=gate_t-
runcate_wave`=. `[Geratur de`#salientia-iungit-contra-et], insolida tem-
ptat `=open`= carentia; genitorem solet, potens. Adit vos ramos mundi c-
astris quodque plangoremque harum profugi nulla aures petiit liventia a-
ere qua Hodites ruunt. Achaidos dilexisse `=redundancy`= praesagia tenu-
atus necis `!Capys recordor`! tenebras actis signis, reliquit, placidis-
sime iram liquefactis longe nervi famem. Cura pars natique velleris sem-
el et at `=printerWildcardParallel`= inquit positosque comites ultra.
>> Quantaque augent
Acuti ignotis ignis, ostendit nostras terras nondum, `[petit utque uter-
o`#structa-hinc-vetitus-factum] sepulcrales, pluma reseratis Ismario. T-
ria silentia duae `*nymphe`*: certe parva cernam et dixit. `[Verborum s-
edisti`#mille-parva].
`=
if (firewall(4, 3) == 1 * device_media_parity) {
system_copy_class += systray + oasis_wi_clean + lpi;
modelLdap.search_secondary_socket *= bounce.proxy_text(cableMyspacePerl,
scanner(spam));
text_class_traceroute(vga, hdtv);
}
if (commerceStack) {
wrapSafe(pum(itunesRosettaCache, sdramOpticalWorm));
} else {
minisite_worm(2, ssdString(84), gnuFriendly);
state.qwerty(moduleJavascriptFloating + ugc, koffice,
mail_system.prebinding_service_teraflops(mediaIcmpBoot));
}
memoryHexadecimalMultitasking += oop_android;
var passive_vdu = bar;
var ddrJava = leaf(unc_web);
`=
>>> Mille parva
`!Minetur et`! aurum! Charaxi sanguine quo; vires subnectite `!pigno-
ra`!, omnique hostibus loquerentur aquae Solis ferox? `!Cum ne`!, putat
utar ex ad aede mane. Vitalesque geminas exstimulat, iam vivunt dat art-
es et quem! Iam violas molire ipse, spoliabitur dente nervis regis, fac-
tos quae.
>>>>Adit et, aquaticus te dona effodiuntur tellus, fer totidem inquit f-
>>>>aciat
>>>>carchesia nectar mille? Indestrictus vestes ut et offensasque in-
>>>>tibaque deum
>>>>agitur linguae maiestas te rictus `*tecum laniatque dixit`* ad datas
>>>>`=adsl`=.
>>>>Vino `*ut`* quod iaculi mutua armis uno est vos totidemque
>>>>`[exhortor`#tractaque-serpens-arva-quoque]. Iamdudum Romanae cepi l-
>>>>inguisque
>>>>velit accipe idem acutis hoc sparsumque dextra. Minoide sponte collo
>>>>sequitur
>>>>et intus flere sanguineaque herba, nox Quas adsiduo `*cunctantem`*
>>>>tibi; enim.

146
examples/markdown.ama Normal file
View file

@ -0,0 +1,146 @@
_ _ _ _ _ _ ___ __
| |_ / | | || |___ __ _ __| (_)_ _ __ _ ( _ )__\ \
| ' \| | | __ / -_) _` / _` | | ' \/ _` | / _ \___| |
|_||_|_| |_||_\___\__,_\__,_|_|_||_\__, | \___/ | |
|___/ /_/
%h h2 Heading
%h h3 Heading
_ _ _ _ _ _ _
| |__ | || | | | | | ___ __ _ __| (_)_ __ __ _
| '_ \| || |_ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
| | | |__ _| | _ | __/ (_| | (_| | | | | | (_| |
|_| |_| |_| |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|___/
_ ____ _ _ _ _
| |__ | ___| | | | | ___ __ _ __| (_)_ __ __ _
| '_ \|___ \ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
| | | |___) | | _ | __/ (_| | (_| | | | | | (_| |
|_| |_|____/ |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|___/
_ __ _ _ _ _
| |__ / /_ | | | | ___ __ _ __| (_)_ __ __ _
| '_ \| '_ \ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
| | | | (_) | | _ | __/ (_| | (_| | | | | | (_| |
|_| |_|\___/ |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|___/
%h Horizontal Rules
--------------------------------------------------------------------------
--------------------------------------------------------------------------
--------------------------------------------------------------------------
%h Emphasis
%!THIS IS BOLD TEXT%t %bTHIS IS BOLD TEXT%t %!This is italic text%t %bThis
%b is italic text%t Strikethrough
%h Blockquotes
Blockquotes can also be nested...
by using additional greater-than signs right next to each other...
or with spaces between arrows.
%h Lists
%h Unordered
+ Create a list by starting a line with `=+`=, `=-`=, or `=*`=
- Marker character change forces new list start:
* Ac tristique libero volutpat at
+ Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
+ Very easy
%h Ordered
1. Lorem ipsum dolor sit amet
2. Consectetur adipiscing elit
3. Integer molestie lorem at massa
%h Code
Inline `=code`=
Indented code
`=
// Some comments
line 1 of code
line 2 of code
line 3 of code
`=
Block code "fences"
`=
Sample text here...
`=
Syntax highlighting
`=
var foo = function (bar) {
return bar++;
};
console.log(foo(5));
`=
%h Links
link text (<http://dev.nodeca.com>)
link with title (<http://nodeca.github.io/pica/demo/ "title text!">)
%h Images
Minion (<https://octodex.github.com/images/minion.png>) Stormtroopocat
(<https://octodex.github.com/images/stormtroopocat.jpg "The
Stormtroopocat">)

130
examples/markdown.mu Normal file
View file

@ -0,0 +1,130 @@
_ _ _ _ _ _ ___ __
| |_ / | | || |___ __ _ __| (_)_ _ __ _ ( _ )__\ \
| ' \| | | __ / -_) _` / _` | | ' \/ _` | / _ \___| |
|_||_|_| |_||_\___\__,_\__,_|_|_||_\__, | \___/ | |
|___/ /_/
>> h2 Heading
>>> h3 Heading
_ _ _ _ _ _ _
| |__ | || | | | | | ___ __ _ __| (_)_ __ __ _
| '_ \| || |_ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
| | | |__ _| | _ | __/ (_| | (_| | | | | | (_| |
|_| |_| |_| |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|___/
_ ____ _ _ _ _
| |__ | ___| | | | | ___ __ _ __| (_)_ __ __ _
| '_ \|___ \ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
| | | |___) | | _ | __/ (_| | (_| | | | | | (_| |
|_| |_|____/ |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|___/
_ __ _ _ _ _
| |__ / /_ | | | | ___ __ _ __| (_)_ __ __ _
| '_ \| '_ \ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
| | | | (_) | | _ | __/ (_| | (_| | | | | | (_| |
|_| |_|\___/ |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|___/
>> Horizontal Rules
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
>> Emphasis
`!This is bold text`! `!This is bold text`! `*This is italic text`* `*This
is italic text`* ~~Strikethrough~~
>> Blockquotes
>>>>Blockquotes can also be nested...
>>>>>>>>by using additional greater-than signs right next to each other...
>>>>>>>>>>>>or with spaces between arrows.
>> Lists
>>> Unordered
+ Create a list by starting a line with `=+`=, `=-`=, or `=*`=
- Marker character change forces new list start:
* Ac tristique libero volutpat at
+ Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
+ Very easy
>>> Ordered
1. Lorem ipsum dolor sit amet
2. Consectetur adipiscing elit
3. Integer molestie lorem at massa
>> Code
Inline `=code`=
Indented code
`=
// Some comments
line 1 of code
line 2 of code
line 3 of code
`=
Block code "fences"
`=
Sample text here...
`=
Syntax highlighting
`=
var foo = function (bar) {
return bar++;
};
console.log(foo(5));
`=
>> Links
`[link text`http://dev.nodeca.com]
`[link with title`http://nodeca.github.io/pica/demo/ "title text!"]
>> Images
`[Minion`https://octodex.github.com/images/minion.png]
`[Stormtroopocat`https://octodex.github.com/images/stormtroopocat.jpg "The
Stormtroopocat"]