I guess I shoud take a look at asciidoctor. The *indent=0 *could have been a solution. The second solution also works with Python asciidoc but since I have to convert miscellanous formats it would then had collide with lines of dots…
Anyway I used the "zero width space" solution, source-highlight is ok with it. It increases my script execution time because I need to iterate through each line of the files I need to convert, before feeding it to asciidoc, but that's ok. The asciidoc to HTML conversion still is the main consuming part. Le vendredi 23 septembre 2016 09:59:58 UTC+2, Dan Allen a écrit : > > Also keep in mind that if you take the indent approach, Asciidoctor lets > you remove leading blank columns. > > [source,shell,linenums,indent=0] > ---- > some source > code > --------------- > ^^^ line of dashes, no problem > yeah! > ---- > > Another option with Asciidoctor is to masquerade a literal block as a > source block. > > [source,shell,linenums] > .... > some source > -------- > ^^^ the above line won't close the block > code > yeah! > .... > > Having to worry about collisions like this is one of the minor drawbacks > of using a lightweight markup language. That's why we try to provide > alternate syntax choices. > > Cheers, > > -Dan > > On Thu, Sep 22, 2016 at 8:05 AM, Stéphane Thomas <[email protected] > <javascript:>> wrote: > >> The Asciidoctor implementation therefore requires that the closing and >>> opening delimiters be the same length. >> >> >> Yeah I saw that. That would be nice. I need to convert miscellanous files >> (mostly program source but also plain text documentation, hence my problem) >> but using a very long delimiter would cover most cases if not all. I may be >> wrong but I found at least '----' is a valid line in a Haskell program (a >> comment). >> >>> >>> It would be good if someone made a patch that made that an option on >>> Asciidoc Python as well. >> >> >> >> Sure ! I've searched for such an option ;) I'll try to have a look at the >> source code… >> >> Thx for your answers. I'll test the Unicode hack. The only drawback I see >> is that this invisible character would be copied in case of copy/paste. >> Well, it may not be a problem… >> >> Have a nice day. >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "asciidoc" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at https://groups.google.com/group/asciidoc. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Dan Allen | @mojavelinux | https://twitter.com/mojavelinux > -- You received this message because you are subscribed to the Google Groups "asciidoc" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/asciidoc. For more options, visit https://groups.google.com/d/optout.
