You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by as...@apache.org on 2020/12/09 13:38:32 UTC
[airflow-site] 01/01: Show hidden ToCs in the sidebar.
This is an automated email from the ASF dual-hosted git repository.
ash pushed a commit to branch toctree-config
in repository https://gitbox.apache.org/repos/asf/airflow-site.git
commit 72d98d8d55cdba424179da3d8c07e3b1a5ddb82a
Author: Ash Berlin-Taylor <as...@firemirror.com>
AuthorDate: Wed Dec 9 13:37:10 2020 +0000
Show hidden ToCs in the sidebar.
Relates to apache/airflow#12554
This config, naming, and default behaviour was taken from the
"alabaster" sphinx theme (the default HTML theme)
---
sphinx_airflow_theme/README.md | 5 +++++
sphinx_airflow_theme/sphinx_airflow_theme/globaltoc.html | 2 +-
sphinx_airflow_theme/sphinx_airflow_theme/theme.conf | 2 ++
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/sphinx_airflow_theme/README.md b/sphinx_airflow_theme/README.md
index c8ac182..2340cc8 100644
--- a/sphinx_airflow_theme/README.md
+++ b/sphinx_airflow_theme/README.md
@@ -84,6 +84,11 @@ html_theme_options = {
}
```
+## `sidebar_collapse`
+## `sidebar_includehidden`
+
+Controls the ToC display in the sidebar. See https://www.sphinx-doc.org/en/master/templating.html#toctree for more info
+
# Theme's source files
- `<ROOT DIRECTORY>/sphinx_airflow_theme/sphinx_airflow_theme` - HTML files
diff --git a/sphinx_airflow_theme/sphinx_airflow_theme/globaltoc.html b/sphinx_airflow_theme/sphinx_airflow_theme/globaltoc.html
index 00a552f..c5d5951 100644
--- a/sphinx_airflow_theme/sphinx_airflow_theme/globaltoc.html
+++ b/sphinx_airflow_theme/sphinx_airflow_theme/globaltoc.html
@@ -19,7 +19,7 @@
#}
<div class="toctree" role="navigation" aria-label="main navigation">
- {{ toctree() }}
+ {{ toctree(includehidden=theme_sidebar_includehidden, collapse=theme_sidebar_collapse) }}
</div>
<style type="text/css">
diff --git a/sphinx_airflow_theme/sphinx_airflow_theme/theme.conf b/sphinx_airflow_theme/sphinx_airflow_theme/theme.conf
index d0009f6..f72996a 100644
--- a/sphinx_airflow_theme/sphinx_airflow_theme/theme.conf
+++ b/sphinx_airflow_theme/sphinx_airflow_theme/theme.conf
@@ -9,3 +9,5 @@ analytics_id =
# Default set by python code, need to list this here to avoid warning from Sphinx
navbar_links =
hide_website_buttons = false
+sidebar_collapse = true
+sidebar_includehidden = true