How to generate a Table of Contents that refers to multiple files

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

How to generate a Table of Contents that refers to multiple files

confuseddesi
Hi all,

Let's say I have a series of Asciidoc's that are structured as follows:

/docs (top level folder)
    index.adoc
    api.adoc
    contactus.adoc
    about.adoc

I would like each document to be output as a separate html file, but have a global Table of Contents that links to each html file generated as well as the sections in that document. How could I accomplish this?
Reply | Threaded
Open this post in threaded view
|

Re: How to generate a Table of Contents that refers to multiple files

mojavelinux
Administrator

On Tue, Sep 9, 2014 at 11:27 PM, confuseddesi [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I would like each document to be output as a separate html file, but have a global Table of Contents that links to each html file generated as well as the sections in that document. How could I accomplish this?

At the moment there are two ways to accomplish this:

1. Maintain a table of contents manually using a nested list (not optimal, but requires very little thought)
2. Write a script to iterate over the files and use the Asciidoctor load() API to read the structure of the document and generate the table of contents

What you are likely really after is chunked HTML output. That's on the list to do for Asciidoctor, but we haven't gotten to it yet. The chunked HTML backend will simply encapsulate #2 into a backend (likely called html5-chunked or html5-multipage)