Customizing HTML footer

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

Customizing HTML footer

costin
Hi,

Is there a way to change the footer from the default "Last updated XXXX" to something else (like copyright and licence for example) ?  I see the asciidoctor.org site has a custom footer but I'm not sure whether it's something addressed by asciidoctor or by the site template.

Thanks,

P.S. I'm using the book 'doctype' and asciidoctor 0.1.3 through gradle.
Reply | Threaded
Open this post in threaded view
|

Re: Customizing HTML footer

rwinch
I'm also wanting to do something similar with the gradle plugin. Issue 486 seems to indicate that asciidoctor won't support customizing the footer until 0.1.4 [1]. For that reason, I'm guessing you will need to customize the template until the next release. It may be possible for this to work with asciidocotor v0.1.4.preview.3, but I haven't had time to verify this (or determine exactly how to do it).

[1] https://github.com/asciidoctor/asciidoctor/issues/486

Cheers,
Rob Winch
Reply | Threaded
Open this post in threaded view
|

Re: Customizing HTML footer

mojavelinux
Administrator
Costin and Rob,

As is always the case, you can solve pretty much any rendering need in Asciidoctor by supplying your own template. In this case, you might grab one of the document templates from the asciidoctor-backends repository (be sure to use the 0.1.3 branch) [1] (e.g., document.html.slim, document.html.haml, document.html.erb).

Let's assume you are using document.html.slim. You hack it up as needed, put it into the directory asciidoctor-templates/slim/html5 somewhere in the project and tell Asciidoctor to find it by passing template_dir = "asciidoctor-templates/slim" to the Asciidoctor task. It will discover the document template and use it in place of the built-in one.

(Overriding the document template will be simplified once partials are introduced; see https://github.com/asciidoctor/asciidoctor/issues/573)


Modifying the footer content is common enough that we decided to provide simpler mechanisms for customizing it in Asciidoctor 0.1.4. To disable the "Last Updated" text outright, you pass a negated attribute:

last-update-label!

You could also trick the label into displaying additional text before it emits the modified time by setting it as follows:

last-update-label="**Whatever you want here** Last Updated:"

Another approach to custom text is to include a docinfo-footer file, also introduced in 0.1.4. It works exactly the same as the docinfo files in AsciiDoc, except you name it with the -footer.{ext} suffix (e.g., docinfo-footer.html). The contents of that file go into the footer div at the bottom of the page.

Fortunately, you don't have to wait long for 0.1.4. We are working to get it out this week!

Btw, the header and footer on the asciidoctor.org pages comes from the site generation tool, Awestruct. Asciidoctor is only rendering the body content using embedded rendering mode.

-Dan

[1] https://github.com/asciidoctor/asciidoctor-backends/blob/asciidoctor-v0.1.3/slim/html5/document.html.slim



On Mon, Aug 19, 2013 at 11:40 AM, rwinch [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I'm also wanting to do something similar with the gradle plugin. Issue 486 seems to indicate that asciidoctor won't support customizing the footer until 0.1.4 [1]. For that reason, I'm guessing you will need to customize the template until the next release. It may be possible for this to work with asciidocotor v0.1.4.preview.3, but I haven't had time to verify this (or determine exactly how to do it).

[1] https://github.com/asciidoctor/asciidoctor/issues/486

Cheers,
Rob Winch


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



--
Reply | Threaded
Open this post in threaded view
|

Re: Customizing HTML footer

mojavelinux
Administrator
In reply to this post by costin
Btw, the reason the footer is the way it is today is so that Asciidoctor can demonstrate compliance with AsciiDoc output. A central goal of Asciidoctor, however, has been to make it easy to get exactly the output you want. As we put together a user manual, we'll be sure to emphasize this tremendous flexibility in Asciidoctor and how to make use of it.

-Dan


On Sun, Aug 18, 2013 at 6:13 AM, costin [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi,

Is there a way to change the footer from the default "Last updated XXXX" to something else (like copyright and licence for example) ?  I see the asciidoctor.org site has a custom footer but I'm not sure whether it's something addressed by asciidoctor or by the site template.

Thanks,

P.S. I'm using the book 'doctype' and asciidoctor 0.1.3 through gradle.


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



--