Skip to content

Commit 77acc09

Browse files
authored
Merge pull request #3623 from ControlSystemStudio/markdown-properties-docs
Markdown properties docs
2 parents 071dff8 + b6e6362 commit 77acc09

File tree

9 files changed

+2824
-99
lines changed

9 files changed

+2824
-99
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,9 @@ phoebus-product/settings_template.ini
125125
docs/source/applications.rst
126126
docs/source/services.rst
127127

128+
# Ignore Sphinx extensions and build artifacts
129+
docs/source/_ext/**/__pycache__/
130+
docs/source/_ext/**/*.pyc
131+
132+
# Ignore pip installation metadata
133+
docs/phoebus_docs.egg-info/

.readthedocs.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ build:
88
# Build from the docs/ directory with Sphinx
99
sphinx:
1010
configuration: docs/source/conf.py
11+
builder: html
12+
fail_on_warning: false
1113

12-
# Explicitly set the version of Python and its requirements
14+
# Install Python dependencies from pyproject.toml in docs/
1315
python:
1416
install:
15-
- requirements: docs/source/requirements.txt
17+
- method: pip
18+
path: docs

docs/README.md

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,53 @@ Phoebus Documentation
33

44
Documentation for https://github.com/ControlSystemStudio/phoebus
55

6-
View latest snapshotData at https://control-system-studio.readthedocs.io
6+
View latest snapshot at https://control-system-studio.readthedocs.io
77

8-
You can build a local copy using a local installation of sphinx or with maven
8+
You can build a local copy using Pixi or a local installation of sphinx.
99

