SDF Plan 9 Bootcamp -- Day 5
Acme and my hacky markup language
Finally, I can use Acme and stop writing this stuff with ED. To celebrate, I wrote a small script to translate this text files to HTML. The files are written in an extremelly simple markup language, which I've called MP.
MP understands 5 top level commands, that define the structure of the document and some metadata.
`.t`
, sets the title of the document, and dumps . it immediatelly as an H1 tag.`.s`
, sets the title of the current subsection, . and dumps it immediatelly as an H2 tag.`.@`
, sets the author email address. *Not* dumped . immediatelly. See the`-- HUP`
command later.`.d`
, sets the date in /YYYY-mm-dd/ format. *Not* . dumped immediatelly. See the`-- HUP`
command.`-- HUP`
, marks the end of the hand written part of . the document. It will dump the author and date, . and will generate the references section.
The rest of the document is formed of paragraphs. A paragraph is any sequence of non empty lines.
Paragraphs are delimited by one or more empty lines. Note that a line with blanks is *not* considered an empty line.
Inside paragraphs, 3 different markup elements are available:
/emphasis/, using the slash; e.g / emphasis/
*strong emphasis*, using a star; e.g. * strong*
references, a number in square brackets.
These three things are implemented in the dumbest possible way, so they have a couple of limitations:
For emphasis and strong emphasis, both markers must *not* be separated from the text they surround by any blanks. If there's any blank after the start marker or before the end marker, the marker will be interpreted as a literal * or / . In other words, you can escape the * or / simply by surrounding them with spaces.
You cannot have more than 1 markup element of the same type per line. You can split them in multiple lines, it will have no effect in the HTML output.
You can use these files as examples (download them simply replacing the .html extension by .mp in the URL); if you're curious, take a look at the source 1.
sshfs
Tried to mount SDF with sshfs with 0 success. It seems I need to configure something somewhere. Added various manpages to the reading queue.
On the positive side, mounting SDF with ftpfs is pretty simple. Now I can save my stuff in SDF and no longer worry about losing anything I have in the Plan9 VPS.
Books
Yesterday, I ordered all 9front manpages in physical format. In theory, they'll be here this Sunday.
Bye!
Not much else to say. I'll probably read more of the Plan9 papers/manpages or something along those lines. No more hacking for me today.
References
- [1] mp.tar.bz2