Rendering an outline

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Rendering an outline

Chuck
I hope this is the right place to ask this question. If not, please gently correct me.

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.·

I am running this on Fedora 18 using RPM packages for asciidoc and 'gem install asciidoctor'. The commands I'm using to output the html file is simply 'asciidoc file.name' or 'asciidoctor file.name'. The file contains content similar to the following:

1. What is the problem?
2. Asciidoc shows this line as a number
A. Asciidoc shows this line as a letter
B. Asciidoc shows this line as a letter
C. Asciidoc shows this line as a letter
3. Asciidoctor shows this line as a number
A. Asciidoctor shows this line as a number
B. Asciidoctor shows this line as a number
C. Asciidoctor shows this line as a number
Reply | Threaded
Open this post in threaded view
|

Re: Rendering an outline

mojavelinux
Administrator
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​

Reply | Threaded
Open this post in threaded view
|

Re: Rendering an outline

Chuck
Thanks for the explanation and inclusion of a better default in Asciidoctor. Version 0.1.3 does work out of the box as I would expect it to with outlines in the little bit of testing I did with it.

Chuck
Reply | Threaded
Open this post in threaded view
|

Re: Rendering an outline

mojavelinux
Administrator
Glad to hear it!

If you have other questions or feedback, they are very welcome here.

Cheers!

-Dan


On Sun, Jun 2, 2013 at 9:31 AM, Chuck [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thanks for the explanation and inclusion of a better default in Asciidoctor. Version 0.1.3 does work out of the box as I would expect it to with outlines in the little bit of testing I did with it.

Chuck


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Rendering-an-outline-tp241p264.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--