10-
Option 1.
11-
You need to install sphinx
12-
```
13-
# Standard way
14-
pip install Sphinx
10+
## Option 1: Using Pixi (Recommended)
1511

16-
# Some RedHat setups
17-
sudo yum install python-sphinx
18-
```
12+
Install [Pixi](https://pixi.sh) and run:
1913

20-
Then build the web version:
14+
```bash
15+
# Navigate to the docs directory
16+
cd docs
17+
18+
# Build the documentation
19+
pixi run build
20+
21+
# Or directly build HTML
22+
pixi run html
23+
24+
# Serve documentation locally
25+
pixi run serve
26+
27+
# Clean build artifacts
28+
pixi run clean
2129
```
22-
make clean html
30+
31+
The Pixi configuration is in `pyproject.toml` under the `[tool.pixi.*]` sections.
32+
33+
## Option 2: Using Sphinx directly
34+
35+
You need to install sphinx and its dependencies:
36+
37+
```bash
38+
# Navigate to the docs directory
39+
cd docs
40+
41+
# Install from pyproject.toml (installs all dependencies)
42+
pip install .
2343
```
2444

25-
Option 2.
45+
Alternatively, on some RedHat setups:
46+
```bash
47+
sudo yum install python-sphinx
2648
```
27-
mvn verify -P sphinx -N
49+
50+
Then build the web version:
51+
```bash
52+
make clean html
2853
```
2954

3055
The above creates a document tree starting with `build/html/index.html`.
@@ -43,7 +68,7 @@ git clone https://github.com/ControlSystemStudio/phoebus.git
4368
( cd phoebus/doc; make clean html )
4469
```
4570

46-
When then building the Phoebus UI product, it will incude the document tree
71+
When then building the Phoebus UI product, it will include the document tree
4772
as online help accessible via the `Help` menu.
4873

4974

@@ -68,7 +93,7 @@ Documentation Components
6893

6994
Additionally, the folders are also checked for `doc/images/` folders.
7095
Resources used by the `index.rst` files should be places in this folder to
71-
ensure they are available to sphinx to generate the documenation.
96+
ensure they are available to sphinx to generate the documentation.
7297

7398
3) Preference Descriptions
7499

@@ -93,7 +118,7 @@ Documentation Components
93118
4) Plain HTML
94119

95120
The content of all `../phoebus/**/doc/html` folders is copied into the
96-
henerated html output directory tree.
121+
generated html output directory tree.
97122

98123
This allows including existing HTML content "as is".
99124
An `index.rst` file in the corresponding phoebus module may then refer
@@ -114,6 +139,3 @@ Documentation Components
114139

115140
For technical details on how the document components are assembled,
116141
check `createAppIndex()` and `createPreferenceAppendix()` in `source/conf.py`.
117-
118-
119-

docs/pixi.lock

Lines changed: 2674 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/pyproject.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[project]
2+
name = "phoebus-docs"
3+
version = "0.1.0"
4+
description = "Phoebus documentation build environment"
5+
requires-python = ">=3.9"
6+
dependencies = [
7+
"sphinx>=8.2",
8+
"sphinx_rtd_theme>=3.0",
9+
"myst-parser>=4.0",
10+
"setuptools",
11+
]
12+
13+
[tool.pixi.workspace]
14+
channels = ["conda-forge"]
15+
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
16+
17+
[tool.pixi.dependencies]
18+
python = ">=3.9"
19+
20+
[tool.pixi.pypi-dependencies]
21+
phoebus-docs = { path = ".", editable = true }
22+
23+
[tool.pixi.tasks]
24+
clean = "sphinx-build -M clean source build"
25+
html = "sphinx-build -M html source build"
26+
build = { depends-on = ["html"] }
27+
serve = "python -m http.server 8000 --directory build/html"
28+
29+
[tool.pixi.feature.dev.dependencies]
30+
sphinx-autobuild = "*"
31+
32+
[tool.pixi.environments]
33+
dev = ["dev"]

docs/source/_ext/preferences_listing/_parsing.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Fetching properties files, parsing, and storing them."""
22

3+
import os
34
from dataclasses import dataclass
45
from pathlib import Path
56
from typing import Iterable
@@ -113,14 +114,15 @@ def parse_all_properties_files(_app: Sphinx, config: Config):
113114

114115
files: list[tuple[Path, str]] = []
115116

116-
for dirpath, _dirnames, filenames in root.walk():
117+
for dirpath, _dirnames, filenames in os.walk(root):
118+
dirpath_obj = Path(dirpath)
117119
# Skip build directories
118-
if "target" in dirpath.parts:
120+
if "target" in dirpath_obj.parts:
119121
continue
120122

121123
for filename in filenames:
122124
if filename.endswith("preferences.properties"):
123-
file = dirpath / filename
125+
file = dirpath_obj / filename
124126
pack = package_name(file) or filename
125127
_DATA[pack] = _parse_preferences_file(file, pack, root)
126128

docs/source/converter.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Exemples :
4242
**-main org.csstudio.display.builder.model.AdvancedConverter input/path/to/folder**
4343

4444
Converter application
45-
-----------------
45+
----------------------
4646

4747
Located in *Utility -> OPI converter*, it will generate a pop up window. In this pop up, you can choose a input file or folder with the Browse button in the input section. In a similar way, you can choose or not a output folder.
4848
To run the conversion you need to press the run button.
@@ -61,9 +61,3 @@ If you select **YES**, it will **delete** all bob files present in the output fo
6161
If you select **NO**, you return in the browsing section.
6262

6363
During the conversion, you can follow the conversion process with the progress bar. When the conversion is done, you return in the browsing section and can close the window with the "x" button or rerun a conversion.
64-
65-
66-
67-
68-
69-

docs/source/convertor.rst

Lines changed: 58 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,58 @@
1-
=================
2-
AdvancedConvertor
3-
=================
4-
5-
OPI to BOB convertor
6-
--------------------
7-
8-
9-
Table:
10-
11-
+ Description
12-
+ Command Line
13-
+ Converter application
14-
15-
Description
16-
------------
17-
18-
AdvancedConverter is a tool to convert massively and recursively CSS OPI to Phoebus BOB files. It will automatically convert the widgets and their properties from the legacy file format.
19-
20-
The converter takes folder or files and convert any OPI files into a BOB files (without delete previous OPI files).
21-
The programm keep the hierarchy, subfolders, scrypt and files inside.
22-
23-
Command Line
24-
------------
25-
To use this AdvancedConvertor, you can do it via this command line invocation:
26-
27-
Usage: Usage: -main org.csstudio.display.builder.model.AdvancedConverter [-help] [-output /path/to/folder] </path/to/opi/folder>
28-
29-
Converts BOY "*".opi files to Display Builder "*".bob format
30-
31-
**-output** /path/to/folder - Folder into which converted files are written
32-
33-
<files> - One or more files to convert
34-
35-
Exemples :
36-
*Convert and copy in another folder*
37-
38-
**-main org.csstudio.display.builder.model.AdvancedConverter** *-output* **output/path/to/folder input/path/to/folder**
39-
40-
*Convert and stay in the folder*
41-
42-
**-main org.csstudio.display.builder.model.AdvancedConverter input/path/to/folder**
43-
44-
Converter application
45-
-----------------
46-
47-
Located in *Utility -> OPI converter*, it will generate a pop up window. In this pop up, you can choose a input file or folder with the Browse button in the input section. In a similar way, you can choose or not a output folder.
48-
To run the conversion you need to press the run button.
49-
50-
If the output is empty, the conversion will be done in the input folder.
51-
52-
Right before the conversion, you might have an overriding message window. It appear when you already converted a file in the output folder.
53-
54-
If you select **YES**, it will **delete** all bob files present in the output folder and process the conversion normaly and convert evey opi files.
55-
56-
If you select **NO**, you return in the browsing section.
57-
58-
During the conversion, you can follow the conversion process with the progress bar. When the conversion is done, you return in the browsing section and can close the window with the "x" button or rerun a conversion.
59-
60-
61-
62-
63-
64-
1+
=================
2+
AdvancedConvertor
3+
=================
4+
5+
OPI to BOB convertor
6+
--------------------
7+
8+
9+
Table:
10+
11+
+ Description
12+
+ Command Line
13+
+ Converter application
14+
15+
Description
16+
------------
17+
18+
AdvancedConverter is a tool to convert massively and recursively CSS OPI to Phoebus BOB files. It will automatically convert the widgets and their properties from the legacy file format.
19+
20+
The converter takes folder or files and convert any OPI files into a BOB files (without delete previous OPI files).
21+
The programm keep the hierarchy, subfolders, scrypt and files inside.
22+
23+
Command Line
24+
------------
25+
To use this AdvancedConvertor, you can do it via this command line invocation:
26+
27+
Usage: Usage: -main org.csstudio.display.builder.model.AdvancedConverter [-help] [-output /path/to/folder] </path/to/opi/folder>
28+
29+
Converts BOY "*".opi files to Display Builder "*".bob format
30+
31+
**-output** /path/to/folder - Folder into which converted files are written
32+
33+
<files> - One or more files to convert
34+
35+
Exemples :
36+
*Convert and copy in another folder*
37+
38+
**-main org.csstudio.display.builder.model.AdvancedConverter** *-output* **output/path/to/folder input/path/to/folder**
39+
40+
*Convert and stay in the folder*
41+
42+
**-main org.csstudio.display.builder.model.AdvancedConverter input/path/to/folder**
43+
44+
Converter application
45+
----------------------
46+
47+
Located in *Utility -> OPI converter*, it will generate a pop up window. In this pop up, you can choose a input file or folder with the Browse button in the input section. In a similar way, you can choose or not a output folder.
48+
To run the conversion you need to press the run button.
49+
50+
If the output is empty, the conversion will be done in the input folder.
51+
52+
Right before the conversion, you might have an overriding message window. It appear when you already converted a file in the output folder.
53+
54+
If you select **YES**, it will **delete** all bob files present in the output folder and process the conversion normaly and convert evey opi files.
55+
56+
If you select **NO**, you return in the browsing section.
57+
58+
During the conversion, you can follow the conversion process with the progress bar. When the conversion is done, you return in the browsing section and can close the window with the "x" button or rerun a conversion.

docs/source/requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)