diff --git a/content/concepts/introduction/technical-faq.md b/content/concepts/introduction/technical-faq.md index 428cfd5b39..4beec00200 100644 --- a/content/concepts/introduction/technical-faq.md +++ b/content/concepts/introduction/technical-faq.md @@ -5,8 +5,12 @@ blurb: Get answers to frequently asked questions, covering topics such as valida labels: - Blockchain #top_nav_grouping: Questions +template: page-faq2.html.jinja +eyebrow_text: Your Questions About XRPL, Answered +filters: + - faq --- -# Technical FAQ +# FAQ ## Validators and Unique Node Lists diff --git a/template/page-faq2.html.jinja b/template/page-faq2.html.jinja new file mode 100644 index 0000000000..cf17b2e25c --- /dev/null +++ b/template/page-faq2.html.jinja @@ -0,0 +1,44 @@ +{% extends "base.html.jinja" %} +{% block head %} + + + + + +{% endblock %} + +{% block bodyclasses %}no-sidebar{% endblock %} +{% block mainclasses %}landing{% endblock %} + +{% block breadcrumbs %}{% endblock %} + +{% block main %} + +
+ +
+ +
+
+
+

{{page.name}}

+
{{page.eyebrow_text}}
+
+
+
+ +
+ {{content}} +
+{% endblock %} + + +{% block endbody %} + + +{% endblock %} diff --git a/tool/filter_faq.py b/tool/filter_faq.py new file mode 100644 index 0000000000..8f8c0afa27 --- /dev/null +++ b/tool/filter_faq.py @@ -0,0 +1,31 @@ +################################################ +## FAQ Formatter +## Author: Rome Reginelli +## Copyright: Ripple Labs, 2021 +## +## Styles the FAQ as an accordion of questions. +################################################ +from bs4 import NavigableString + +Q_TAG = "h4" + +def filter_soup(soup, **kwargs): + qs = soup.find_all(Q_TAG) + + for q in qs: + stuff_to_wrap = [] + el = q + while el.next_sibling: + el = el.next_sibling + if isinstance(el, NavigableString): + stuff_to_wrap.append(el) + elif el.name != Q_TAG: + stuff_to_wrap.append(el) + else: + # We probably found the next question, stop here + break + + wrapper = soup.new_tag("div", class_="q-wrapper") + [wrapper.append(el) for el in stuff_to_wrap] + q.replace_with(wrapper) + wrapper.insert(0, q)