Skip to content

Commit

Permalink
shorten section title and example filename for extended PDF converter…
Browse files Browse the repository at this point in the history
… that shows document details below article title
  • Loading branch information
mojavelinux committed Oct 14, 2023
1 parent 005b9ca commit c4a8c28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/modules/extend/pages/use-cases.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ Finally, the method `convert` will convert and render the Asciidoctor node that
== Custom article title with document details

Documents rendered as articles (i.e., `doctype=article`) by Asciidoctor PDF don't have a title page by default.
Instead the document title is shown on the first content page above the main content.
Instead the document title of the article, the article title, is shown on the first content page above the main content.

The document details, which includes the author, date, and revision information (revnumber and revremark), are not shown in this mode.
To insert them below the document title (similar to what the built-in HTML converter does), we can use an extended converter.
To do so, we hook into the method `ink_general_heading`, which renders the document title.
To do so, we hook into the method `ink_general_heading`, which renders the document title of an article.
Since this method is also responsible for rendering other headings (e.g. section titles), we allow it fall back to the default implementation unless it is processing the document title of an article.

.Extended converter that renders the document details below the document title of an article
.Extended converter that renders the document details below the article title
[,ruby]
----
include::example$pdf-converter-article-title-with-author-and-date.rb[]
include::example$pdf-converter-article-title-with-details.rb[]
----
<.> Fall back to default implementation unless handling the document title.
<.> Render the document title.
Expand Down

0 comments on commit c4a8c28

Please sign in to comment.