Search code examples
asciidocasciidoctor

ASCIIDOC: adding link to index.html to all documents for quick navigation


I am generating HTML documentation with Gradle org.asciidoctor.convert plugin and I want to add easy accessible link to main index document to each generated page.

From index.adoc I point to individual pages, like:

== Troubleshooting
* <<KNOWN-ISSUES.adoc#,Known issues>>
* <<monitoring.adoc#,Monitoring>>

but I'd like to be able to quickly navigate back to index.html from any page.

My initial idea was to alter generated TOC but I can' figure out how I cad do that.


Solution

  • Hackish workaround for HTML output only:

    asciidoctor {
        attributes \
            'toc-title': '<a href="index.html">↑Go Home↑</a>'
    }
    

    I would be glad to see alternative solution.