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
+ if (contents[i].tagName.toLowerCase() == 'div') { + var element = contents[i].children[0]; + var element_type = element.tagName.toLowerCase(); + var span_id; + var spanElement; + + //if the next element is a span grab the id and skip to the header + if (element_type == 'span') { + span_id = element.id; + element.id = ""; + element = contents[i].children[1]; + element_type = element.tagName.toLowerCase(); + } + + var btn = document.createElement("BUTTON"); + //If it is a header capture which level and pass on to button + if (element_type.length == 2 && element_type[0] == 'h') { + var newClass = 'c' + element_type[1]; + //collapses the section by default only if javascript is working + contents[i].style.maxHeight = 0; + //Build the button and define behavior + btn.className += " " + newClass; + btn.innerHTML = element.innerHTML; + btn.className += " collapsible"; + btn.id = span_id; + btn.addEventListener("click", function() { + this.classList.toggle("active"); + var content = this.nextElementSibling; + if (content.style.maxHeight != "0px"){ + content.style.maxHeight = 0; + } else { + content.style.maxHeight = content.scrollHeight + "px"; + } + }); + + //Add the button to the page and remove the header + contents[i].parentNode.insertBefore(btn, contents[i]); + contents[i].removeChild(element); + }else{ + //reset span id if it isn't followed by Hx element + spanElement.id = span_id; + } + } +} \ No newline at end of file diff --git a/source/_themes/otc_tcs_sphinx_theme/theme.conf b/source/_themes/otc_tcs_sphinx_theme/theme.conf new file mode 100644 index 00000000..fc97c552 --- /dev/null +++ b/source/_themes/otc_tcs_sphinx_theme/theme.conf @@ -0,0 +1,2 @@ +[theme] +inherit = sphinx_rtd_theme diff --git a/source/conf.py b/source/conf.py index 21c4a37f..52a918c1 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' -copyright = u'2016, many' +copyright = u'2019, many' author = u'many' # The version info for the project you're documenting, acts as replacement for @@ -61,9 +61,9 @@ author = u'many' # built documents. # # The short X.Y version. -version = '0.1' +#version = '0.1' # The full version, including alpha/beta/rc tags. -release = '0.1' +#release = '0.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -80,7 +80,7 @@ language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['_build'] +exclude_patterns = ['_build','_themes'] # The reST default role (used for this markup: `text`) to use for all # documents. @@ -117,8 +117,8 @@ rst_epilog = """ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'sphinx_rtd_theme' -#html_theme = 'zephyr' +#html_theme = 'sphinx_rtd_theme' +html_theme = 'otc_tcs_sphinx_theme' html_context = { "display_github": True, # Integrate GitHub @@ -145,7 +145,7 @@ html_title = "Documentation for Clear Linux* project" # The name of an image file (relative to this directory) to place at the top # of the sidebar. -#html_logo = None +html_logo = 'images/clearlinux.png' # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 diff --git a/source/images/clear-technologies.svg b/source/images/clear-technologies.svg new file mode 100644 index 00000000..cba4c377 --- /dev/null +++ b/source/images/clear-technologies.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/images/clearlinux.png b/source/images/clearlinux.png new file mode 100644 index 00000000..af518c0e Binary files /dev/null and b/source/images/clearlinux.png differ