summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCharlotte Koch <dressupgeekout@gmail.com>2023-02-16 16:44:34 -0800
committerCharlotte Koch <dressupgeekout@gmail.com>2023-02-16 16:44:34 -0800
commit758952605ea8cb1b7cf926076f591007d8d98b7e (patch)
tree2ac581d31045011899a312efeb849f3540b3187a /lib
First commit
Diffstat (limited to 'lib')
-rw-r--r--lib/willora_pdf_converter.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/willora_pdf_converter.rb b/lib/willora_pdf_converter.rb
new file mode 100644
index 0000000..8fb9d4a
--- /dev/null
+++ b/lib/willora_pdf_converter.rb
@@ -0,0 +1,19 @@
+#
+# WilloraPDF
+# Charlotte Koch <dressupgeekout@gmail.com>
+#
+
+# With guidance from:
+# - https://docs.asciidoctor.org/pdf-converter/latest/extend/create-converter/
+# - https://docs.asciidoctor.org/pdf-converter/latest/extend/use-cases/#custom-thematic-break
+class WilloraPDFConverter < Asciidoctor::Converter.for('pdf')
+ register_for 'pdf'
+
+ # My custom thematic break, which is just a blank space the size of the main
+ # font. (The default thematic break draws a horizontal rule.)
+ def convert_thematic_break(node)
+ theme_margin(:thematic_break, :top)
+ move_down(theme.base_font_size)
+ theme_margin(:thematic_break, ((block_next = next_enclosed_block node) ? :bottom : :top), block_next || true)
+ end
+end