Compare commits

...

6 Commits

Author SHA1 Message Date
Anas Nashif
77908ed995 doc: read version from Makefile
Change-Id: I6edb5ee53cdff1c687e97663c93ddaa3b09a9288
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-19 10:06:21 -05:00
Anas Nashif
1d6259edc9 doc: add a new template variable
Signify if the documentation is for a release or if it is the
development version from master.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-19 09:59:15 -05:00
Anas Nashif
12784125b9 doc: support official website theme
Jira: ZEP-1512
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-19 21:25:00 -04:00
Anas Nashif
bc038e5e78 doc: use ReadTheDocs.org theme if available
Instead of including the rtd theme in zephyr use an installed instance,
if nothing is installed, use the default zephyr theme.

Change-Id: Ife4bd878e3f879cf59ecf2bc5d186a531a3bf1b6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-19 21:25:00 -04:00
Anas Nashif
68cf168798 doc: do not put version in breadcrumbs for daily docs
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-19 21:25:00 -04:00
David B. Kinder
69bddff823 doc: identify release version in generated docs
It's not obvious which kernel release version you're reading about in the
documentation.  Add the version info in the breadcrumb header (instead
of "Home / Docs / Subsystems /" show as
"Home / Docs / 1.8 / Subsystems /").

(Depends on docs-theme PR-9, but can be merged now with no ill-effect)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-05-19 21:25:00 -04:00
2 changed files with 49 additions and 21 deletions

View File

@@ -52,14 +52,32 @@ project = u'Zephyr Project'
copyright = u'2015, Intel Corporation, Wind River Systems, Inc'
author = u'many'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = os.getenv('KERNELVERSION','0.1.0')
# The full version, including alpha/beta/rc tags.
release = os.getenv('KERNELVERSION','0.1.0')
# The following code tries to extract the information by reading the Makefile,
# when Sphinx is run directly (e.g. by Read the Docs).
try:
makefile_version_major = None
makefile_version_minor = None
makefile_patchlevel = None
for line in open('../Makefile'):
key, val = [x.strip() for x in line.split('=', 2)]
if key == 'VERSION_MAJOR':
makefile_version_major = val
if key == 'VERSION_MINOR':
makefile_version_minor = val
elif key == 'PATCHLEVEL':
makefile_patchlevel = val
if makefile_version_major and makefile_version_minor and makefile_patchlevel:
break
except:
pass
finally:
if makefile_version_major and makefile_version_minor and makefile_patchlevel:
version = release = makefile_version_major + '.' + makefile_version_minor + '.' + makefile_patchlevel
else:
sys.stderr.write('Warning: Could not extract kernel version\n')
version = release = "unknown version"
version = release = os.getenv('KERNELVERSION','0.1.0')
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -112,18 +130,25 @@ rst_epilog = """
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#html_theme = 'alabaster'
html_theme = 'zephyr'
try:
import sphinx_rtd_theme
except ImportError:
html_theme = 'zephyr'
html_theme_path = ['./themes']
else:
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# 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 = {}
if tags.has('daily') or tags.has('release'):
html_theme = 'zephyr-docs-theme'
html_theme_path = ['./themes']
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ['./themes']
if tags.has('release'):
is_release = True
docs_title = 'Docs / %s' %(version)
else:
is_release = False
docs_title = 'Docs'
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
@@ -186,7 +211,7 @@ html_split_index = True
html_show_sphinx = False
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
html_show_copyright = True
html_show_copyright = tags.has('development')
# If true, license is shown in the HTML footer. Default is True.
html_show_license = True
@@ -303,6 +328,9 @@ breathe_projects = {
}
breathe_default_project = "Zephyr"
# docs_title is used in the breadcrumb title in the zephyr docs theme
html_context = {
'show_license': html_show_license,
'docs_title': docs_title,
'is_release': is_release,
}

View File

@@ -11,10 +11,10 @@ Zephyr Project Documentation
Documentation for the development branch of Zephyr can be found at
https://www.zephyrproject.org/doc/
.. only:: development
.. only:: (development or daily)
Welcome to the Zephyr Project's documentation. This is the documentation of the
master tree under development.
master tree under development (version |version|).
Documentation for released versions of Zephyr can be found at
``https://www.zephyrproject.org/doc/<version>``. The following documentation