diff --git a/source/_themes/otc_tcs_sphinx_theme/.gitignore b/source/_themes/otc_tcs_sphinx_theme/.gitignore new file mode 100644 index 00000000..bee8a64b --- /dev/null +++ b/source/_themes/otc_tcs_sphinx_theme/.gitignore @@ -0,0 +1 @@ +__pycache__ diff --git a/source/_themes/otc_tcs_sphinx_theme/layout.html b/source/_themes/otc_tcs_sphinx_theme/layout.html new file mode 100644 index 00000000..87674bfb --- /dev/null +++ b/source/_themes/otc_tcs_sphinx_theme/layout.html @@ -0,0 +1,14 @@ +{% extends "sphinx_rtd_theme/layout.html" %} + + +{% block extrahead %} + + + +{% endblock %} + +{% block footer %} + + + +{% endblock %} diff --git a/source/_themes/otc_tcs_sphinx_theme/readme.rst b/source/_themes/otc_tcs_sphinx_theme/readme.rst new file mode 100644 index 00000000..45b63d8e --- /dev/null +++ b/source/_themes/otc_tcs_sphinx_theme/readme.rst @@ -0,0 +1,28 @@ +OTC-TCS Sphinx Theme +#################### + +Built on top of the popular Read the Docs Sphinx theme, this theme +has a few small formatting/color improvements and implements collapsible +sections. It is in active development in order to support OTC and other +Intel organizations to publish high quality, consistent documentation +for open source projects. + +To see an example of documentation produced using this theme visit the +`OTC-TCS Documentation`_ site. + +How to use it +************* + +#. Download or clone the repository +#. Create a ``_themes`` directory in main directory of your sphinx + documentation +#. Install sphinx_rtd_theme using pip: ``pip3 install sphinx_rtd_theme`` +#. copy ``otc_tcs_sphinx_theme`` directory into the new ``_themes`` directory +#. Add the following to your ``conf.py``: + + .. code-block:: python + + html_theme = 'otc_tcs_sphinx_theme' + html_theme_path = ['_themes'] + +.. _OTC-TCS Documentation: https://github.intel.com/pages/otc-tcs/ diff --git a/source/_themes/otc_tcs_sphinx_theme/static/tcs_theme.css b/source/_themes/otc_tcs_sphinx_theme/static/tcs_theme.css new file mode 100644 index 00000000..636ffb88 --- /dev/null +++ b/source/_themes/otc_tcs_sphinx_theme/static/tcs_theme.css @@ -0,0 +1,150 @@ +/* -- Extra CSS styles for content (RTD theme) ----------------------- */ + +/* make the page width fill the window */ +.wy-nav-content { + max-width: none; +} + +/* (temporarily) add an under development tagline to the bread crumb +.wy-breadcrumbs::after { + content: " (Content under development)"; + background-color: #FFFACD; + color: red; + font-weight: bold; +} +*/ + +/* code block highlight color in rtd changed to lime green, no no no */ + +.rst-content tt.literal, .rst-content code.literal, .highlight { + background: #f0f0f0; +} +.rst-content tt.literal, .rst-content code.literal { + color: #000000; +} + +/* Make the version number more visible */ +.wy-side-nav-search>div.version { + color: rgba(255,255,255,1); +} + +/* squish the space between a paragraph before a list */ +div > p + ul, div > p + ol { + margin-top: -20px; +} + +/* add some space before the figure caption */ +p.caption { + border-top: 1px solid; + margin-top: 1em; +} + +/* add a colon after the figure/table number (before the caption) */ +span.caption-number::after { + content: ": "; +} + +p.extrafooter { + text-align: right; + margin-top: -36px; +} + +table.align-center { + display: table !important; +} + + +.code-block-caption { + color: #000; + font: italic 85%/1 arial,sans-serif; + padding: 1em 0; + text-align: center; +} + +/* make .. hlist:: tables fill the page */ +table.hlist { + width: 95% !important; +} + +/* override rtd theme white-space no-wrap in table heading and content */ +th,td { + white-space: normal !important; +} + +/* tweak for doxygen-generated API headings (for RTD theme) */ +.rst-content dl.group>dt, .rst-content dl.group>dd>p { + display:none !important; +} +.rst-content dl.group { + margin: 0 0 12px 0px; +} +.rst-content dl.group>dd { + margin-left: 0 !important; +} +.rst-content p.breathe-sectiondef-title { + text-decoration: underline; /* for API sub-headings */ + font-size: 1.25rem; + font-weight: bold; + margin-bottom: 12px; +} + +.rst-content div.breathe-sectiondef { + padding-left: 0 !important; +} + +.c1 { + font-size: 175%; +} + +.c2 { + font-size: 150%; +} + +.c3 { + font-size: 125%; +} + +.c4 { + font-size: 115%; +} + +.c5 { + font-size: 110%; +} + +.c6 { + font-size: 100%; +} + +.collapsible { + margin-left: -10px; + background-color: #f1f1f1; + cursor: pointer; + padding: 18px 18px 18px 10px; + width: 100%; + border: none; + text-align: left; + outline: none; + font-weight: 700; + font-family: "Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif; +} + +.collapsible:hover { + background-color: #d8d8d8; +} + +.collapsible:after { + content: '\002B'; + font-weight: bold; + float: right; + margin-left: 5px; +} + +.active:after { + content: "\2212"; +} + +.content-collapse { + overflow: hidden; + transition: max-height 0.2s ease-out; +} diff --git a/source/_themes/otc_tcs_sphinx_theme/static/tcs_theme.js b/source/_themes/otc_tcs_sphinx_theme/static/tcs_theme.js new file mode 100644 index 00000000..57ded7d0 --- /dev/null +++ b/source/_themes/otc_tcs_sphinx_theme/static/tcs_theme.js @@ -0,0 +1,50 @@ +var i; +var contents = document.getElementsByClassName("content-collapse section"); + +for (i = 0; i < contents.length; i++) { + + //Make sure the "content-collapse section" class is occurring in