summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-08-23 23:44:43 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-08-24 00:44:55 -0600
commitdf6d1674eb9993fc6b608f535d27008cd4343cdf (patch)
tree2c0ebc41799d00d9b03c13d49f6dc6afca26b097 /lib
parent9bad990322b2952888fd8e0e8cc348d1ac45f46b (diff)
rename kbd-separator theme key to kbd-separator-content to make its consistent with other content keys
- remap old key and warn
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor/pdf/converter.rb4
-rw-r--r--lib/asciidoctor/pdf/theme_loader.rb3
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/asciidoctor/pdf/converter.rb b/lib/asciidoctor/pdf/converter.rb
index e82f52cf..9058f3bf 100644
--- a/lib/asciidoctor/pdf/converter.rb
+++ b/lib/asciidoctor/pdf/converter.rb
@@ -589,7 +589,7 @@ module Asciidoctor
theme.footnotes_item_spacing ||= 0
theme.index_columns ||= 2
theme.index_column_gap ||= theme.base_font_size
- theme.kbd_separator ||= '+'
+ theme.kbd_separator_content ||= '+'
theme.title_page_authors_delimiter ||= ', '
theme.title_page_revision_delimiter ||= ', '
theme.toc_indent ||= 0
@@ -2656,7 +2656,7 @@ module Asciidoctor
if (keys = node.attr 'keys').size == 1
%(<kbd>#{keys[0]}</kbd>)
else
- keys.map {|key| %(<kbd>#{key}</kbd>) }.join (load_theme node.document).kbd_separator
+ keys.map {|key| %(<kbd>#{key}</kbd>) }.join (load_theme node.document).kbd_separator_content
end
end
diff --git a/lib/asciidoctor/pdf/theme_loader.rb b/lib/asciidoctor/pdf/theme_loader.rb
index 0d581ec5..e68b6ab5 100644
--- a/lib/asciidoctor/pdf/theme_loader.rb
+++ b/lib/asciidoctor/pdf/theme_loader.rb
@@ -186,7 +186,8 @@ module Asciidoctor
else
data[key] = to_color evaluate val, data, math: false
end
- elsif key.end_with? '_content'
+ elsif (key.end_with? '_content') || (key == 'kbd_separator' && (rekey = key = 'kbd_separator_content'))
+ logger.warn %(the kbd-separator theme key is deprecated; use the kbd-separator-content key instead) if rekey
data[key] = (expand_vars val.to_s, data).to_s
else
data[key] = evaluate val, data