Skip to content

Commit 357acf0

Browse files
author
Felix Exner
committed
Add sphinx-build directives for this repo
1 parent ccc13a8 commit 357acf0

File tree

4 files changed

+224
-5
lines changed

4 files changed

+224
-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: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
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 = ["_build", "Thumbs.db", ".DS_Store",
76+
"**/CHANGELOG.rst", "**/README.rst",
77+
"**/.work", # act temp files
78+
"**/LICENSE.rst",
79+
"venv", # local virtualenv
80+
]
81+
82+
# The name of the Pygments (syntax highlighting) style to use.
83+
pygments_style = None
84+
85+
86+
# -- Options for HTML output -------------------------------------------------
87+
88+
# The theme to use for HTML and HTML Help pages. See the documentation for
89+
# a list of builtin themes.
90+
#
91+
html_theme = "sphinx_rtd_theme"
92+
93+
# Theme options are theme-specific and customize the look and feel of a theme
94+
# further. For a list of options available for each theme, see the
95+
# documentation.
96+
#
97+
# html_theme_options = {}
98+
99+
# Add any paths that contain custom static files (such as style sheets) here,
100+
# relative to this directory. They are copied after the builtin static files,
101+
# so a file named "default.css" will overwrite the builtin "default.css".
102+
# html_static_path = ["_static"]
103+
104+
# Custom sidebar templates, must be a dictionary that maps document names
105+
# to template names.
106+
#
107+
# The default sidebars (for documents that don't match any pattern) are
108+
# defined by theme itself. Builtin themes are using these templates by
109+
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
110+
# 'searchbox.html']``.
111+
#
112+
# html_sidebars = {}
113+
114+
115+
# -- Options for HTMLHelp output ---------------------------------------------
116+
117+
# Output file base name for HTML help builder.
118+
htmlhelp_basename = "ur_documentationdoc"
119+
120+
121+
# -- Options for LaTeX output ------------------------------------------------
122+
123+
latex_elements = {
124+
# The paper size ('letterpaper' or 'a4paper').
125+
#
126+
# 'papersize': 'letterpaper',
127+
# The font size ('10pt', '11pt' or '12pt').
128+
#
129+
# 'pointsize': '10pt',
130+
# Additional stuff for the LaTeX preamble.
131+
#
132+
# 'preamble': '',
133+
# Latex figure (float) alignment
134+
#
135+
# 'figure_align': 'htbp',
136+
}
137+
138+
# Grouping the document tree into LaTeX files. List of tuples
139+
# (source start file, target name, title,
140+
# author, documentclass [howto, manual, or own class]).
141+
latex_documents = [
142+
(
143+
master_doc,
144+
"ur_tutorials.tex",
145+
"ur\\_tutorials Documentation",
146+
"Felix Exner",
147+
"manual",
148+
),
149+
]
150+
151+
152+
# -- Options for manual page output ------------------------------------------
153+
154+
# One entry per manual page. List of tuples
155+
# (source start file, name, description, authors, manual section).
156+
man_pages = [(master_doc, "ur_tutorials", "ur_tutorials Documentation", [author], 1)]
157+
158+
159+
# -- Options for Texinfo output ----------------------------------------------
160+
161+
# Grouping the document tree into Texinfo files. List of tuples
162+
# (source start file, target name, title, author,
163+
# dir menu entry, description, category)
164+
texinfo_documents = [
165+
(
166+
master_doc,
167+
"ur_tutorials",
168+
"ur_tutorials Documentation",
169+
author,
170+
"ur_tutorials",
171+
"Tutorials around Universal Robot's ROS 2 packages",
172+
"ROS 2",
173+
),
174+
]
175+
176+
177+
# -- Options for Epub output -------------------------------------------------
178+
179+
# Bibliographic Dublin Core info.
180+
epub_title = project
181+
182+
# The unique identifier of the text. This can be a ISBN number
183+
# or the project homepage.
184+
#
185+
# epub_identifier = ''
186+
187+
# A unique identification for the text.
188+
#
189+
# epub_uid = ''
190+
191+
# A list of files that should not be packed into the epub file.
192+
epub_exclude_files = ["search.html"]
193+
194+
195+
# -- Extension configuration -------------------------------------------------
196+
copybutton_exclude = '.linenos, .gp, .go'
197+
198+
# -- Options for todo extension ----------------------------------------------
199+
200+
# If true, `todo` and `todoList` produce output, else they produce nothing.
201+
todo_include_todos = True
202+
203+
html_context = {
204+
"display_github": True,
205+
"github_user": "UniversalRobots",
206+
"github_repo": "Universal_Robots_ROS2_Tutorials",
207+
"github_version": repos_file_branch + "/",
208+
"conf_py_path": "/",
209+
"source_suffix": source_suffix,
210+
}
211+
212+
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)