asciidoctor / asciidoctor-extensions-lab

A lab for testing and demonstrating Asciidoctor extensions. Please do not use this code in production. If you want to use one of these extensions in your application, create a new project, import the code, and distribute it as a RubyGem. You can then request to make it a top-level project under the Asciidoctor organization.
Other
104 stars 101 forks source link

Create section-numbers-tree-processor extension #90

Closed andrewcarver closed 2 years ago

andrewcarver commented 6 years ago

Allows you to control your DocBook section numbering from within AsciiDoc, with your sectnums and leveloffset attributes (just like they work with the HTML5 backend). Control over styles--at each level--and more. Updated to work with Asciidoctor 1.5.7, including Parts-numbering.

This extension was inspired by the Asciidoctor discussion topic http://discuss.asciidoctor.org/asciidoctor-fopub-tp6285.html

mojavelinux commented 5 years ago

This seems very useful for those who need fine-grained control over section numerals. I wonder, though, whether it would be better putting this in asciidoctor-fopub. What do you think? Does it make sense outside of that context?

andrewcarver commented 5 years ago

Well, the scheme I've adopted here is to add the sec.-numbering before we get to fopub--on the way from AsciiDoc to DocBook XML. (The idea being, to have nice control over such numbering, in not only HTML5 conversion, but also the XML conversion--rather than trying to handle all that by tweaking your XSL/fopub parameters or whatnot.) So I confess, I don't see how it could work as a direct inclusion in fopub... which presupposes the DocBook XML as its input. Have I missed some premise of the question?

andrewcarver commented 5 years ago

Also, consigning it to FOPUB (assuming that is possible) seems to suppose that nobody using the Asciidoctor-thru-DocBook toolchain would ever want to do it apart from fopub. Which may be true, but seems to me a hefty assumption...

mojavelinux commented 9 months ago

This extension is entirely too complex for this lab. You are welcome to publish it out of your own repository if you would like to share it with others.