Closed danyill closed 2 years ago
I do think this is interesting. My worry is that the line information in Asciidoctor is not always perfectly accurate and this could lead to confusion if people start relying on it. On the other hand, it's what most IDE plugins are doing right now anyway. Some I'm a bit torn on this one.
There is a way to override the converter without introducing a template. If that change were made, I might be more inclined to accept it. See https://docs.asciidoctor.org/asciidoctor/latest/convert/custom/#extend-and-replace-a-registered-converter
I wanted to provide an example of how to extract line number information using role (the "easy" way) and also how to undertake a more semantically correct way of extracting the file and line number and adding to html attributes.
Mainly because I'd synchronisation and includes to work beautifully in editor extensions (e.g. see https://github.com/joaompinto/asciidoctor-vscode/issues/59)
I guess the use of a template might be outside the scope of the extensions lab.
I don't think there's an easier way to do this than to override the html converter (It would be neat if we could say "add the line number as an attribute to each div element" but I think Asciidoctor doesn't offer this kind of abstraction/interface at the moment). I'd be very happy to be corrected :smile_cat: