From c1f06a0b8745c2859c6f09789fd5965d87579c63 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Wed, 2 Oct 2013 10:42:35 +0200 Subject: Add OpenLMI theme for Sphinx. Note that the theme is BSD-licensed. --- openlmi-providers.spec | 17 +++ src/account/doc/source/conf.py | 4 +- src/logicalfile/doc/source/conf.py | 4 +- tools/openlmitheme/README | 3 + tools/openlmitheme/layout.html | 214 +++++++++++++++++++++++++++++ tools/openlmitheme/static/openlmi-logo.png | Bin 0 -> 6324 bytes tools/openlmitheme/static/openlmi.css | 66 +++++++++ tools/openlmitheme/theme.conf | 28 ++++ 8 files changed, 332 insertions(+), 4 deletions(-) create mode 100644 tools/openlmitheme/README create mode 100644 tools/openlmitheme/layout.html create mode 100644 tools/openlmitheme/static/openlmi-logo.png create mode 100644 tools/openlmitheme/static/openlmi.css create mode 100644 tools/openlmitheme/theme.conf diff --git a/openlmi-providers.spec b/openlmi-providers.spec index 31d30f2..79f90b2 100644 --- a/openlmi-providers.spec +++ b/openlmi-providers.spec @@ -239,6 +239,15 @@ OpenLMI provides a common infrastructure for the management of Linux systems. This package installs a core set of OpenLMI providers and necessary infrastructure packages enabling the system to be managed remotely. +%package -n python-sphinx-theme-openlmi +Summary: OpenLMI theme for Sphinx documentation generator +Requires: python-sphinx +BuildArch: noarch + +%description -n python-sphinx-theme-openlmi +python-sphinx-theme-openlmi contains Sphinx theme for OpenLMI provider +documentation. + %prep %setup -q @@ -309,6 +318,11 @@ mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/%{name} install -m 755 -d $RPM_BUILD_ROOT/%{_docdir}/%{name}/account/admin_guide cp -pr src/account/doc/build/html/* $RPM_BUILD_ROOT/%{_docdir}/%{name}/account/admin_guide +# sphinx theme +install -m 755 -d $RPM_BUILD_ROOT/%{python_sitelib}/sphinx/themes/openlmitheme +cp -pr tools/openlmitheme/* $RPM_BUILD_ROOT/%{python_sitelib}/sphinx/themes/openlmitheme/ + + %files %doc README COPYING %dir %{_datadir}/%{name} @@ -447,6 +461,9 @@ cp -pr src/account/doc/build/html/* $RPM_BUILD_ROOT/%{_docdir}/%{name}/account/a %files -n openlmi +%files -n python-sphinx-theme-openlmi +%{python_sitelib}/sphinx/themes/openlmitheme/ + %pre # If upgrading, deregister old version if [ "$1" -gt 1 ]; then diff --git a/src/account/doc/source/conf.py b/src/account/doc/source/conf.py index 96ccad2..9ebd881 100644 --- a/src/account/doc/source/conf.py +++ b/src/account/doc/source/conf.py @@ -96,7 +96,7 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = 'openlmitheme' # 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 @@ -104,7 +104,7 @@ html_theme = 'default' #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] +html_theme_path = ['../../../../tools/'] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". diff --git a/src/logicalfile/doc/source/conf.py b/src/logicalfile/doc/source/conf.py index 29001e1..fb68cbc 100644 --- a/src/logicalfile/doc/source/conf.py +++ b/src/logicalfile/doc/source/conf.py @@ -95,7 +95,7 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = 'openlmitheme' # 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 @@ -103,7 +103,7 @@ html_theme = 'default' #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] +html_theme_path = ['../../../../tools/'] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". diff --git a/tools/openlmitheme/README b/tools/openlmitheme/README new file mode 100644 index 0000000..a17989b --- /dev/null +++ b/tools/openlmitheme/README @@ -0,0 +1,3 @@ +This is OpenLMI theme for Sphix. + +It's based on openlmi.org css. \ No newline at end of file diff --git a/tools/openlmitheme/layout.html b/tools/openlmitheme/layout.html new file mode 100644 index 0000000..92f7118 --- /dev/null +++ b/tools/openlmitheme/layout.html @@ -0,0 +1,214 @@ +{# + based on sphinx basic/layout.html + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + :copyright: Copyright 2007-2011 by the Sphinx team, see Sphinx AUTHORS. + :license: BSD, see Sphinx LICENSE for details. + + Changes for OpenLMI: + - no 'relbar' on bottom + - 'relbar' includes project image and larger font, based on openlmi.org design. +#} +{%- block doctype -%} + +{%- endblock %} +{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %} +{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %} +{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and + (sidebars != []) %} +{%- set url_root = pathto('', 1) %} +{# XXX necessary? #} +{%- if url_root == '#' %}{% set url_root = '' %}{% endif %} +{%- if not embedded and docstitle %} + {%- set titlesuffix = " — "|safe + docstitle|e %} +{%- else %} + {%- set titlesuffix = "" %} +{%- endif %} + +{%- macro relbar() %} + +{%- endmacro %} + +{%- macro sidebar() %} + {%- if render_sidebar %} +
+
+ {%- block sidebarlogo %} + {%- if logo %} + + {%- endif %} + {%- endblock %} + {%- if sidebars != None %} + {#- new style sidebar: explicitly include/exclude templates #} + {%- for sidebartemplate in sidebars %} + {%- include sidebartemplate %} + {%- endfor %} + {%- else %} + {#- old style sidebars: using blocks -- should be deprecated #} + {%- block sidebartoc %} + {%- include "localtoc.html" %} + {%- endblock %} + {%- block sidebarrel %} + {%- include "relations.html" %} + {%- endblock %} + {%- block sidebarsourcelink %} + {%- include "sourcelink.html" %} + {%- endblock %} + {%- if customsidebar %} + {%- include customsidebar %} + {%- endif %} + {%- block sidebarsearch %} + {%- include "searchbox.html" %} + {%- endblock %} + {%- endif %} +
+
+ {%- endif %} +{%- endmacro %} + +{%- macro script() %} + + {%- for scriptfile in script_files %} + + {%- endfor %} +{%- endmacro %} + +{%- macro css() %} + + + {%- for cssfile in css_files %} + + {%- endfor %} +{%- endmacro %} + + + + + {{ metatags }} + {%- block htmltitle %} + {{ title|striptags|e }}{{ titlesuffix }} + {%- endblock %} + {{ css() }} + {%- if not embedded %} + {{ script() }} + {%- if use_opensearch %} + + {%- endif %} + {%- if favicon %} + + {%- endif %} + {%- endif %} +{%- block linktags %} + {%- if hasdoc('about') %} + + {%- endif %} + {%- if hasdoc('genindex') %} + + {%- endif %} + {%- if hasdoc('search') %} + + {%- endif %} + {%- if hasdoc('copyright') %} + + {%- endif %} + + {%- if parents %} + + {%- endif %} + {%- if next %} + + {%- endif %} + {%- if prev %} + + {%- endif %} +{%- endblock %} +{%- block extrahead %} {% endblock %} + + +{%- block header %}{% endblock %} + +{%- block relbar1 %}{{ relbar() }}{% endblock %} + +{%- block content %} + {%- block sidebar1 %} {# possible location for sidebar #} {% endblock %} + +
+ {%- block document %} +
+ {%- if render_sidebar %} +
+ {%- endif %} +
+ {% block body %} {% endblock %} +
+ {%- if render_sidebar %} +
+ {%- endif %} +
+ {%- endblock %} + + {%- block sidebar2 %}{{ sidebar() }}{% endblock %} +
+
+{%- endblock %} + +{%- block footer %} + +{%- endblock %} + + diff --git a/tools/openlmitheme/static/openlmi-logo.png b/tools/openlmitheme/static/openlmi-logo.png new file mode 100644 index 0000000..e414797 Binary files /dev/null and b/tools/openlmitheme/static/openlmi-logo.png differ diff --git a/tools/openlmitheme/static/openlmi.css b/tools/openlmitheme/static/openlmi.css new file mode 100644 index 0000000..a61c777 --- /dev/null +++ b/tools/openlmitheme/static/openlmi.css @@ -0,0 +1,66 @@ +@import url("default.css"); + +p.caption { + font-size: 90%; + font-style: italic; +} + +h1 { + font-size: 2em; + line-height: 1; +} + +div.sphinxsidebar li li { + padding: 0.4em 0.1em 0 0; +} + +div.body { + font-size: 1.071em; +} + +div.related { + background-color: #48a9e4; + background-image: -moz-linear-gradient(top, #0779bf 0%, #48a9e4 100%); + background-image: -ms-linear-gradient(top, #0779bf 0%, #48a9e4 100%); + background-image: -o-linear-gradient(top, #0779bf 0%, #48a9e4 100%); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #0779bf), color-stop(1, #48a9e4)); + background-image: -webkit-linear-gradient(top, #0779bf 0%, #48a9e4 100%); + background-image: linear-gradient(top, #0779bf 0%, #48a9e4 100%); + line-height: 15px; + padding-bottom: 10px; +} + +div.related ul { + font-weight:bold; +} +body { + font-size: 87%; +} + +img.logo { + padding: 15px 15px 15px 10px; +} + +div.logo { + float: left; +} + +div.header { + padding-top: 15px; + margin: 0 0 10px 15px; +} + +h1.header { + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; +} + +div.sphinxsidebarwrapper { + padding: 15px 20px; + margin: 15px; + background-color: #f6f6f2; + word-wrap: break-word; /* don't overflow with large items like LMI_SoftwareInstallationServiceAffectsElement*/ +} + +div.sphinxsidebar ul { + margin: 10px 0px 10px 0px; +} \ No newline at end of file diff --git a/tools/openlmitheme/theme.conf b/tools/openlmitheme/theme.conf new file mode 100644 index 0000000..f9fcc3d --- /dev/null +++ b/tools/openlmitheme/theme.conf @@ -0,0 +1,28 @@ +[theme] +inherit = default +stylesheet = openlmi.css + +[options] +use_index = False +show_sourcelink = False +show_copyright = False + +footerbgcolor=#292929 +sidebarbgcolor=white +sidebartextcolor=#3b3b3b +sidebarlinkcolor=#0071B3 + +relbarbgcolor=#48a9e4 +relbartextcolor=white +relbarlinkcolor=white + +bgcolor=white +textcolor=#3b3b3b +linkcolor=#0071B3 +visitedlinkcolor=#0071B3 +headbgcolor=white +headtextcolor=#3b3b3b +headlinkcolor=#0071B3 + +bodyfont='Georgia, 'Times New Roman', Times, serif' +headfont='Georgia, 'Times New Roman', Times, serif' \ No newline at end of file -- cgit