diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2016-09-24 23:37:56 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-24 23:37:56 -0600 |
| commit | f502de693ec3cfdbcc1dab21dcaec62fa2e5b5d8 (patch) | |
| tree | f9c961725f3e80a6a7cfe795056710a1fe02b6d9 | |
| parent | 5e8c59664f6f47379cfbad578ef6dd098fde9634 (diff) | |
resolves #577 display title for open block (PR #581)
* resolves #577 display title of open block
* slighly reduce font size of block title (aka caption) in default theme
| -rw-r--r-- | data/themes/default-theme.yml | 1 | ||||
| -rw-r--r-- | lib/asciidoctor-pdf/converter.rb | 15 |
2 files changed, 7 insertions, 9 deletions
diff --git a/data/themes/default-theme.yml b/data/themes/default-theme.yml index b693e28c..cfb51423 100644 --- a/data/themes/default-theme.yml +++ b/data/themes/default-theme.yml @@ -117,6 +117,7 @@ block: margin_bottom: $vertical_rhythm caption: align: left + font_size: $base_font_size * 0.95 font_style: italic # FIXME perhaps set line_height instead of / in addition to margins? margin_inside: $vertical_rhythm / 3 diff --git a/lib/asciidoctor-pdf/converter.rb b/lib/asciidoctor-pdf/converter.rb index 567976fa..0f5a13c9 100644 --- a/lib/asciidoctor-pdf/converter.rb +++ b/lib/asciidoctor-pdf/converter.rb @@ -523,18 +523,15 @@ class Converter < ::Prawn::Document end def convert_open node - case node.style - when 'abstract' + if node.style == 'abstract' convert_abstract node - when 'partintro' - if node.blocks.size == 1 && node.blocks.first.style == 'abstract' - convert_abstract node.blocks.first - else - add_dest_for_block node if node.id - convert_content_for_block node - end + elsif node.style == 'partintro' && node.blocks.size == 1 && node.blocks.first.style == 'abstract' + # TODO process block title and id + # TODO process abstract child even when partintro has multiple blocks + convert_abstract node.blocks.first else add_dest_for_block node if node.id + layout_caption node.title if node.title? convert_content_for_block node end end |
