From 7a2c426add338b6fd3c62271903caa74118c92a2 Mon Sep 17 00:00:00 2001 From: Charlotte Koch Date: Tue, 16 Jul 2024 11:06:24 -0700 Subject: The 'lib' dir for the project is different from that for WilloraPDF itself --- bin/willora | 5 +++-- lib/WilloraPDF_Manuscript_Reference.odt | Bin 30819 -> 0 bytes lib/willora_pdf_converter.rb | 19 ------------------- .../lib/WilloraPDF_Manuscript_Reference.odt | Bin 0 -> 30819 bytes project-files/lib/willora_pdf_converter.rb | 19 +++++++++++++++++++ 5 files changed, 22 insertions(+), 21 deletions(-) delete mode 100644 lib/WilloraPDF_Manuscript_Reference.odt delete mode 100644 lib/willora_pdf_converter.rb create mode 100644 project-files/lib/WilloraPDF_Manuscript_Reference.odt create mode 100644 project-files/lib/willora_pdf_converter.rb diff --git a/bin/willora b/bin/willora index 6dd8c6b..dc272e8 100755 --- a/bin/willora +++ b/bin/willora @@ -41,11 +41,12 @@ class Willora def new_project # Make sure the WilloraPDF base files seem OK. _willorabase = File.join(__dir__, "..") + _projectfiles = File.join(_willorabase, "project-files") _templatedir = File.join(_willorabase, "templates") #epubassetsdir = File.join(_willorabase, "epub-assets") fontsdir = File.join(_willorabase, "fonts") - libdir = File.join(_willorabase, "lib") + libdir = File.join(_projectfiles, "lib") mkdir = File.join(_willorabase, "mk") scriptdir = File.join(_willorabase, "script") themedir = File.join(_willorabase, "themes") @@ -122,7 +123,7 @@ class Willora end # Leftovers. - converter_class_orig = File.join(_willorabase, "lib", "willora_pdf_converter.rb") + converter_class_orig = File.join(libdir, "willora_pdf_converter.rb") converter_class_new = File.join(realdestbase, "lib", "this_pdf_converter.rb") puts "#{converter_class_orig} => #{converter_class_new}" FileUtils.copy_entry(converter_class_orig, converter_class_new) diff --git a/lib/WilloraPDF_Manuscript_Reference.odt b/lib/WilloraPDF_Manuscript_Reference.odt deleted file mode 100644 index 79913fa..0000000 Binary files a/lib/WilloraPDF_Manuscript_Reference.odt and /dev/null differ diff --git a/lib/willora_pdf_converter.rb b/lib/willora_pdf_converter.rb deleted file mode 100644 index b2be0ea..0000000 --- a/lib/willora_pdf_converter.rb +++ /dev/null @@ -1,19 +0,0 @@ -# -# WilloraPDF -# Charlotte Koch -# - -# 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 diff --git a/project-files/lib/WilloraPDF_Manuscript_Reference.odt b/project-files/lib/WilloraPDF_Manuscript_Reference.odt new file mode 100644 index 0000000..79913fa Binary files /dev/null and b/project-files/lib/WilloraPDF_Manuscript_Reference.odt differ diff --git a/project-files/lib/willora_pdf_converter.rb b/project-files/lib/willora_pdf_converter.rb new file mode 100644 index 0000000..b2be0ea --- /dev/null +++ b/project-files/lib/willora_pdf_converter.rb @@ -0,0 +1,19 @@ +# +# WilloraPDF +# Charlotte Koch +# + +# 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 -- cgit v1.2.3