{% trans %}Sorry, this page is not available in your language.{% endtrans %}
+
{% trans %}Sorry, this page is not available in your language.{% endtrans %}
{% endif %}
diff --git a/tool/filter_copy_code_to_clipboard.py b/tool/filter_copy_code_to_clipboard.py
index 6ff346248e..bbde54e967 100644
--- a/tool/filter_copy_code_to_clipboard.py
+++ b/tool/filter_copy_code_to_clipboard.py
@@ -18,7 +18,7 @@ def filter_soup(soup, **kwargs):
1. Finds all elements with class of "codehilite"
2. Adds copy to clipboard button.
Button looks like >
-
+
3. Adds id to {% trans %}We are making an effort to offer the XRP Ledger Dev Portal in a variety of languages, but not all pages are available in all languages. If you'd like to help, please contribute!{% endtrans %}
element.
"""
@@ -29,15 +29,22 @@ def filter_soup(soup, **kwargs):
codeBlock = code_block.find("code")
codeBlock_id = "codeblock-%d" % index1
codeBlock["id"] = codeBlock_id
+ # Add button group
+ btn_group = soup.new_tag('div')
+ btn_group['class'] = "btn-group"
+ btn_group['role'] = "group"
+ btn_group['aria-label'] = "Code Buttons"
+ code_block.insert(0, btn_group)
+
# Add copy button
new_tag = soup.new_tag('button', id=codeBlock_id+'button')
icon = soup.new_tag('i')
icon['class'] = "fa fa-clipboard"
- new_tag['class'] = "clipboard-btn"
+ new_tag['class'] = "btn btn-outline-secondary clipboard-btn"
new_tag['alt'] = "Copy to clipboard"
new_tag['data-clipboard-target'] = "#"+codeBlock_id
new_tag.insert(0, icon)
- code_block.insert(0, new_tag)
+ btn_group.insert(0, new_tag)
#
index1 += 1