diff --git a/DEMO.tlm b/DEMO.tlm new file mode 100644 index 0000000..72f68a5 --- /dev/null +++ b/DEMO.tlm @@ -0,0 +1,80 @@ +! Heading +!! Smolr heading + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam blandit dolor nibh, vitae tempor enim pretium non. Sed in condimentum turpis. Vivamus placerat molestie ullamcorper. Maecenas nec risus nibh. Nullam vel vestibulum sapien. Integer ante erat, aliquam id tellus in, malesuada finibus nunc. Sed porttitor ante orci, eget molestie nibh posuere nec. + +#[Link on the right](http://example.com) >> +#(http://example.com)[Example.com] << +#[Link to nekoweb.org in the middle](https://n0va.nekoweb.org) ^^ +#[https://krzak.org] +#(https://krzak.org) +\^ Links with no alt text + +$[https://krzak.org/krzak-icon.png|img] +$[/staircase.mp3] +$(https://9front.org/movies/no.mp4) + +*italic* +**bold** +***bold italic*** + +--strikethrough-- +~~strikethrough~~ + +$(variable=17) + +The **VARIABLE** is $(variable) + +- List item 1 +. List item 2 + +1. Ordered list item [&1] + +> This is a sample blockquote +> Bon apetit! + +Text under a blockquote [&named] + +**This *is* bold *and* italics *mixed** TOGETHER + +| Random | Stupid | Table | +|---|---|---| +| This << | is >> | a ^^ | +| table | row | with | +| some | ***content*** | in | + +```odin +main :: proc() { + fmt.println("Hello, World!") +} +``` + +--- + +H_2_O_4_U is uranium peroxide +Here is some __underlined__ text + +[Go to Top](#Heading) + +! Escaped star: \* + +[&&1] Ordered list item 2 not included +[&&named] This is the definition for a named footnote + +!! Variable demo + +$(counter=0) +$(link=https://git.krzak.org/N0VA/TypoML) + +`tlm.counter` = $(counter) +\^ This is JS!!! + +#($(link))[Repo link] + +$[script] + let count = 0; + setInterval(() => { + count++; + tlm.counter = count; + }, 1000); +$[/script] diff --git a/README.tlm b/README.tlm index 5bd261d..4551ca2 100644 --- a/README.tlm +++ b/README.tlm @@ -1,80 +1,131 @@ -! Heading -!! Smolr heading +! TypoML -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam blandit dolor nibh, vitae tempor enim pretium non. Sed in condimentum turpis. Vivamus placerat molestie ullamcorper. Maecenas nec risus nibh. Nullam vel vestibulum sapien. Integer ante erat, aliquam id tellus in, malesuada finibus nunc. Sed porttitor ante orci, eget molestie nibh posuere nec. -#[Link on the right](http://example.com) >> -#(http://example.com)[Example.com] << -#[Link to nekoweb.org in the middle](https://n0va.nekoweb.org) ^^ -#[https://krzak.org] -#(https://krzak.org) -\^ Links with no alt text +!! Installation -$[https://krzak.org/krzak-icon.png|img] -$[/staircase.mp3] -$(https://9front.org/movies/no.mp4) +TypoML requires the Odin compiler. Build from source: -*italic* -**bold** -***bold italic*** - ---strikethrough-- -~~strikethrough~~ - -$(variable=17) - -The **VARIABLE** is $(variable) - -- List item 1 -. List item 2 - -1. Ordered list item [&1] - -> This is a sample blockquote -> Bon apetit! - -Text under a blockquote [&named] - -**This *is* bold *and* italics *mixed** TOGETHER* - -| Random | Stupid | Table | -|---|---|---| -| This << | is >> | a ^^ | -| table | row | with | -| some | ***content*** | in | - -```odin -main :: proc() { - fmt.println("Hello, World!") -} +``` +make build ``` ---- +This creates the TypoML executable in the current directory. (wow, how unexpected) -H_2_O_4_U is uranium peroxide -Here is some __underlined__ text +!! Usage -[Go to Top](#Heading) +TypoML reads from stdin and outputs HTML to stdout: -! Escaped star: \* +``` +cat input.tlm | ./TypoML > output.html +``` -[&&1] Ordered list item 2 not included -[&&named] This is the definition for a named footnote +!! Syntax -!! Variable demo +!!! Text Formatting -$(counter=0) -$(link=https://git.krzak.org/N0VA/TypoML) +`*` - *italic* - Italic text +`**` - **bold** - Bold text +`***` - ***bold italic*** - Bold and italic +`--`/`~~` - --strikethrough-- - Strikethrough text +`__` - __underlined__ - Underlined text +`_` - H_2_O_4_U - Subscript +`^` - Δ = b^2^ - 4ac - Superscript -`tlm.counter` = $(counter) -\^ This is JS!!! +!!! Headings -#($(link))[Repo link] +\! Heading 1 +\!! Heading 2 +\!!! Heading 3 +(And so on) -$[script] - let count = 0; - setInterval(() => { - count++; - tlm.counter = count; - }, 1000); -$[/script] +!!! Links + +\#[Link text](url) - Standard link +\#(url)[Link text] - Can go either way +\#[url] - Auto-link (no alt text) +[Link text](\#heading) - Header link (anchor) (can also be done like an auto-link, then the text is auto-generated from the heading) + +!!! Alignment + +Placed at the end of start of a line + +\>> - Right aligned +\<< - Left aligned +\^^ - Center aligned + +!!! Embedded Content + +\$[url] - Auto-detect type +\$(url) - Can also be done like this + +To force a specific type, use \$[url|type] + +Types: + +- `image`, `img`, `i` +- `audio`, `a` +- `video`, `v` +- `iframe`, `frame`, `f` +- `script`, `s`, `javascript`, `js` + +!!! Lists + +- Item 1 +. Item 2 + +Unordered lists use - or . as markers. + +1. First item +2. Second item + +Ordered lists use numbers followed by periods. + +!!! Code Blocks + +```language +code here +``` + +Inline code uses backticks: `code` + +!!! Tables + +| Header 1 | Header 2 | Header 3 | +|---|---|---| +| Cell 1 << | Cell 2 >> | Cell 3 ^^ | + +Do not need a header to work, just the first separator row (`|---|---|---|`) +Can be aligned using the alignment markers + +!!! Blockquotes + +\> This is a blockquote +\> Multiple lines are supported + +!!! Footnotes + +[\&footnote] - Footnote reference +[\&&footnote] - Footnote definition + +Can be numbers or names + +!!! Variables + +\$(name=value) - Define a variable +\$(name) - Use a variable + +!!! Script Blocks + +\$[script] +JavaScript code here +\$[/script] + +!!! Escaping + +Standard escaping using a backslash (`\`) + +!!! Horizontal Rules + +\--\-, \__\_, or \==\= + +Three or more, have to be on their own line