diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2023-03-12 01:08:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-12 01:08:26 -0700 |
| commit | 84ac57b311f2e936ebff4aa8c410c2dd2edb6887 (patch) | |
| tree | 3d161197f3cbb84e281b8017f82b53fe79f88465 | |
| parent | 6f6d9aab531ce5fc2b7b32aee9c2bd63fcbafd00 (diff) | |
resolves #2402 add callout-list-marker-font-color theme key to control color of conum marker in callout list (PR #2403)
| -rw-r--r-- | CHANGELOG.adoc | 1 | ||||
| -rw-r--r-- | docs/modules/theme/pages/callout.adoc | 7 | ||||
| -rw-r--r-- | lib/asciidoctor/pdf/converter.rb | 3 | ||||
| -rw-r--r-- | spec/list_spec.rb | 4 |
4 files changed, 13 insertions, 2 deletions
diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 6f07d3a9..fbcb7e68 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -28,6 +28,7 @@ Enhancements:: * add support for passing a color mode to the default optimizer (#2347) * support horizontal alignment on AsciiDoc table cell that only contains paragraphs (#2358) * allow revision content to be customized by theme (#2362) +* add `callout-list-marker-font-color` theme key to control color of conum marker in callout list (#2402) Improvements:: diff --git a/docs/modules/theme/pages/callout.adoc b/docs/modules/theme/pages/callout.adoc index bee5fac3..1319a0c8 100644 --- a/docs/modules/theme/pages/callout.adoc +++ b/docs/modules/theme/pages/callout.adoc @@ -71,6 +71,13 @@ callout-list: callout-list: margin-top-after-code: 0 +|marker-font-color +|xref:color.adoc[Color] + +(default: `$conum-font-color`) +|[source] +callout-list: + marker-font-color: #000000 + |text-align |xref:text.adoc#text-align[Text alignment] + (default: `$list-text-align`) diff --git a/lib/asciidoctor/pdf/converter.rb b/lib/asciidoctor/pdf/converter.rb index 2f8913cd..15f80011 100644 --- a/lib/asciidoctor/pdf/converter.rb +++ b/lib/asciidoctor/pdf/converter.rb @@ -1383,9 +1383,10 @@ module Asciidoctor @list_numerals << (index = @list_numerals.pop).next theme_font :conum do marker_width = rendered_width_of_string %(#{marker = conum_glyph index}x) + marker_font_color = @theme.callout_list_marker_font_color || @font_color float do bounding_box [bounds.left, cursor], width: marker_width do - ink_prose marker, align: :center, inline_format: false, margin: 0 + ink_prose marker, align: :center, inline_format: false, margin: 0, color: marker_font_color end end end diff --git a/spec/list_spec.rb b/spec/list_spec.rb index 8e865168..b4f17860 100644 --- a/spec/list_spec.rb +++ b/spec/list_spec.rb @@ -1894,6 +1894,7 @@ describe 'Asciidoctor::PDF::Converter - List' do callout_list_font_size: 9, callout_list_font_color: '555555', callout_list_item_spacing: 3, + callout_list_marker_font_color: '0000FF', conum_font_size: nil, } @@ -1910,8 +1911,9 @@ describe 'Asciidoctor::PDF::Converter - List' do conum_1_text = pdf.find_text ?\u2460 (expect conum_1_text).to have_size 2 (expect conum_1_text[0][:font_size]).to eql 11 + (expect conum_1_text[0][:font_color]).to eql 'B12146' (expect conum_1_text[1][:font_size]).to eql 9 - (expect conum_1_text[1][:font_color]).to eql 'B12146' + (expect conum_1_text[1][:font_color]).to eql '0000FF' colist_1_text = pdf.find_unique_text %r/^The base URL/ (expect colist_1_text[:font_size]).to eql 9 (expect colist_1_text[:font_color]).to eql '555555' |
