Search code examples
asciidoctor

How to render asciidoc filename in asciidoctor template?


I have a asciidoctor template similar to this one:

https://github.com/asciidoctor/asciidoctor-backends/blob/asciidoctor-v0.1.4/erb/html5/document.html.erb

I would like to include a link into my documents which points to the asciidoc file that was used to generate the document.

Is there a way to access the asciidoc filename within my template?

I'm using the asciidoctor-maven-plugin to render my documents.


Solution

  • By looking at the built-in data attributes, I think that you are looking for {docfile} (evaluation depends from how the document is processed and when and where is it processed).

    For me it works with the asciidoctor-maven-plugin (I get the absolute path to the file) but not in the chrome preview.