From 633f3d0194d5d11b0e47c566fb64f1961bafd82c Mon Sep 17 00:00:00 2001 From: Kevin Putnam Date: Tue, 9 Jul 2019 15:05:31 -0700 Subject: [PATCH 1/2] in progress rtd theme improvements Signed-off-by: Kevin Putnam --- .../otc_tcs_sphinx_theme/cversions.html | 31 +++++++++++++++++ .../_themes/otc_tcs_sphinx_theme/layout.html | 15 +++++--- .../otc_tcs_sphinx_theme/static/tcs_theme.css | 19 ++++++++++- source/conf.py | 34 ++++++++++++++----- 4 files changed, 84 insertions(+), 15 deletions(-) create mode 100644 source/_themes/otc_tcs_sphinx_theme/cversions.html diff --git a/source/_themes/otc_tcs_sphinx_theme/cversions.html b/source/_themes/otc_tcs_sphinx_theme/cversions.html new file mode 100644 index 00000000..01889d23 --- /dev/null +++ b/source/_themes/otc_tcs_sphinx_theme/cversions.html @@ -0,0 +1,31 @@ +{# Add rst-badge after rst-versions for small badge style. #} +
+ + Clear Linux + v: {{ current_version }} + + +
+
+
{{ _('Language Versions') }}
+ {% for slug, url in languages %} +
{{ slug }}
+ {% endfor %} +
+
+
{{ _('Document Versions') }}
+ {% for slug, url in versions %} +
{{ slug }}
+ {% endfor %} +
+
+
{{ _('clearlinux.org links') }}
+
+ Project Home +
+
+ GitHub +
+
+
+
\ No newline at end of file diff --git a/source/_themes/otc_tcs_sphinx_theme/layout.html b/source/_themes/otc_tcs_sphinx_theme/layout.html index 04199e2e..9d7aae2e 100644 --- a/source/_themes/otc_tcs_sphinx_theme/layout.html +++ b/source/_themes/otc_tcs_sphinx_theme/layout.html @@ -12,21 +12,21 @@
@@ -41,6 +41,11 @@ {% endblock %} +{% block menu %} + {% include "cversions.html" %} + {{ super() }} +{% endblock %} + {% block footer %} diff --git a/source/_themes/otc_tcs_sphinx_theme/static/tcs_theme.css b/source/_themes/otc_tcs_sphinx_theme/static/tcs_theme.css index 478f2f6e..7866ffa1 100644 --- a/source/_themes/otc_tcs_sphinx_theme/static/tcs_theme.css +++ b/source/_themes/otc_tcs_sphinx_theme/static/tcs_theme.css @@ -7,7 +7,7 @@ .wy-nav-side { - background: #8e6db6; + background: #007ab2; } /* (temporarily) add an under development tagline to the bread crumb .wy-breadcrumbs::after { @@ -32,6 +32,23 @@ color: rgba(255,255,255,1); } + +.wy-side-nav-search input[type=text] { + border-radius: 0px; + padding: 0px 0px; + box-shadow: none; + border: 0; + outline: 0; + background: transparent; + border-bottom: 1px solid black; + color: white; +} + +::placeholder { + color: white; +} + + /* squish the space between a paragraph before a list */ div > p + ul, div > p + ol { margin-top: -20px; diff --git a/source/conf.py b/source/conf.py index 07a1394f..9eecc2f6 100644 --- a/source/conf.py +++ b/source/conf.py @@ -53,7 +53,7 @@ master_doc = 'index' # General information about the project. #project = u'Clear Linux* project' -project = u'Documentation' +project = u'Clear Linux* Project Docs' copyright = u'2019, many' author = u'many' @@ -121,20 +121,36 @@ rst_epilog = """ #html_theme = 'sphinx_rtd_theme' html_theme = 'otc_tcs_sphinx_theme' +version = current_version = "latest" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + 'style_nav_header_background': '#007ab2', + 'navigation_depth': 4, + 'display_version': False +} + html_context = { "display_github": True, # Integrate GitHub "github_user": "clearlinux", # Username "github_repo": "clear-linux-documentation", # Repo name "github_version": "rtd-theme", # Version "conf_py_path": "/source/", # Path in the checkout to the docs root -} - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - 'style_nav_header_background': '#8e6db6', - 'navigation_depth': 4 + "current_version": current_version, + "languages": ( ("English", ""), + ("Mandarin", "md"), + ("Spanish", "esp") + ), + "versions": ( ("latest", ""), + ("LTS 1", "lts1"), + ("LTS 2", "lts2"), + ("LTS 3", "lts3"), + ("LTS 4", "lts4"), + ("LTS 5", "lts5"), + ("LTS 6", "lts6") + ) } # Add any paths that contain custom themes here, relative to this directory. From 56876535083beee34e0bf869f2da8f02be0e63f0 Mon Sep 17 00:00:00 2001 From: Kevin Putnam Date: Wed, 10 Jul 2019 14:10:27 -0700 Subject: [PATCH 2/2] Fixed problem with version and language paths. Signed-off-by: Kevin Putnam --- .../_themes/otc_tcs_sphinx_theme/cversions.html | 4 ++-- source/conf.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source/_themes/otc_tcs_sphinx_theme/cversions.html b/source/_themes/otc_tcs_sphinx_theme/cversions.html index 01889d23..0c3def19 100644 --- a/source/_themes/otc_tcs_sphinx_theme/cversions.html +++ b/source/_themes/otc_tcs_sphinx_theme/cversions.html @@ -9,13 +9,13 @@
{{ _('Language Versions') }}
{% for slug, url in languages %} -
{{ slug }}
+
{{ slug }}
{% endfor %}
{{ _('Document Versions') }}
{% for slug, url in versions %} -
{{ slug }}
+
{{ slug }}
{% endfor %}
diff --git a/source/conf.py b/source/conf.py index 9eecc2f6..71dcd5be 100644 --- a/source/conf.py +++ b/source/conf.py @@ -140,16 +140,16 @@ html_context = { "conf_py_path": "/source/", # Path in the checkout to the docs root "current_version": current_version, "languages": ( ("English", ""), - ("Mandarin", "md"), - ("Spanish", "esp") + ("Mandarin", "/md"), + ("Spanish", "/esp") ), "versions": ( ("latest", ""), - ("LTS 1", "lts1"), - ("LTS 2", "lts2"), - ("LTS 3", "lts3"), - ("LTS 4", "lts4"), - ("LTS 5", "lts5"), - ("LTS 6", "lts6") + ("LTS 1", "/lts/v1"), + ("LTS 2", "/lts/v2"), + ("LTS 3", "/lts/v3"), + ("LTS 4", "/lts/v4"), + ("LTS 5", "/lts/v5"), + ("LTS 6", "/lts/v6") ) }