Skip to content

Commit 33bffe2

Browse files
authored
Merge pull request #3567 from minijackson/docs-prefs-sphinx-domain
docs: create a Sphinx domain extension to document preference settings
2 parents 70db1cf + ff3dde5 commit 33bffe2

File tree

8 files changed

+890
-93
lines changed

8 files changed

+890
-93
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,5 @@ phoebus-product/settings_template.ini
123123

124124
# doc files generated by docs/source/conf.py
125125
docs/source/applications.rst
126-
docs/source/preference_properties.rst
127126
docs/source/services.rst
128127

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
"""Extension that creates a new Sphinx domain for documenting Phoebus' preference settings.
2+
3+
Sphinx domain: https://www.sphinx-doc.org/en/master/usage/domains/index.html
4+
Creating a Sphinx domain tutorial: https://www.sphinx-doc.org/en/master/development/tutorials/adding_domain.html
5+
"""
6+
7+
from pathlib import Path
8+
9+
from sphinx.application import Sphinx
10+
from sphinx.util.typing import ExtensionMetadata
11+
12+
from ._domain import PreferencesDomain
13+
from ._parsing import parse_all_properties_files
14+
15+
16+
def setup(app: Sphinx) -> ExtensionMetadata:
17+
app.add_config_value(
18+
"phoebus_root",
19+
(Path(app.confdir) / "../..").resolve(),
20+
"html",
21+
Path,
22+
)
23+
app.add_config_value(
24+
"phoebus_repository",
25+
"https://github.com/ControlSystemStudio/phoebus",
26+
"html",
27+
str,
28+
)
29+
30+
app.add_domain(PreferencesDomain)
31+
app.connect("config-inited", parse_all_properties_files)
32+
33+
return {
34+
"version": "0.1",
35+
"parallel_read_safe": True,
36+
"parallel_write_safe": True,
37+
}

0 commit comments

Comments
 (0)