n0x1m / md2gmi

Converts Markdown to Gemini gemtext with Go. Working with streams and UNIX pipes, utilizing Go channels. Processes streams of input line by line and forwards blocks to the next pipeline stage.
ISC License
14 stars 3 forks source link

Sub-lists should translate into something #2

Open cognivore opened 2 years ago

cognivore commented 2 years ago

Just like with other entities in Markdown that don't have a counterpart in Gemtext, we need to come up with some translation ourselves.

What I normally do by hand is when I find a non-flat list is I translate each depth level into a level of outline. It is not a generic solution and actually I don't think it should be implemented like this.

I think an acceptable translation would be to insert line breaks and pad each depth level with a number, this way

1. Introductory questions about overall background.
    1. Music, computers and work at REDACTED.
    2. Working with humans in non-tech
        1. at work with REDACTED.
        2. in an activist / advocacy group with REDACTED.
    3. How it helped to make a jump to become a tech lead.

would become

1. Introductory questions about overall background.
1.1. Music, computers and work at REDACTED.
1.2. Working with humans in non-tech
1.2.1. at work with REDACTED.
1.2.2. in an activist / advocacy group with REDACTED.
1.3. How it helped to make a jump to become a tech lead.

It doesn't look half-bad in Lagrange either:

The same list rendered in Lagrange

n0x1m commented 2 years ago

good call, what are the rules with new lines? Would be great to have a few input/output samples handy so we can play with the tests.