From bd21d079a0831f24afacfb60c13916b4b6520d1f Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Tue, 24 Apr 2018 19:06:19 -0700 Subject: [PATCH] Sidebar for 6-level nav --- 5layers.yml | 34 ++++ tool/template-sidebar_nav.html | 314 ++++++++++++++++++++++++--------- 2 files changed, 261 insertions(+), 87 deletions(-) diff --git a/5layers.yml b/5layers.yml index f9ff9fe434..5767e91b47 100644 --- a/5layers.yml +++ b/5layers.yml @@ -205,13 +205,24 @@ pages: - name: References funnel: Docs doc_type: References + template: template-landing-children.html html: landing-references.html targets: - local + - name: References + funnel: Docs + doc_type: References + supercategory: rippled API + template: template-landing-children.html + html: reference-rippled-api.html + targets: + - local + - name: rippled API Public Methods funnel: Docs doc_type: References + supercategory: rippled API category: rippled API Public Methods html: reference-rippled-public.html template: template-landing-children.html @@ -221,6 +232,7 @@ pages: - name: Ledger Methods funnel: Docs doc_type: References + supercategory: rippled API category: rippled API Public Methods subcategory: Ledger Methods template: template-landing-children.html @@ -231,6 +243,7 @@ pages: - md: rippled-api-methods/ledger_closed.md funnel: Docs doc_type: References + supercategory: rippled API category: rippled API Public Methods subcategory: Ledger Methods targets: @@ -239,6 +252,7 @@ pages: - md: rippled-api-methods/ledger_current.md funnel: Docs doc_type: References + supercategory: rippled API category: rippled API Public Methods subcategory: Ledger Methods targets: @@ -247,6 +261,7 @@ pages: - md: rippled-api-methods/ledger_data.md funnel: Docs doc_type: References + supercategory: rippled API category: rippled API Public Methods subcategory: Ledger Methods targets: @@ -255,6 +270,7 @@ pages: - name: Account Methods funnel: Docs doc_type: References + supercategory: rippled API category: rippled API Public Methods subcategory: Account Methods template: template-landing-children.html @@ -265,6 +281,7 @@ pages: - md: rippled-api-methods/account_channels.md funnel: Docs doc_type: References + supercategory: rippled API category: rippled API Public Methods subcategory: Account Methods targets: @@ -273,6 +290,7 @@ pages: - md: rippled-api-methods/account_info.md funnel: Docs doc_type: References + supercategory: rippled API category: rippled API Public Methods subcategory: Account Methods targets: @@ -281,6 +299,7 @@ pages: - name: Transaction Methods funnel: Docs doc_type: References + supercategory: rippled API category: rippled API Public Methods subcategory: Transaction Methods template: template-landing-children.html @@ -291,6 +310,7 @@ pages: - name: rippled API Admin Methods funnel: Docs doc_type: References + supercategory: rippled API category: rippled API Admin Methods html: reference-rippled-admin.html template: template-landing-children.html @@ -300,6 +320,7 @@ pages: - md: rippled-api-methods/ledger_accept.md funnel: Docs doc_type: References + supercategory: rippled API category: rippled API Admin Methods subcategory: Server Control Methods targets: @@ -308,6 +329,7 @@ pages: - md: reference-transaction-format.md funnel: Docs doc_type: References + supercategory: rippled API category: Transaction Format targets: - local @@ -319,6 +341,18 @@ pages: targets: - local + - name: RippleAPI Reference # name is required for remote-sourced files + md: https://raw.githubusercontent.com/ripple/ripple-lib/0.21.0/docs/index.md + html: reference-rippleapi.html + funnel: Docs + doc_type: References + category: RippleAPI for JavaScript + filters: + - remove_doctoc + - add_version + targets: + - local + - md: use-cases.md funnel: Use Cases filters: diff --git a/tool/template-sidebar_nav.html b/tool/template-sidebar_nav.html index 3c0a5ac311..a1b8892e15 100644 --- a/tool/template-sidebar_nav.html +++ b/tool/template-sidebar_nav.html @@ -1,102 +1,242 @@ -
- {% if currentpage.doc_type is defined %} - +
+ + + {% if currentpage.supercategory is defined %} +
+ {% if currentpage == (pages|selectattr('supercategory', 'equalto', currentpage.supercategory)|first) %} + {{ currentpage.supercategory }} + {% else %} + {{ currentpage.supercategory }} + {% endif %} +
+ {% elif currentpage.doc_type is defined %} + {% elif currentpage.funnel is defined %} -
- {% if currentpage == (pages|selectattr('funnel', 'equalto', currentpage.funnel)|first) %} - {{ currentpage.funnel }} - {% else %} - {{ currentpage.funnel }} - {% endif %} -
+
+ {% if currentpage == (pages|selectattr('funnel', 'equalto', currentpage.funnel)|first) %} + {{ currentpage.funnel }} + {% else %} + {{ currentpage.funnel }} + {% endif %} +
{% endif %} - {% if pages|selectattr("funnel", "equalto", currentpage.funnel)|selectattr("category", "defined")|list|length %} -
- {% for cat in categories %} - {% set catpages = pages|selectattr("category", "equalto", cat)|list %} - {% if currentpage.funnel is defined %} - {% set catpages = catpages|selectattr("funnel", "equalto", currentpage.funnel)|list %} - {% endif %} - {% if currentpage.doc_type is defined %} - {% set catpages = catpages|selectattr("doc_type", "equalto", currentpage.doc_type)|list %} - {% endif %} - {% if catpages|length %} -
- + -
+ {% if not pages|selectattr("funnel", "equalto", currentpage.funnel)|selectattr("category", "defined")|list|length %} + + {% set funnelpages = pages|selectattr("funnel", "equalto", currentpage.funnel)|list %} +
+
-
+
+
-
- {% endif %} - {% endfor %} -
+ {% elif currentpage.supercategory is defined %} + +
+ {% for cat in categories %} + {% set catpages = pages|selectattr("category", "equalto", cat)|list %} + {% if currentpage.funnel is defined %} + {% set catpages = catpages|selectattr("funnel", "equalto", currentpage.funnel)|list %} + {% endif %} + {% if currentpage.doc_type is defined %} + {% set catpages = catpages|selectattr("doc_type", "equalto", currentpage.doc_type)|list %} + {% endif %} + {% set catpages = catpages|selectattr("supercategory", "equalto", currentpage.supercategory)|list %} + {% if catpages|length %} + {% set cat_parent = pages|selectattr('category', 'equalto', cat)|first %} +
+ + +
+
+ +
+
+ +
+ {% endif %} + {% endfor %} +
{% else %} - {#--- No categories in this funnel --#} - {% set funnelpages = pages|selectattr("funnel", "equalto", currentpage.funnel)|list %} -
-
-
- -
-
-
+ {% endif %} + + + + + {% elif page.category is defined and page.category not in printed_modules %} + + {% set cat = page.category %} + {% set catpages = sidebar_pagelist|selectattr("category", "equalto", page.category)|list %} + {% if catpages|length %} + {% set cat_parent = catpages|first %} +
+ + +
+
+ +
+
+ +
+ {% endif %} + {% set _ = printed_modules.append(page.category) %} + + {% endif %} + {% endfor %} +
{% endif %} -
+