Newer
Older
# BeagleBoard.org documentation build configuration file.
#
# References:
# https://github.com/zephyrproject-rtos/zephyr/blob/main/doc/conf.py
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import os
import sys
import re
from sphinx.ext.imgconverter import ImagemagickConverter
ImagemagickConverter.conversion_rules.append(('image/webp', 'image/png'))
rst_epilog =""
# Add latest images to rst_epilog
with open('latest.images') as f:
rst_epilog += f.read()
sys.path.append(os.path.abspath("./_ext"))
"sphinx_design",
"sphinxcontrib.images",
"sphinx.ext.graphviz",
#graphviz_output_format = 'svg'
breathe_projects = {"librobotcontrol": "projects/librobotcontrol/docs/xml"}
breathe_default_project = "librobotcontrol"
"containmentFolder": "./projects/librobotcontrol",
"rootFileName": "index.rst",
"rootFileTitle": "Robot Control Library",
"createTreeView": True,
"exhaleExecutesDoxygen": False,
"doxygenStripFromPath": ".",
"verboseBuild": False,
}
primary_domain = 'cpp'
highlight_language = 'cpp'
# Update (HTML) supported_image_types selection priority order
from sphinx.builders.html import StandaloneHTMLBuilder
StandaloneHTMLBuilder.supported_image_types = ['image/webp', 'image/jpg',
'image/jpeg', 'image/svg+xml', 'image/png', 'image/gif']
# Update (PDF) supported_image_types selection priority order
from sphinx.builders.latex import LaTeXBuilder
LaTeXBuilder.supported_image_types = ['application/pdf', 'image/jpg', 'image/jpeg', 'image/png']
numfig = True
navigation_with_keys = True
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'env', ".venv"]
html_logo = "_static/images/logo.svg"
html_favicon = "_static/images/boris.svg"
html_sourcelink_suffix = ""
html_last_updated_fmt = ""
html_static_path = ["_static"]
# html_last_updated_fmt = "%b %d, %Y"
html_domain_indices = False
html_split_index = True
html_baseurl = "docs.beagleboard.io"
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
html_css_files = [
'css/custom.css',
]
html_sidebars = {
}
html_theme_options = {
# "header_links_before_dropdown": 4,
"show_prev_next": True,
"icon_links": [
{
"name": "OpenBeagle",
"url": "https://openbeagle.org/",
"icon": "fa-brands fa-gitlab",
"attributes": {"target": "_blank"},
},
{
"name": "Docs",
"url": "https://docs.beagleboard.org/",
"icon": "fa-solid fa-book",
"attributes": {"target": "_blank"},
},
{
"name": "Discord",
"url": "https://bbb.io/gsocchat",
"icon": "fa-brands fa-discord",
"attributes": {"target": "_blank"},
},
{
"name": "Forum",
"url": "https://bbb.io/gsocml",
"icon": "fa-brands fa-discourse",
"attributes": {"target": "_blank"},
},
{
"name": "BeagleBoard.org",
"url": "https://www.beagleboard.org",
"icon": "_static/images/boris.svg",
"type": "local",
"attributes": {"target": "_blank"},
}
],
"use_edit_page_button": True,
"show_toc_level": 1,
"navbar_align": "right",
"show_nav_level": 2,
"announcement": "Welcome to the new site for BeagleBoard.org GSoC 2024 projects!",
# "show_version_warning_banner": True,
"navbar_center": ["navbar-nav"],
"navbar_start": ["navbar-logo"],
"navbar_end": ["theme-switcher", "navbar-icon-links"],
# "navbar_persistent": ["search-button"],
"footer_start": ["copyright"],
"footer_end": ["last-updated"],
# "content_footer_items": ["last-updated"],
"secondary_sidebar_items": {
},
}
m = re.match(
(
r"^VERSION_MAJOR\s*=\s*(\d+)$\n"
+ r"^VERSION_MINOR\s*=\s*(\d+)$\n"
+ r"^PATCHLEVEL\s*=\s*(\d+)$\n"
+ r"^VERSION_TWEAK\s*=\s*\d+$\n"
+ r"^EXTRAVERSION\s*=\s*(.*)$"
),
f.read(),
re.MULTILINE,
)
if not m:
sys.stderr.write("Warning: Could not extract docs version\n")
version = "Unknown"
else:
major, minor, patch, extra = m.groups(1)
version = ".".join((major, minor, patch))
release_version = ".".join((major, minor))
# Variables here holds default settings
pages_slug = "latest"
gitlab_user = "docs"
gitlab_version = "main"
gitlab_host = "git.beagleboard.org"
gitlab_repo = "docs.beagleboard.io"
docs_url = "https://docs.beagleboard.io/latest/"
m = re.match(
(
r"^PAGES_URL\s*=\s*(\S+)$\n"
+ r"^PAGES_SLUG\s*=\s*(\S+)$\n"
+ r"^GITLAB_USER\s*=\s*(\S+)$\n"
+ r"^PROJECT_BRANCH\s*=\s*(\S+)$\n"
+ r"^GITLAB_HOST\s*=\s*(\S+)$\n"
+ r"^PROJECT_REPO\s*=\s*(\S+)$\n"
),
f.read(),
re.MULTILINE,
)
if not m:
sys.stderr.write("Warning: Could not extract pages information\n")
else:
url, slug, user, branch, host, repo = m.groups(1)
gitlab_user = user
gitlab_version = branch
gitlab_host = host
gitlab_repo = repo
"gitlab_host": gitlab_host,
"gitlab_user": gitlab_user,
"gitlab_repo": gitlab_repo,
"gitlab_version": gitlab_version,
"pages_url": pages_url,
"pages_slug": pages_slug,
"docs_url": docs_url,
"reference_links": {
"About": "https://beagleboard.org/about",
"Donate": "https://beagleboard.org/donate",
"FAQ": "https://forum.beagleboard.org/c/faq"
latex_elements = {
"papersize": "a4paper",
"maketitle": open("_static/latex/title.tex").read(),
"preamble": open("_static/latex/preamble.tex").read(),
"sphinxsetup": ",".join(
(
"verbatimwithframe=false",
"VerbatimColor={HTML}{f0f2f4}",
"InnerLinkColor={HTML}{2980b9}",
"warningBgColor={HTML}{e9a499}",
"warningborder=0pt",
r"HeaderFamily=\rmfamily\bfseries",
)
),
}
("index-tex", "beagleboard-docs.tex", "BeagleBoard Docs", author, "manual"),
#language = 'en'
#locales_dir = ['locale/']
#gettext_compact = True