Hi Arnaud

I successfully compiled all the docs in svn://svn.debian.org/nut/branches/AsciiDoc using the current AsciiDoc trunk, and yes, the chunked manual only has a single toc. But there was the added problem of the article sections not being chunked by default, the chunk.section.depth parameter was set to 0 by default (for chapter level chunking in books), this has been fixed in the trunk:

http://code.google.com/p/asciidoc/source/detail?r=fe13fddfacafe60cc07674aff77a12850dfbde6b

The real problem is the inability to specify section level TOCS. Due to some myopic thinking on my part, the TOC control is effectively hardwired in ./docbook-xsl/common.xsl. I've fixed this so that the TOCs can now be controlled via the various DocBook XSL Stylesheets TOC parameters (see http://www.sagehill.net/docbookxsl/TOCcontrol.html) generate.section.toc.level, toc.section.depth and toc.max.depth:

http://code.google.com/p/asciidoc/source/detail?r=a40a136d131225d042536c781082181f06024c33

I can now generate a TOC in each section of the user-manual by setting the generate.section.toc.level to 1 e.g.

a2x -v --attribute icons --attribute localdate=`TZ=UTC date +%Y-%m-%d` --attribute localtime=`TZ=UTC date +%H:%M:%S` --attribute iconsdir=./icons --attribute=badges --attribute=external_title -a toc -a numbered --destination-dir=. --format=chunked --xsltproc-opts "--stringparam generate.section.toc.level 1" user-manual.txt

Use the toc.section.depth to increase the depth e.g.

a2x -v --attribute icons --attribute localdate=`TZ=UTC date +%Y-%m-%d` --attribute localtime=`TZ=UTC date +%H:%M:%S` --attribute iconsdir=./icons --attribute=badges --attribute=external_title -a toc -a numbered --destination-dir=. --format=chunked --xsltproc-opts "--stringparam generate.section.toc.level 1 --stringparam toc.section.depth 3" user-manual.txt

I also tried generating the user-manual using the 'book' doctype, this picked up an (unrelated) problem -- I got the following error:

a2x: finding resources in: /home/srackham/tmp/AsciiDoc/docs/user-manual.chunked/ch03.html
Traceback (most recent call last):
  File "/home/srackham/bin/a2x", line 814, in <module>
    a2x.execute()
  File "/home/srackham/bin/a2x", line 343, in execute
    self.__getattribute__('to_'+self.format)()
  File "/home/srackham/bin/a2x", line 625, in to_chunked
    self.copy_resources(html_files, src_dir, dst_dir)
  File "/home/srackham/bin/a2x", line 509, in copy_resources
    lambda attrs: attrs.get('type') == 'text/css')
  File "/home/srackham/bin/a2x", line 240, in find_resources
    parser.feed(open(f).read())
  File "/usr/lib/python2.6/HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "/usr/lib/python2.6/HTMLParser.py", line 148, in goahead
    k = self.parse_starttag(i)
  File "/usr/lib/python2.6/HTMLParser.py", line 249, in parse_starttag
    attrvalue = self.unescape(attrvalue)
  File "/usr/lib/python2.6/HTMLParser.py", line 387, in unescape
    return re.sub(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));", replaceEntities, s)
  File "/usr/lib/python2.6/re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 6: ordinal not in range(128)

This error is due to a limitation in the Python HTMLParser module, see:
http://bugs.python.org/issue3932

I resolved it by assuming UTF-8 input (this assumption is not always going be correct but it will be correct more often that not doing anything and assuming an ascii encoding:
http://code.google.com/p/asciidoc/source/detail?r=c9656a70e1303022b041646ef99bef205e6e7f9e

So, to to get section level TOCs you need to run from the trunk and pass TOC XSL Stylesheets parameters to a2x using the --xsltproc-opts option.

Could you please test and report back.


Cheers, Stuart


On 14/10/10 02:05, Arnaud Quette wrote:
Hey all,

just forwarding Charles' test results, as mentioned earlier today...
a detail I forgot in my previous is that the system used on my side is
an ubuntu 10.04, so matching preriquisites mentioned in AsciiDoc README
file...

2010/10/13 Charles Lepple

    On Sun, Oct 10, 2010 at 8:10 AM, Arnaud Quette wrote:
     > I'm in the final completion process of NUT docs, but got some
    issues with
     > the chunked output and a2x: per chapter split behavior is not
    applied.
     > Instead, I've the toc and all chapters but appendixes in one
    page, then each
     > appendix in a separate page.

    OK, I finally got to test this with asciidoc 8.6.1, and I see the same
    thing - one page per appendix, and the rest in index.html.

    $ dblatex --version
    dblatex version 0.2.12

    using docbook-dtd-4.5.0


cheers,
Arnaud

--
You received this message because you are subscribed to the Google
Groups "asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.

--
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/asciidoc?hl=en.

Reply via email to