Login  Register

Re: Rendering an outline

Posted by mojavelinux on May 31, 2013; 2:00am
URL: https://discuss.asciidoctor.org/Rendering-an-outline-tp241p253.html

Chuck,

On Sun, May 26, 2013 at 9:57 PM, Chuck [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I hope this is the right place to ask this question. If not, please gently correct me.
 
Welcome to the list! We're glad to hear from you.
 

I'm experimenting with using Asciidoc vs Asciidoctor for rendering docs. I noticed this discrepancy and was wondering if someone can provide a reason for this or if it is, as I suspect, a bug.

When I run this file through asciidoc 8.6.8 the following outline comes out as I would expect. The numbers come out as numbers and the letters come out as sub items using the letters. However, if I run it through asciidoctor 0.1.2 the numbers come out as numbers and the letter options come out as numbers as well.·

The reason you are seeing a discrepancy between AsciiDoc and Asciidoctor is likely because the output produced by AsciiDoc has a stylesheet associated with it and the output from Asciidoctor does not. If you add the default Asciidoctor stylesheet, you'll see that numbering is consistent.

You can add the default Asciidoctor stylesheet in one of two ways:

. Copy it to the output directory

 $ asciidoctor -a copycss example.asciidoc

. Embed it into the document

 $ asciidoctor -a linkcss! example.asciidoc

​ Your question got me thinking about whether there is a way to make the numbering type not depend on the stylesheet. It turns out, there is! It's possible to add a numbering type hint in the HTML using the type attribute on the <ol> element. For example:

 <ol type="a">
   <li><p>This item get labeled with a lowercase "a"</p></li>
 </ol>​

​ I went ahead and added these numbering type hints to the HTML output in Asciidoctor 0.1.3. Now, the numbering type will be right whether you have a stylesheet or not.

Thanks for your feedback. Your input helped make the Asciidoctor 0.1.3 release even better.

Cheers,

-Dan​