asciidoc-py / asciidoc-py2

Deprecated python2 implementation of AsciiDoc.py. See asciidoc-py/asciidoc-py for current work.
https://asciidoc.org/
GNU General Public License v2.0
466 stars 128 forks source link

toc levels don't display after level 6(:toclevels: property doesn't work) #131

Closed repomorphic closed 6 years ago

repomorphic commented 6 years ago

Hello everyone. I am trying to create Toc that have more depth than 6. I tried following :

= Toc 
:idprefix:
:idseparator: -
:sectanchors:
:sectlinks:
:sectnumlevels: 10
:sectnums: 
:toc: macro
:toclevels: 10
:toc-title:

toc::[] 

== a

=== a

==== a

===== a

====== a

"======= a" didn't work even if I set up :toclevels: properly. The sample asciidoc file : https://gist.github.com/lostdinar2/289c29e93730af3a6f798b23b89d8c42

mojavelinux commented 6 years ago

That's because you've exceeded that maximum heading depth in AsciiDoc.

elextr commented 6 years ago

See http://asciidoc.org/userguide.html#X88 last entry.

repomorphic commented 6 years ago

Thanks elextr, I have cloned asciidoc on my windows and tried this(I am trying to adjust toc levels for ssample.adocfile): python asciidoc.py -a toc -a toclevels=10 doc/ssample.adoc`

But I got following:

File "asciidoc.py", line 101 except KeyError, k: raise AttributeError, k

How to fix that?

elextr commented 6 years ago

@lostdinar2 as @mojavelinux and the link I posted said, Asciidoc levels do not go above 1..4.

mojavelinux commented 6 years ago

Asciidoctor allows them to go to 5 (which is 6 equal signs).

However, the error seems to be unrelated. Perhaps you are using Python 3?

repomorphic commented 6 years ago

Yes. I am using Python 3. Is there any way to increase heading depth? Why doesn't asciidoc allow to go to unlimited headings? 6 is a very small number for big documentations.

elextr commented 6 years ago

Asciidoc generates HTML or docbook, and those have only 6 levels and 4/5 levels respectively, so no there isn't a way of making more levels because there is no way of translating them to the output formats.