A Clojure library designed to transform an “approximate subset” of the
Textile text markup format into something you could feed into Hiccup.
It probably doesn’t do exactly the same as Textile in any strange or
borderline cases, and it deliberately doesn’t do exactly the same as
Textile in the case of newlines, which it leaves intact in the output
instead of transforming them to <br>
(texticlj.core/to-hiccup (slurp "myfile.textile"))
Based on https://github.com/telent/texticl
The input is a lump of text. Processing is as follows:
- separate it into block-level elements
p h bq
Each element is introduced by its name followed by “.” and finished by
a blank line. If the element name is missing, assume p
- find ordered and unordered lists
^#+ ' or '^*+ '
mark the start of a list item; nesting depth is given by the number of
hashes or stars. The item runs until (a) the next item, or (b) the end
of the block.
- within each block, look for character sequences that delimit inline
" *" bold "* " " _" underline "_ "
- footnotes, tables, stuff like that all TBD