Custom HTML template

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

Custom HTML template

sonson
Hi,

I want to add a custom navigation bar at the top of my rendered Asciidoctor docs.
I found in the User-Manual that Asciidoctor uses a set of built-in ERB templates to generate HTML 5 pages. But I (as a non ruby-developer) didn't found anywhere a hint how to generate a custom HTML template. I just found docs about creating a custom CSS stylesheet or an Article Template.

Can you give me a hint to get started creating a custom HTML template?
Reply | Threaded
Open this post in threaded view
|

Re: Custom HTML template

rwinch
Take a look at the Asciidoctor Backends Repository. You can create a copy of the existing HTML5 backend and modify it to generate the HTML you want. For example, if you wanted to use HAML, you would likely want to cp the haml/html5 directory to something like haml/html5-custom. You would then edit the document.html.haml file to meet your needs. To render it, you would use something like this:

  asciidoctor -T <base>/asciidoctor-backends/haml/html5-custom <asciidoc file>

Alternatively, you could use an asciidoctor extension. For example, you might create a custom postprocessor that inserts your navigation bar. You can find complete working extensions in the asciidoctor-extensions-lab repository.

HTH,
Rob
Reply | Threaded
Open this post in threaded view
|

Re: Custom HTML template

sonson
Thanks for the links, this is exactly what I was looking for.
Reply | Threaded
Open this post in threaded view
|

Re: Custom HTML template

mojavelinux
Administrator
You can also find an example in the OpenShift Origin repository. That project does something very similar for its website.


On Thu, Jul 31, 2014 at 8:46 AM, sonson [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thanks for the links, this is exactly what I was looking for.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Custom-HTML-template-tp1944p1946.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--