summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-05-02 18:34:26 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-05-02 18:34:26 -0600
commit362a06874fc032e5e2c2778239a6f9c42b309ef3 (patch)
treee3d40c5b4e70b60f8723b299ad866c64d7f926f3
parent849357b48adafd9b6f4e9ed91cdfc4f286f62359 (diff)
add note about using theme keys in an extended converter [no ci]
-rw-r--r--docs/modules/extend/examples/pdf-converter-custom-chapter-title.rb2
-rw-r--r--docs/modules/extend/examples/pdf-converter-image-indent.rb2
-rw-r--r--docs/modules/extend/pages/use-cases.adoc4
3 files changed, 6 insertions, 2 deletions
diff --git a/docs/modules/extend/examples/pdf-converter-custom-chapter-title.rb b/docs/modules/extend/examples/pdf-converter-custom-chapter-title.rb
index 434a7bc9..57f5e248 100644
--- a/docs/modules/extend/examples/pdf-converter-custom-chapter-title.rb
+++ b/docs/modules/extend/examples/pdf-converter-custom-chapter-title.rb
@@ -5,7 +5,7 @@ class PDFConverterCustomChapterTitle < (Asciidoctor::Converter.for 'pdf')
move_down cursor * 0.25
ink_heading title, (opts.merge align: :center, text_transform: :uppercase)
stroke_horizontal_rule 'DDDDDD', line_width: 2
- move_down @theme.block_margin_bottom
+ move_down theme.block_margin_bottom
theme_font :base do
layout_prose 'Custom text here, maybe a chapter preamble.'
end
diff --git a/docs/modules/extend/examples/pdf-converter-image-indent.rb b/docs/modules/extend/examples/pdf-converter-image-indent.rb
index d71aa7a0..e6d5debc 100644
--- a/docs/modules/extend/examples/pdf-converter-image-indent.rb
+++ b/docs/modules/extend/examples/pdf-converter-image-indent.rb
@@ -2,7 +2,7 @@ class PDFConverterImageIndent < (Asciidoctor::Converter.for 'pdf')
register_for 'pdf'
def convert_image node
- if (image_indent = @theme.image_indent)
+ if (image_indent = theme.image_indent)
indent(*Array(image_indent)) { super }
else
super
diff --git a/docs/modules/extend/pages/use-cases.adoc b/docs/modules/extend/pages/use-cases.adoc
index 90af4bff..2c18941f 100644
--- a/docs/modules/extend/pages/use-cases.adoc
+++ b/docs/modules/extend/pages/use-cases.adoc
@@ -6,6 +6,10 @@ In xref:create-converter.adoc[], we were just biting around the edges of what yo
This page gets into more realistic use cases.
Each section introduces a different use case and presents the code for an extended converter you can use as a starting point.
+TIP: The extended converter can access predefined or custom theme keys via the `theme` accessor.
+The segments in a key are always separated by an underscore character (e.g., `theme.title_page_font_color`).
+Consulting the value of theme keys allows the extra behavior provided by the extended converter to be styled using the theme.
+
== Custom thematic break
One of the simplest ways to extend the converter is to make a thematic break.