Hacker News new | past | comments | ask | show | jobs | submit login
Writing a Multilingual Book in Markdown (dampfkraft.com)
32 points by polm23 3 days ago | hide | past | favorite | 9 comments





I also write mixed language notes in markdown and arrived at a different solution. It’s a little heavier (it uses curly braces as delimiters), but the payoff is that you can mix content. For example, a paragraph can have more than one language, which appears to not be possible with sigils.

https://qubyte.codes/blog/marqdown#languages


There can be so many applications of this that use `:xxx` for more in-depth explanations, comments, multi-code versions of textbooks, etc. I really hate when trying to debug Python dependency issues when 90% of the solution imagine that I use Conda. This could really help generate help with far less clutter.

It could help for a project I had for a while to have a “bilingual” textbook. I remember studying economics and finding the formalism interesting, but way too strict, ridiculously so. Thankfully, one of our professors was “bilingual”: she wrote the usual equations on the board, but read them explicitly as what they were meant to convey, which is far less strict. It wasn’t “prices grown linearly” because the production function happened to be linear like the board read, it was “prices have a tendency to go up”. Suddenly, the gap between the actually needed assumption (very loose) and the example became more clear.

I think not enough people teach technical topics with that distinction between:

* the textbook listing a theorem with the strictest possible assumptions that says that, with enough time, this should converge;

* in practice, the fact that many cases far from that assumption behave the way you’d like for the theorem to make sense.

Having an option to write an accessible version with simple math, and a more nuanced version that can be re-read later is really fantastic.


I feel like this is reimplementing something that should already be possible with pandoc markdown somehow.

Though I haven't tried implementing my own pandoc filters yet so I can't comment on how useful/annoying it is to make your own.


Why not prepend the paragraphs with the tag, I feel like it would be easier on the human and the parser

That's what I did in 2001 in my QMath markup language [1] as shown in this screenshot: https://matracas.org/qmath/screenshot_2.png

[1] https://matracas.org/qmath/

Lines that start with a colon are metadata, for instance :for:[symbols_simple] indicates that the Example is for a mathematical theory called symbols_simple elsewhere in the document.

There are shortcuts for certain types of metadata, for instance double quotes following the colon :"The Title" for titles, ISO 639-1 language tags for the language, and then if the text after the colon is not a single token and has no colons it marks an author.

It produced XML with the language put in xml:lang attributes, that was later processed into HTML and LaTeX for each language, and from that into DVI, PS, PDF.

I chose to have the tags at the start for the reasons you mention. When having several of them together as in the example they form a visual block that I find easier to scan.

The idea of using colon to mark these came from AsciiDoc: https://docs.asciidoctor.org/asciidoc/latest/attributes/attr...


from the article:

> I call the tokens like :en or :ja "sigils"; their position on the line doesn't matter, just their presence.


Thanks!

Neat

I eagerly await the HN commenter insisting the project would have gone better in Org markup. ;)



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

Search: