Browse Source

doc: update 1.9 release with RTD theme

We've replaced the "zephyr-docs" theme with a simpler read-the-docs
theme starting with the 1.13 release. This PR retrofits the theme
changes back onto this 1.9 release and ignores attempts to use the
zephyr-docs theme controlled by the make DOC_TAGS option.

Also needed to backport changes to the warning filtering system
implemented in later releases, fixes to how the config options were
generated (genrest.py).

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
v1.9-branch
David B. Kinder 7 years ago committed by Anas Nashif
parent
commit
727f92c5d5
  1. 6
      .known-issues/doc/duplicate.conf
  2. 4
      .known-issues/doc/networking.conf
  3. 3
      boards/xtensa/esp32/doc/esp32.rst
  4. 5
      doc/Makefile
  5. 14
      doc/_templates/breadcrumbs.html
  6. 10
      doc/_templates/layout.html
  7. 28
      doc/_templates/versions.html
  8. 40
      doc/conf.py
  9. BIN
      doc/images/Zephyr-Kite-logo.png
  10. BIN
      doc/images/zp_favicon.png
  11. 40
      doc/scripts/filter-doc-log.sh
  12. 2
      doc/scripts/genrest/genrest.py
  13. 147
      doc/static/zephyr-custom.css
  14. 6
      doc/static/zephyr-custom.js
  15. 17
      doc/zephyr.doxyfile
  16. 2
      scripts/filter-known-issues.py

6
.known-issues/doc/duplicate.conf

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
#
^(?P<filename>([-:\\/\w\.])+[/\\]doc[/\\]api[/\\]file_system.rst):(?P<lineno>[0-9]+): WARNING: Duplicate declaration.
#
^(?P<filename>([-:\\/\w\.])+[/\\]doc[/\\]api[/\\]io_interfaces.rst):(?P<lineno>[0-9]+): WARNING: Duplicate declaration.
#
^(?P<filename>([-:\\/\w\.])+[/\\]doc[/\\]subsystems[/\\]sensor.rst):(?P<lineno>[0-9]+): WARNING: Duplicate declaration.

4
.known-issues/doc/networking.conf

@ -20,12 +20,12 @@ @@ -20,12 +20,12 @@
# include/net/net_if.h warnings
#
^(?P<filename>[-._/\w]+/doc/api/networking.rst):(?P<lineno>[0-9]+): WARNING: Error when parsing function declaration.
^\If the function has no return type:
^If the function has no return type:
^[ \t]*Error in declarator or parameters and qualifiers
^[ \t]*Invalid definition: Expected identifier in nested name, got keyword: struct \[error at [0-9]+]
^.*struct net_if __aligned\(32\)
^[- \t]*\^
^\If the function has a return type:
^If the function has a return type:
^[ \t]*Error in declarator or parameters and qualifiers
^[ \t]*If pointer to member declarator:
^[ \t]*Invalid definition: Expected \'::\' in pointer to member \(function\). \[error at [0-9]+]

3
boards/xtensa/esp32/doc/esp32.rst

@ -15,7 +15,7 @@ From Wikipedia: @@ -15,7 +15,7 @@ From Wikipedia:
Tensilica Xtensa LX6 microprocessor in both dual-core and single-core
variations. ESP32 is created and developed by Espressif Systems, a
Shanghai-based Chinese company, and is manufactured by TSMC using their 40nm
process. [1]_
process..
The features include the following:
@ -171,7 +171,6 @@ for ESP32`_. @@ -171,7 +171,6 @@ for ESP32`_.
References
**********
.. [1] https://en.wikipedia.org/wiki/ESP32
.. _`ESP32 Technical Reference Manual`: https://espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf
.. _`JTAG debugging for ESP32`: https://espressif.com/sites/default/files/documentation/jtag_debugging_for_esp32_en.pdf
.. _`toolchain`: https://esp-idf.readthedocs.io/en/latest/get-started/index.html#get-started-setup-toochain

5
doc/Makefile

@ -66,6 +66,8 @@ clean: @@ -66,6 +66,8 @@ clean:
@rm -rf reference/kconfig/*.rst
@rm -rf samples
@rm -rf boards
@rm -f doc.log
@rm -f doc.warnings
htmldocs: doxy html
@ -79,7 +81,8 @@ kconfig: scripts/genrest/genrest.py @@ -79,7 +81,8 @@ kconfig: scripts/genrest/genrest.py
prep: doxy content kconfig
html: content kconfig
$(Q)$(SPHINXBUILD) -t $(DOC_TAG) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
$(Q)$(SPHINXBUILD) -t $(DOC_TAG) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 2>&1 | tee -a doc.log;
$(Q)./scripts/filter-doc-log.sh doc.log
@rm -rf samples
@rm -rf boards

14
doc/_templates/breadcrumbs.html vendored

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
{% extends "!breadcrumbs.html" %}
{% block breadcrumbs %}
<!-- {{ docs_title }} -->
{# parameterize default name "Docs" in breadcrumb via docs_title in conf.py #}
{% if not docs_title %}
{% set docs_title = "Docs" %}
{% endif %}
<li><a href="{{ pathto(master_doc) }}">{{ docs_title }}</a> &raquo;</li>
{% for doc in parents %}
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li>
{% endfor %}
<li>{{ title }}</li>
{% endblock %}

10
doc/_templates/layout.html vendored

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
{% extends "!layout.html" %}
{% block document %}
{% if is_release %}
<div class="wy-alert wy-alert-danger">
The <a href="/{{ pagename }}.html">latest development version</a>
of this page may be more current than this released {{ version }} version.
</div>
{% endif %}
{{ super() }}
{% endblock %}

28
doc/_templates/versions.html vendored

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
{# Add rst-badge after rst-versions for small badge style. #}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> Zephyr Project</span>
v: {{ current_version }}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
<dl>
<dt>{{ _('Versions') }}</dt>
{% for slug, url in versions %}
<dd><a href="{{ url }}">{{ slug }}</a></dd>
{% endfor %}
</dl>
<dl>
<dt>{{ _('On zephyrproject.org') }}</dt>
<dd>
<a href="https://www.zephyrproject.org/">Project Home</a>
</dd>
<dd>
<a href="https://www.zephyrproject.org/developers/#downloads">Downloads</a>
</dd>
<dd>
<a href="https://github.com/zephyrproject-rtos/zephyr/releases">Releases</a>
</dd>
</dl>
</div>
</div>

40
doc/conf.py

@ -143,19 +143,9 @@ rst_epilog = """ @@ -143,19 +143,9 @@ rst_epilog = """
# -- Options for HTML output ----------------------------------------------
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()]
if tags.has('daily') or tags.has('release'):
html_theme = 'zephyr-docs-theme'
html_theme_path = ['./themes']
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
if tags.has('release'):
is_release = True
@ -177,12 +167,12 @@ html_title = "Zephyr Project Documentation" @@ -177,12 +167,12 @@ html_title = "Zephyr Project Documentation"
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
html_logo = 'images/Zephyr-Kite-logo.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
# pixels large.
#html_favicon = None
html_favicon = 'images/zp_favicon.png'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
@ -219,7 +209,7 @@ html_use_index = True @@ -219,7 +209,7 @@ html_use_index = True
html_split_index = True
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink =
html_show_sourcelink = False
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
html_show_sphinx = False
@ -344,11 +334,28 @@ breathe_projects = { @@ -344,11 +334,28 @@ breathe_projects = {
}
breathe_default_project = "Zephyr"
# Qualifiers to a function are causing Sphihx/Breathe to warn about
# Error when parsing function declaration and more. This is a list
# of strings that the parser additionally should accept as
# attributes.
cpp_id_attributes = ['__syscall', '__syscall_inline', '__deprecated',
'__may_alias', '__used', '__unused', '__weak',
'__DEPRECATED_MACRO', 'FUNC_NORETURN' ]
# 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,
'theme_logo_only': False,
'current_version': version,
'versions': ( ("latest", "/"),
("1.12.0", "/1.12.0/"),
("1.11.0", "/1.11.0/"),
("1.10.0", "/1.10.0/"),
("1.9.2", "/1.9.0/"),
)
}
extlinks = {'jira': ('https://jira.zephyrproject.org/browse/%s', '')}
@ -367,3 +374,4 @@ linkcheck_anchors = False @@ -367,3 +374,4 @@ linkcheck_anchors = False
def setup(app):
app.add_stylesheet("zephyr-custom.css")
app.add_javascript("zephyr-custom.js")

BIN
doc/images/Zephyr-Kite-logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
doc/images/zp_favicon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

40
doc/scripts/filter-doc-log.sh

@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
#!/bin/bash
# run the filter-known-issues.py script to remove "expected" warning
# messages from the output of the document build process and write
# the filtered output to stdout
#
# Only argument is the name of the log file saved by the build.
KI_SCRIPT=${ZEPHYR_BASE}/scripts/filter-known-issues.py
CONFIG_DIR=${ZEPHYR_BASE}/.known-issues/doc
LOG_FILE=$1
red='\E[31m'
green='\e[32m'
if [ -z "${LOG_FILE}" ]; then
echo "Error in $0: missing input parameter <logfile>"
exit 1
fi
if [ -s "${LOG_FILE}" ]; then
$KI_SCRIPT --config-dir ${CONFIG_DIR} ${LOG_FILE} > doc.warnings 2>&1
if [ -s doc.warnings ]; then
echo
echo -e "${red}New errors/warnings found, please fix them:"
echo -e "=============================================="
tput sgr0
echo
cat doc.warnings
echo
else
echo -e "${green}No new errors/warnings."
tput sgr0
fi
else
echo "Error in $0: logfile \"${LOG_FILE}\" not found."
exit 1
fi

2
doc/scripts/genrest/genrest.py

@ -47,7 +47,7 @@ def print_items(items, outdir, indent): @@ -47,7 +47,7 @@ def print_items(items, outdir, indent):
config = open("%s/%s.rst" % (outdir, var), "w")
config.write(":orphan:\n\n")
config.write(".. title:: %s\n\n" %item.get_name())
config.write(".. option:: CONFIG_%s:\n" %item.get_name())
config.write(".. option:: CONFIG_%s\n" %item.get_name())
config.write(".. _CONFIG_%s:\n" %item.get_name())
if text:
config.write("\n%s\n\n" %text)

147
doc/static/zephyr-custom.css vendored

@ -1,4 +1,103 @@ @@ -1,4 +1,103 @@
/* -- Extra CSS styles for Zephyr content ----------------------------------- */
/* -- Extra CSS styles for Zephyr content (RTD theme) ----------------------- */
/* make the page width fill the window */
.wy-nav-content {
max-width: none;
}
/* pygments tweak for white-on-black console */
/* hold off on this change for now
.highlight-console .highlight {
background-color: black;
}
.highlight-console .highlight .go, .highlight-console .highlight .gp {
color: white;
}
.highlight-console .highlight .hll {
background-color: white;
}
.highlight-console .highlight .hll .go, .highlight-console .highlight .hll .gp {
color: black;
font-weight: bold;
}
*/
/* tweak doc version selection
.rst-versions {
position: static;
border-top: none;
padding: 0px;
}
*/
.rst-versions .rst-current-version {
padding: 5px;
background-color: #2980B9;
color: #80FF80;
}
.rst-versions .rst-other-versions {
padding: 5px;
}
div.rst-other-versions dl {
margin-bottom: 0;
}
/* 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;
}
/* decrease line leading a bit, 24px is too wide */
p {
line-height: 22px;
}
/* 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 {
@ -9,3 +108,49 @@ table.hlist { @@ -9,3 +108,49 @@ table.hlist {
th,td {
white-space: normal !important;
}
/* dbk 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; /* dbk for API sub-headings */
font-size: 1.25rem;
font-weight: bold;
margin-bottom: 12px;
}
.rst-content div.breathe-sectiondef {
padding-left: 0 !important;
}
/* tweak display of option tables to make first column wider */
col.option {
width: 25%;
}
/* tweak format for <kbd> (:kbd:`F10`) */
kbd
{
-moz-border-radius:3px;
-moz-box-shadow:0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;
-webkit-border-radius:3px;
-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;
background-color:#f7f7f7;
border:1px solid #ccc;
border-radius:3px;
box-shadow:0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;
color:#333;
display:inline-block;
font-family:Arial,Helvetica,sans-serif;
font-size:11px;
line-height:1.4;
margin:0 .1em;
padding:.1em .6em;
text-shadow:0 1px 0 #fff;
}

