Skip to content

Commit caefc55

Browse files
author
Felix Exner (fexner)
authored
Add sphinx-build directives for this repo (#7)
* Add sphinx-build directives for this repo * conf.py formatting
1 parent 332717f commit caefc55

File tree

4 files changed

+228
-5
lines changed

4 files changed

+228
-5
lines changed

.github/workflows/sphinx.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
---
22
name: "Pull Request Docs Check"
3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
48

59
jobs:
610
docs:
@@ -10,13 +14,13 @@ jobs:
1014
uses: actions/checkout@v4
1115
- uses: actions/setup-python@v5
1216
with:
13-
python-version: '3.10'
17+
python-version: '3.12'
1418
cache: 'pip'
1519
- name: Install Python dependencies
1620
run: |
1721
python -m pip install --upgrade pip
18-
pip install --upgrade --requirement ur_documentation/requirements.txt
22+
pip install --upgrade --requirement requirements.txt
1923
shell: bash
2024
- name: Build documentation using sphinx
2125
run: |
22-
TZ=UTC sphinx-build ur_documentation/docs/source _build
26+
TZ=UTC sphinx-build --fail-on-warning --keep-going . _build

conf.py

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Configuration file for the Sphinx documentation builder.
4+
#
5+
# This file does only contain a selection of the most common options. For a
6+
# full list see the documentation:
7+
# http://www.sphinx-doc.org/en/master/config
8+
9+
# -- Path setup --------------------------------------------------------------
10+
11+
# If extensions (or modules to document with autodoc) are in another directory,
12+
# add these directories to sys.path here. If the directory is relative to the
13+
# documentation root, use os.path.abspath to make it absolute, like shown here.
14+
#
15+
# import os
16+
# import sys
17+
# sys.path.insert(0, os.path.abspath('.'))
18+
19+
20+
# -- Project information -----------------------------------------------------
21+
22+
project = "Universal Robots ROS 2 Tutorials"
23+
copyright = "2024, Universal Robots A/S"
24+
author = "Felix Exner"
25+
26+
# The short X.Y version
27+
version = ""
28+
# The full version, including alpha/beta/rc tags
29+
release = "0.1"
30+
31+
32+
# -- General configuration ---------------------------------------------------
33+
34+
# If your documentation needs a minimal Sphinx version, state it here.
35+
#
36+
# needs_sphinx = '1.0'
37+
38+
# Add any Sphinx extension module names here, as strings. They can be
39+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
40+
# ones.
41+
extensions = [
42+
"sphinx_copybutton",
43+
"sphinx.ext.githubpages",
44+
"sphinx.ext.todo",
45+
"sphinx_rtd_theme",
46+
]
47+
48+
# Add any paths that contain templates here, relative to this directory.
49+
# templates_path = ["_templates"]
50+
51+
# The suffix(es) of source filenames.
52+
# You can specify multiple suffix as a list of string:
53+
#
54+
source_suffix = ".rst"
55+
56+
# The master toctree document.
57+
master_doc = "tutorial_index"
58+
numfig = True
59+
60+
ros_distro = "rolling"
61+
distro_title = "Rolling"
62+
distro_title_full = "Rolling Ridley"
63+
repos_file_branch = "main"
64+
65+
# The language for content autogenerated by Sphinx. Refer to documentation
66+
# for a list of supported languages.
67+
#
68+
# This is also used if you do content translation via gettext catalogs.
69+
# Usually you set "language" from the command line for these cases.
70+
language = "en"
71+
72+
# List of patterns, relative to source directory, that match files and
73+
# directories to ignore when looking for source files.
74+
# This pattern also affects html_static_path and html_extra_path.
75+
exclude_patterns = [
76+
"_build",
77+
"Thumbs.db",
78+
".DS_Store",
79+
"**/CHANGELOG.rst",
80+
"**/README.rst",
81+
"**/.work", # act temp files
82+
"**/LICENSE.rst",
83+
"venv", # local virtualenv
84+
]
85+
86+
# The name of the Pygments (syntax highlighting) style to use.
87+
pygments_style = None
88+
89+
90+
# -- Options for HTML output -------------------------------------------------
91+
92+
# The theme to use for HTML and HTML Help pages. See the documentation for
93+
# a list of builtin themes.
94+
#
95+
html_theme = "sphinx_rtd_theme"
96+
97+
# Theme options are theme-specific and customize the look and feel of a theme
98+
# further. For a list of options available for each theme, see the
99+
# documentation.
100+
#
101+
# html_theme_options = {}
102+
103+
# Add any paths that contain custom static files (such as style sheets) here,
104+
# relative to this directory. They are copied after the builtin static files,
105+
# so a file named "default.css" will overwrite the builtin "default.css".
106+
# html_static_path = ["_static"]
107+
108+
# Custom sidebar templates, must be a dictionary that maps document names
109+
# to template names.
110+
#
111+
# The default sidebars (for documents that don't match any pattern) are
112+
# defined by theme itself. Builtin themes are using these templates by
113+
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
114+
# 'searchbox.html']``.
115+
#
116+
# html_sidebars = {}
117+
118+
119+
# -- Options for HTMLHelp output ---------------------------------------------
120+
121+
# Output file base name for HTML help builder.
122+
htmlhelp_basename = "ur_documentationdoc"
123+
124+
125+
# -- Options for LaTeX output ------------------------------------------------
126+
127+
latex_elements = {
128+
# The paper size ('letterpaper' or 'a4paper').
129+
#
130+
# 'papersize': 'letterpaper',
131+
# The font size ('10pt', '11pt' or '12pt').
132+
#
133+
# 'pointsize': '10pt',
134+
# Additional stuff for the LaTeX preamble.
135+
#
136+
# 'preamble': '',
137+
# Latex figure (float) alignment
138+
#
139+
# 'figure_align': 'htbp',
140+
}
141+
142+
# Grouping the document tree into LaTeX files. List of tuples
143+
# (source start file, target name, title,
144+
# author, documentclass [howto, manual, or own class]).
145+
latex_documents = [
146+
(
147+
master_doc,
148+
"ur_tutorials.tex",
149+
"ur\\_tutorials Documentation",
150+
"Felix Exner",
151+
"manual",
152+
),
153+
]
154+
155+
156+
# -- Options for manual page output ------------------------------------------
157+
158+
# One entry per manual page. List of tuples
159+
# (source start file, name, description, authors, manual section).
160+
man_pages = [(master_doc, "ur_tutorials", "ur_tutorials Documentation", [author], 1)]
161+
162+
163+
# -- Options for Texinfo output ----------------------------------------------
164+
165+
# Grouping the document tree into Texinfo files. List of tuples
166+
# (source start file, target name, title, author,
167+
# dir menu entry, description, category)
168+
texinfo_documents = [
169+
(
170+
master_doc,
171+
"ur_tutorials",
172+
"ur_tutorials Documentation",
173+
author,
174+
"ur_tutorials",
175+
"Tutorials around Universal Robot's ROS 2 packages",
176+
"ROS 2",
177+
),
178+
]
179+
180+
181+
# -- Options for Epub output -------------------------------------------------
182+
183+
# Bibliographic Dublin Core info.
184+
epub_title = project
185+
186+
# The unique identifier of the text. This can be a ISBN number
187+
# or the project homepage.
188+
#
189+
# epub_identifier = ''
190+
191+
# A unique identification for the text.
192+
#
193+
# epub_uid = ''
194+
195+
# A list of files that should not be packed into the epub file.
196+
epub_exclude_files = ["search.html"]
197+
198+
199+
# -- Extension configuration -------------------------------------------------
200+
copybutton_exclude = ".linenos, .gp, .go"
201+
202+
# -- Options for todo extension ----------------------------------------------
203+
204+
# If true, `todo` and `todoList` produce output, else they produce nothing.
205+
todo_include_todos = True
206+
207+
html_context = {
208+
"display_github": True,
209+
"github_user": "UniversalRobots",
210+
"github_repo": "Universal_Robots_ROS2_Tutorials",
211+
"github_version": repos_file_branch + "/",
212+
"conf_py_path": "/",
213+
"source_suffix": source_suffix,
214+
}
215+
216+
github_url = "https://github.com/UniversalRobots/Universal_Robots_ROS2_Tutorials"

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sphinx
2+
sphinx_rtd_theme
3+
sphinx-copybutton

doc/tutorial_index.rst renamed to tutorial_index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ Example tutorials
1111
.. toctree::
1212
:titlesonly:
1313

14-
../my_robot_cell/doc/index.rst
14+
my_robot_cell/doc/index.rst

0 commit comments

Comments
 (0)