Merge "Adds starlingxdocs_plus theme for version button"
This commit is contained in:
commit
fad2ab40ae
26
doc/source/_themes/starlingxdocs_plus/__init__.py
Normal file
26
doc/source/_themes/starlingxdocs_plus/__init__.py
Normal file
@ -0,0 +1,26 @@
|
||||
import openstackdocstheme as osdt
|
||||
|
||||
def _html_page_context(app, pagename, templatename, context, doctree):
|
||||
context['this_version']=app.config.starlingxdocs_plus_this_version
|
||||
context['other_versions']=app.config.starlingxdocs_plus_other_versions
|
||||
context['bug_project'] = app.config.starlingxdocs_plus_bug_project
|
||||
context['bug_tag'] = app.config.starlingxdocs_plus_bug_tag
|
||||
|
||||
def setup(app):
|
||||
app.add_html_theme(
|
||||
'openstackdocs',
|
||||
osdt.__path__[0] + '/theme/openstackdocs',
|
||||
)
|
||||
app.add_html_theme(
|
||||
'starlingxdocs',
|
||||
osdt.__path__[0] + '/theme/starlingxdocs',
|
||||
)
|
||||
app.add_config_value('starlingxdocs_plus_this_version','','env')
|
||||
app.add_config_value('starlingxdocs_plus_other_versions', [], 'env')
|
||||
app.add_config_value('starlingxdocs_plus_repo_name','','env')
|
||||
app.add_config_value('starlingxdocs_plus_project','','env')
|
||||
app.add_config_value('starlingxdocs_plus_auto_name', False, 'env')
|
||||
app.add_config_value('starlingxdocs_plus_bug_project','','env')
|
||||
app.add_config_value('starlingxdocs_plus_bug_tag','','env')
|
||||
app.connect('html-page-context', _html_page_context)
|
||||
app.add_css_file("custom.css")
|
3
doc/source/_themes/starlingxdocs_plus/static/custom.css
Normal file
3
doc/source/_themes/starlingxdocs_plus/static/custom.css
Normal file
@ -0,0 +1,3 @@
|
||||
.version-dropdown-content {
|
||||
top: 12px;
|
||||
}
|
2
doc/source/_themes/starlingxdocs_plus/theme.conf
Normal file
2
doc/source/_themes/starlingxdocs_plus/theme.conf
Normal file
@ -0,0 +1,2 @@
|
||||
[theme]
|
||||
inherit = starlingxdocs
|
33
doc/source/_themes/starlingxdocs_plus/titlerow.html
Normal file
33
doc/source/_themes/starlingxdocs_plus/titlerow.html
Normal file
@ -0,0 +1,33 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
{%- if theme_sidebar_dropdown == 'os_docs' %}
|
||||
<h2>{{ title }}</h2>
|
||||
{% else %}
|
||||
<h2>StarlingX API Documentation</h2>
|
||||
{%- endif %}
|
||||
</div>
|
||||
<div class="docs-actions">
|
||||
{%- block otherversions %}
|
||||
{%- if other_versions %}
|
||||
<div class="version-dropdown">
|
||||
<span>{{ _('version') }}</span>
|
||||
<div class="version-dropdown-content">
|
||||
<p><a href="." rel="nofollow">{{ this_version }}</a></p>
|
||||
{%- for ver in other_versions: %}
|
||||
<p><a href="{{pathto(ver[1], 1) }}" rel="nofollow">{{ ver[0] }}</a></p>
|
||||
{%- endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{%- endif %}
|
||||
{%- endblock %}
|
||||
{% if prev %}
|
||||
<a href="{{ prev.link|e }}"><i class="fa fa-angle-double-left" data-toggle="tooltip" data-placement="top" title="Previous: {{ prev.title|striptags }}"></i></a>
|
||||
{% endif %}
|
||||
{% if next %}
|
||||
<a href="{{ next.link|e }}"><i class="fa fa-angle-double-right" data-toggle="tooltip" data-placement="top" title="Next: {{ next.title|striptags }}"></i></a>
|
||||
{% endif %}
|
||||
{%- if bug_project %}
|
||||
<a id="logABugLink1" href="" target="_blank" title="Found an error? Report a bug against this page"><i class="fa fa-bug" data-toggle="tooltip" data-placement="top" title="Report a Bug"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
@ -14,6 +14,7 @@
|
||||
#
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0,os.path.abspath('_themes'))
|
||||
# sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
|
||||
@ -34,7 +35,8 @@ author = 'StarlingX'
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'openstackdocstheme',
|
||||
# 'openstackdocstheme',
|
||||
'starlingxdocs_plus'
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
@ -65,11 +67,12 @@ exclude_patterns = []
|
||||
pygments_style = 'native'
|
||||
|
||||
# General information about the project.
|
||||
openstackdocs_repo_name = 'openstack/stx-docs'
|
||||
openstackdocs_project = 'StarlingX'
|
||||
openstackdocs_auto_name = False
|
||||
openstackdocs_bug_project = 'starlingx'
|
||||
openstackdocs_bug_tag = 'stx.docs'
|
||||
# Legacy openstackdocstheme variables
|
||||
# openstackdocs_repo_name = 'openstack/stx-docs'
|
||||
# openstackdocs_project = 'StarlingX'
|
||||
# openstackdocs_auto_name = False
|
||||
# openstackdocs_bug_project = 'starlingx'
|
||||
# openstackdocs_bug_tag = 'stx.docs'
|
||||
|
||||
|
||||
# Common substitution strings such as organization, product
|
||||
@ -82,7 +85,8 @@ rst_prolog = open('./shared/strings.txt', 'r').read()
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
html_theme = 'starlingxdocs'
|
||||
html_theme_path = ['_themes']
|
||||
html_theme = 'starlingxdocs_plus'
|
||||
|
||||
# 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
|
||||
@ -165,3 +169,15 @@ texinfo_documents = [
|
||||
author, 'stx-docs', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# -- Options for starlingxdocs_plus theme output -----------------------------
|
||||
# General information about the project.
|
||||
|
||||
starlingxdocs_plus_repo_name = 'openstack/stx-docs'
|
||||
starlingxdocs_plus_project = 'StarlingX'
|
||||
starlingxdocs_plus_auto_name = False
|
||||
starlingxdocs_plus_bug_project = 'starlingx'
|
||||
starlingxdocs_plus_bug_tag = 'stx.docs'
|
||||
starlingxdocs_plus_this_version = "latest"
|
||||
# starlingxdocs_plus_other_versions = [("even later","even-later"),("sooner","sooner")]
|
||||
starlingxdocs_plus_other_versions = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user