diff options
| -rw-r--r-- | CHANGELOG.adoc | 2 | ||||
| -rw-r--r-- | data/themes/base-theme.yml | 2 | ||||
| -rw-r--r-- | data/themes/default-theme.yml | 4 | ||||
| -rw-r--r-- | docs/theming-guide.adoc | 13 | ||||
| -rw-r--r-- | lib/asciidoctor/pdf/converter.rb | 4 | ||||
| -rw-r--r-- | spec/list_spec.rb | 2 |
6 files changed, 13 insertions, 14 deletions
diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 327c8b5f..f167d758 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -74,7 +74,7 @@ Enhancements:: * include floor and ceil match characters in fallback font (#1832) (*@oddhack*) * allow horizontal and vertical lines of table grid to be styled independently (#1875) (*@hextremist*) * allow theme to define the characters for typographical quotation marks (#1880) (*@klonfish*) -* allow theme to control top margin of callout lists that immediately follow a code (i.e., listing, literal, or source) block (#1895) +* allow theme to control top margin of callout lists that immediately follow a code block using `callout-list-margin-top-after-code` key (#1895) * introduce `layout_general_heading` to allow extended converter to access node (#1904) * use `Document#authors` to retrieve authors instead of extracting the information from the indexed document attributes * add support for character references that contain both uppercase and lowercase hexadecimal characters (#1990) (*@etiwnad*) diff --git a/data/themes/base-theme.yml b/data/themes/base-theme.yml index 7e81b273..3b7aec2d 100644 --- a/data/themes/base-theme.yml +++ b/data/themes/base-theme.yml @@ -58,6 +58,7 @@ list_item_spacing: 6 description_list_description_indent: 30 description_list_term_font_style: bold description_list_term_spacing: 4 +callout_list_margin_top_after_code: -6 block_margin_bottom: 12 caption_align: left caption_font_style: italic @@ -85,7 +86,6 @@ code_line_height: 1.2 code_padding: 9 code_border_color: 'EEEEEE' code_border_width: 0.5 -code_callout_list_margin_top: -6 conum_line_height: 1.15 conum_glyphs: circled example_background_color: 'FFFFFF' diff --git a/data/themes/default-theme.yml b/data/themes/default-theme.yml index 726cd1fa..2a32ca08 100644 --- a/data/themes/default-theme.yml +++ b/data/themes/default-theme.yml @@ -195,8 +195,6 @@ code: border_color: CCCCCC border_radius: $base_border_radius border_width: 0.75 - callout_list: - margin_top: -$block_margin_bottom / 2 conum: font_family: $codespan_font_family font_color: $codespan_font_color @@ -239,6 +237,8 @@ description_list: term_font_style: bold term_spacing: $vertical_rhythm / 4 description_indent: $horizontal_rhythm * 1.25 +callout_list: + margin_top_after_code: -$block_margin_bottom / 2 table: background_color: $page_background_color border_color: DDDDDD diff --git a/docs/theming-guide.adoc b/docs/theming-guide.adoc index 4586cf65..92f09530 100644 --- a/docs/theming-guide.adoc +++ b/docs/theming-guide.adoc @@ -2618,13 +2618,6 @@ The keys in this category are used to control the style of literal, listing, and (default: #999999) |code: linenum-font-color: #ccc - -|callout-list-margin-top -|<<measurement-units,Measurement>> + -(default: -$block-margin-bottom) -|code: - callout-list: - margin-top: 0 |=== 1. The line-gap property is used to tune the height of the background color applied to a span of block text highlighted using Rouge. @@ -4174,6 +4167,12 @@ callout-list: (default: $list-text-align) |callout-list: text-align: left + +|margin-top-after-code +|<<measurement-units,Measurement>> + +(default: -$block-margin-bottom) +|callout-list: + margin-top-after-code: 0 |=== [#keys-table] diff --git a/lib/asciidoctor/pdf/converter.rb b/lib/asciidoctor/pdf/converter.rb index ae8d4e86..c644ebff 100644 --- a/lib/asciidoctor/pdf/converter.rb +++ b/lib/asciidoctor/pdf/converter.rb @@ -469,7 +469,7 @@ module Asciidoctor theme.description_list_description_indent ||= 0 theme.image_border_width ||= 0 theme.code_linenum_font_color ||= '999999' - theme.code_callout_list_margin_top ||= 0 + theme.callout_list_margin_top_after_code ||= 0 theme.role_unresolved_font_color ||= 'FF0000' theme.index_columns ||= 2 theme.footnotes_item_spacing ||= 0 @@ -1111,7 +1111,7 @@ module Asciidoctor end def convert_colist node - margin_top @theme.code_callout_list_margin_top if !at_page_top? && ([:listing, :literal].include? node.parent.blocks[(node.parent.blocks.index node) - 1].context) + margin_top @theme.callout_list_margin_top_after_code if !at_page_top? && ([:listing, :literal].include? node.parent.blocks[(node.parent.blocks.index node) - 1].context) add_dest_for_block node if node.id @list_numerals << 1 last_item = node.items[-1] diff --git a/spec/list_spec.rb b/spec/list_spec.rb index fcd19c95..0d428110 100644 --- a/spec/list_spec.rb +++ b/spec/list_spec.rb @@ -1757,7 +1757,7 @@ describe 'Asciidoctor::PDF::Converter - List' do <2> Last line EOS - pdf_theme = { code_callout_list_margin_top: 0 } + pdf_theme = { callout_list_margin_top_after_code: 0 } pdf = to_pdf input, pdf_theme: pdf_theme, analyze: :line bottom_line_y = pdf.lines[2][:from][:y] |
