Skip to content

Commit 8cb9b4e

Browse files
committed
Add copy button for dotted config properties
1 parent db90a71 commit 8cb9b4e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

_plugins/asciidoctor-extension.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@
5252
end
5353
end
5454

55+
Extensions.register do
56+
inline_macro do
57+
named :config_property_copy_button
58+
resolve_attributes false
59+
process do |parent, target, attrs|
60+
config_property = escape_double_quotes(target)
61+
copy_btn = %(<button class="btn-copy fa fa-clipboard inline-btn-copy" data-clipboard-action="copy" data-clipboard-text='#{config_property}' title="Copy to clipboard" do-not-collapse="true"></button>)
62+
create_inline_pass parent, %(#{copy_btn})
63+
end
64+
end
65+
end
5566

5667
### ALL CONFIG page processors
5768

0 commit comments

Comments
 (0)