# markup: simple markup for simple posts

i hate most markup languages because of their feature creep. it all started with html. it is the most popular markup language since most web is in that format. i am not sure if it was ever meant for humans to write though. probably not. however it is not so bad if you do so and only use the basic features. but most sites i visit generate their html from other sources of truth so browsing the internet without a html parser is impossible. this is quite sad though. i think its original goal was to mark up plaintext document with "links" and that is why it was called hypertext markup language. and while at it they added some extra markup to separate individual paragraphs and to insert headings, emphasis, simple lists, tables and images. then based on the capabilities and the settings of the client's computer, a browser rendered the document as nice as it could.

but html today is not what it used to be. i do not consider it as a markup language anymore. i consider it as a file format to render resizable "content" in a browser. it is a programming language. as such i am no longer in control how the computer renders the document for me. even worse, some sites go as moronic as to use their own crappy font from the internet rather than the fonts i specifically set. i have preference for specific fonts and i prefer to read in those. or set a maximum width for their document. have these people not considered that there exist people on this planet that are able to read more than 2 words per line? making lines shorter is easy since i can just make the browser window smaller or go into the browser's reader mode. making lines longer is much trickier. oh, i could disable css. but then often the document becomes tangled in the sense that all the content and non-content bits are interspersed in one giant blob of text. website owners really should really consider ensuring that their site still works without css and javascript. basically make sure the site is browsable in the links terminal browser.

on the other hand crappy site usually also means crappy content. so if the site tries to force a specific "viewing experience" then chances are it is trying to compensate for low quality content that i would not really want to read if it were to presented in, say, plaintext format. therefore i rather avoid such websites. visiting fancy websites actually reminds me that i probably should be doing something better instead. so thanks for doing that.

the other markup popular markup language is markdown. it started out simple and with the explicit goal that the plaintext version of the document remains just as readable. it added a little bit too many features in my opinion though. but that would not have been too much of a problem had it stayed that way. but when i look at the newest versions it is utterly nonsensical. for instance i open the commonmark's specification and i am presented gazillions of features and then long discussion about all the corner cases of those misdesigned features. and i suspect it will get much worse over time. when a person starts using all those fancy features it is again a smell that the author is spending way too much time on the presentation which suggest that the underlying content might not be as interesting as they wanted it to be.

really there should be only a handful of features needed. all the markup language for simple documents is supposed to do is to make it resizeable so the readers can read it on various devices with various font sizes. here is the list of features that ought to be enough for everyone:

and this is all what is needed. stop at that and i am happy. those features are quite straightforward to implement and do not have corner cases. in fact this website is written in a markup language that only uses those features. look at my @/htmlized article to see how this site gets transformed into a nice html page in a few lines of awk code. it does not support headings though because i just use different files to organize different sections. the generator creates the headings based on the filenames.

and here is what is not needed in a markup language for simple documents:

if somebody has something interesting to say, they do not need formatting. they can just tell it plainly. if a text is trying to explain a complex concept, fancy formatting will not make it easier. it will just give it an appearance of simplicity but not actually help. i recommend improving the text instead so that it explains the concept more vividly or with more examples.

as for my markup the rules are simple. the document is considered in paragraphs where paragraphs are separated with empty lines. the paragraph's first line determines what sort of paragraph it will be. if it begins with space, i wrap the whole thing into a <pre>. if it begins with a "- ", i treat is as an unordered list and each line starting with "- " starts another element. if none of the above matches, i wrap the paragraph into an ordinary <p> tag. and that is all there is. no corner cases, no complicated implementation needed. if i cannot express something with the above rules then that just means i am not challenging myself enough. i then go and think hard and come up with a way that can fit those rules. the result is then much simpler and i am then usually more pleased with it and thus i am happier. simple, constraining rules lead to better documents.

example in case you are viewing this in the html version:

 test paragraph

 - unordered list
   with multiple lines
 - and entries

 - 1. simulated ordered list
 - 2. entry two

  pre
     formatted
               content

  table example:

   id |   name | age |  weight
   ---+--------+-----+--------
   13 |  james |  37 |   88 kg
   27 | sophia |  42 |   70 kg
   39 |   john |  30 |  123 kg

gets translated to this:

test paragraph

 pre
    formatted
              content

 table example:

  id |   name | age |  weight
  ---+--------+-----+--------
  13 |  james |  37 |   88 kg
  27 | sophia |  42 |   70 kg
  39 |   john |  30 |  123 kg

and that demonstrated all the features i need and support. it is not necessary the nicest but it is functional enough for me.

# edit from 2021 after @/redesign

maybe some special syntax for common links would be nice after all. i still maintain that most links to external sites should be done with raw links simply to reduce surprises. but what about local or very common links? e.g. if you are an online forum, how would you link user posts, user profiles, user communities?

the "@" is such an internet specific symbol and is available. it's a symbol that you don't ordinarily use in text. i think it would be great to use it for links! in my markup i use "@ + /postname" to link to other posts on this site. but a community site could use "@u/alice" to refer to the alice user's profile, "@g/hikers" to refer to a hiking group, "@p/123" to link a specific post, "@yt/dQw4w9WgXcQ" to refer to a youtube video, and so on. as an added usability feature some additional information (e.g. the post or the video's title) could appear whenever the user hovers over such a link. i think this form is pretty short and has few false positives so i'd totally use this on my sites.

published on 2017-12-08, last modified on 2021-09-06


posting a comment requires javascript.

to the frontpage