6
doc/static/zephyr-custom.js vendored

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
/* tweak logo link to the project home page in a new tab*/
$(document).ready(function(){
$( ".icon-home" ).attr("href", "https://zephyrproject.org/");
$( ".icon-home" ).attr("target", "_blank");
});

17
doc/zephyr.doxyfile

@ -116,7 +116,11 @@ RECURSIVE = YES @@ -116,7 +116,11 @@ RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS =
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
# Hide internal names (starting with an underscore, and doxygen-generated names
# for nested unnamed unions that don't generate meaningful sphinx output anyway.
EXCLUDE_SYMBOLS = _* *.__unnamed__
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = YES
@ -279,9 +283,14 @@ PREDEFINED = "CONFIG_SYS_CLOCK_EXISTS=y" \ @@ -279,9 +283,14 @@ PREDEFINED = "CONFIG_SYS_CLOCK_EXISTS=y" \
"CONFIG_DEVICE_POWER_MANAGEMENT=y" \
"CONFIG_BT_SMP=y" \
"CONFIG_BT_BREDR=y" \
"__deprecated=" \
"__printf_like(x, y)=" \
"__attribute(x)__="
"NET_MGMT_DEFINE_REQUEST_HANDLER(x)=" \
"__deprecated=" \
"__packed=" \
"__aligned(x)=" \
"__printf_like(x, y)=" \
"__attribute__(x)=" \
"__syscall=" \
"__syscall_inline="
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = NO
#---------------------------------------------------------------------------

2
scripts/filter-known-issues.py

@ -185,6 +185,8 @@ def report_warning(data): @@ -185,6 +185,8 @@ def report_warning(data):
warnings.write(data)
for filename in args.FILENAMEs:
if os.stat(filename).st_size == 0:
continue # skip empty log files
try:
with open(filename, "r+b") as f:
logging.info("%s: filtering", filename)

Loading…
Cancel
Save