# The dawn of glorp :blurb Smol markup language for blog. I think Einar said that if you want to blog you should write blog posts, not write blog engine. At least sometimes people say something like that. => url https://einarwh.wordpress.com/ Einar uses WordPress. => url https://einarwh.wordpress.com/2011/05/12/the-indispensable-idisposable/ So when Einar writes about weird DSL for writing HTML it is typically _not_ a description of how his blog works. Anyway it’s a thing that makes sense. So here’s a new home-made markup language for my home-made blog engine. I’ve played around with making my own language for this a few times. I like the idea of having something where it’s so easy to implement tooling for it that, if I ever need or want to reimplement it, maybe in a different language/environment, then that won’t be a big deal. Preferably not even much of a factor in deciding if I’m going to move to a different language or something. And also simple enough so that I can write (and read) posts in that format correctly without much help from specialized tools or something. I tend to mess up and things tend to get too complicated. ## Gemtext => url https://gemini.circumlunar.space/docs/gemtext.gmi Gemtext I ran into Gemtext the other day. Gemtext takes a pretty straightforward approach to some things. > You get one kind of list and you can't nest them Which goes for most things. Like generally you can’t have within . No quote within a list, or link within a heading, or whatever. Or, it’s very line-oriented, and you can’t like, nest lines. It’s not too hard to build a Gemtext-parser. It’s also really easy to write Gemtext in any text editor. Also it tends to look kind of like my plaintext-notes would look anyway. E.g. I tend to end up with stuff like paragraphs being long lines and use separate lines for links. (Also also I like how using a full line for a link tricks me into writing more self-contained link texts (instead of stuff like the link text being “here”). Which I’m told people using screen readers sometimes appreciate.) ## Glorpdown So I decided to steal ideas from Gemtext and make something with a lot less functionality than what I have attempted previously: => url /glorpdown.html A Glorpdown editor. => url /gd/notes/glorpdown.txt This post in Glorpdown. Some basics: * A line usually goes like . The line type (typically determined by the of the line) decides how many (whitespace-separated) arguments there are. E.g. a link (starts with `=>`) has two arguments, link type and path. A blockquote has no arguments, just a `>`-start followed by the text that goes in the quote. * Within the you can format text: Text between `_`-characters is _emphasized_. Text between `\``-characters is `code`. You can’t nest/combine those things. * Within the you can escape a character with a `\\`-character. Necessary for escaping formatting characters or for having regular text lines start with the of another line type. Most of the things: ### Regular text/paragraphs More or less like in Gemtext. The of a regular text line is the empty string. Or: If the start of a line does not match the of any of the other line types, it is a regular text. Should be empty lines between paragraphs. Line breaks within paragraphs are preserved when translating to HTML and such. ### Headings Same as in Gemtext, three levels: Lines that start with `#`, `##` or `###`. E.g. I do this for the following heading: ``` ### Blockquotes ``` ### Blockquotes Same as in Gemtext: Lines that start with `>` ``` > Hello. ``` > Hello. ### Lists Same as in Gemtext: Lines that start with `*` are list items. ``` * Item one * Item two ``` * Item one * Item two ### Linky bits Regular links are similar to the ones in Gemtext, but with a “type” argument before the path/url: ``` => url https://placekitten.com/ Kittens ``` => url https://placekitten.com/ Kittens Unlike in Gemtext there’s a different line type for stuff that should be included in, or viewed in context of, the document. Typically images: ``` <= img https://placekitten.com/200/300 A kitten! ``` <= img https://placekitten.com/200/300 A kitten! (In my mind the way this makes sense is that the `=>`-arrow points to some thing that you can go to, while the `<=`-arrow is more like, the thing is moving into the current document.) ### Preformatted text Same as in Gemtext, preformatted text is turned on by a line that starts with `\`\`\``. Not like in Gemtext, any non-whitespace characters directly after the `\`\`\`` are considered part of the and must be matched by the start of a later line to turn it off again (so you can e.g. do four backticks for the if you want to have a line of preformatted text start with three backticks without that being a “turn off the preformatted text”-line). No line types or text formatting or escaping characters within preformatted text. So: ````` ```` code here ``` not turned off yet so things are still code ```` ````` Becomes: ```` code here ``` not turned off yet so things are still code ```` In Gemtext you can write some stuff after the of a line that turns preformatted text _on_ and have that be “alt text.” In Glorpdown this text is instead potentially used when rendering. E.g. for marking some preformatted text as a “repl,” so that later code can turn it into a editable textare or something. If there’s text after the of a line that turns preformatted text _off_, then that’s used as a caption for the preformatted text. ### Lines A section of preformatted text where the text after the if the line that turns it on goes like `lines `. => gd lines More lines-stuff, including an editor. ```` ``` lines 40 36 t 33 5 oh no l 20 14 19 8 11 8 10 14 3 18 4 21 10 20 9 31 12 31 15 24 17 30 21 31 19 20 25 21 25 17 20 14 l 13 10 13 11 l 17 10 17 11 l 14 14 16 14 l 23 11 29 8 ``` ```` ``` lines 40 36 t 33 5 oh no l 20 14 19 8 11 8 10 14 3 18 4 21 10 20 9 31 12 31 15 24 17 30 21 31 19 20 25 21 25 17 20 14 l 13 10 13 11 l 17 10 17 11 l 14 14 16 14 l 23 11 29 8 ``` ### Details Not in gemtext. This it “toggled,” kind of like with the preformatted text. Lines that start with `+++`. The text after the first `+++` becomes the summary. The content between a first and second `+++`-line is details (the stuff you see if you click to expand or something). ``` +++ Things * One thing * Another thing * A third thing +++ ``` +++ Things * One thing * Another thing * A third thing +++ ### Key-value pairs Not at all in Gemtext. Mostly for metadata. Lines that start with `:` are key-value lines. If a line goes `: ` then is the key and is the value. E.g. this post has a line that goes: ``` :date 2022-12-06 ``` :date 2022-12-06 And then I have some blogging machinery that uses that date for displaying list of posts with their dates. ### Horizontal rule/thematic change Not in Gemtext. Lines that start with `----` ``` ---- ``` ---- Blah blah. That’s mostly it.