Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I often wonder, if one is going to add such tags anyways, why not directly use LaTeX, ConTeXt, XML, ... for example

\begin{conccurrent}{Hacker News Thread} I'm writing in an HN thread. \end{concurrent}

is not so different from the markdown source. All the benefits you mention are simply from using semantic markup.



I understand the desire to use Markdown - if you’re not using an editor that will dump the “begin/end” for you with a keystroke or two it feels faster.


The problem with TeX is that it's a write-only imperative language. Good luck performing meaningful operations on the data.

XML, for all its human-unfriendliness, is very good for declarative document layout that you can later feed into some random process.


I use ConTeXt, and it is relatively simple to get each environment to whatever you want (plus you can code everything in Lua).


how do you use Context to make graphs or mind maps or flow charts? I have a hard time setting it up


KeenWrite integrates https://kroki.io/. A mind map in Markdown would be:

    ``` diagram-plantuml
    @startmindmap
    ...
    @endmindmap
    ```
See: https://kroki.io/examples.html#mind-map

The SVG output is written to a local file. KeenWrite converts Markdown to XHTML (XML), which references the local file. ConTeXt then typesets the XML, importing the local vector graphics file and formats it according to the setups defined by the theme.

Kroki has other text-based formats for flow charts, Gantt charts, UML diagrams, packet diagrams, network diagrams, etc.

To be concrete, create a file named "example.md":

    Mind Map:

    ``` diagram-plantuml
    @startmindmap
    skinparam monochrome true
    + OS
    ++ Ubuntu
    +++ Linux Mint
    +++ Kubuntu
    +++ Lubuntu
    +++ KDE Neon
    ++ LMDE
    ++ SolydXK
    ++ SteamOS
    ++ Raspbian
    -- Windows 95
    -- Windows 98
    -- Windows NT
    --- Windows 8
    --- Windows 10
    @endmindmap
    ```
Then run:

    ./keenwrite.sh -i example.md --theme-dir=themes/boschet -o output.pdf
That outputs a PDF file with the following vector graphic (on page 3):

https://i.ibb.co/SJzzYRN/output.png


The same way that one would use markdown :-) (you JS libs or TikZ or Metapost packages).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: