Skip to content

Commit 7d8a7c8

Browse files
committed
Bind requirements.txt for php-src docs build
Define the required packages to install for the php-src docs build in the docs/requirements.txt file: 1) Sphinx 2) sphinx-design 3) sphinxawesome-theme 4) rstfmt This should also later on ease the use of a requirements_frozen.txt file to pin the build dependencies if needed/wanted. Additionally, some formatting corrections in README.md (based on the profile in .editorconfig) as well as adding the recommendation to use a Python virtual environment. Python3 and Pip were already named, and with Python3 there is the venv module (Python 3.3; Sep 2012) to manage these so-called python virtual environments [venv], which are commonly a preferred way to install dependencies within development projects and build systems. [venv]: https://docs.python.org/3/library/venv.html "venv — Creation of virtual environments — Python documentation"
1 parent ff9ec3e commit 7d8a7c8

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

.github/workflows/docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: git checkout
2020
uses: actions/checkout@v4
2121
- name: Install dependencies
22-
run: pip install sphinx-design sphinxawesome-theme rstfmt
22+
run: pip install -r docs/requirements.txt
2323
- name: Check formatting
2424
run: make -C docs check-formatting
2525
- name: Publish

docs/README.md

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# php-src docs
22

33
This is the home of the php-src internal documentation, hosted at
4-
[php.github.io/php-src/](https://php.github.io/php-src/). It is in very early stages, but is
5-
intended to become the primary place where new information about php-src is documented. Over time,
6-
it is expected to replace various mediums like:
4+
[php.github.io/php-src/](https://php.github.io/php-src/). It is in very early
5+
stages, but is intended to become the primary place where new information about
6+
php-src is documented. Over time, it is expected to replace various mediums
7+
like:
78

89
* https://www.phpinternalsbook.com/
910
* https://wiki.php.net/internals
@@ -14,11 +15,15 @@ it is expected to replace various mediums like:
1415
`python` 3 and `pip` are required.
1516

1617
```bash
17-
pip install sphinx sphinx-design sphinxawesome-theme
18+
cd docs
19+
# Recommended: Initialize and activate a Python virtual environment
20+
pip install --upgrade pip
21+
pip install -r requirements.txt
1822
make html
1923
```
2024

21-
That's it! You can view the documentation under `./build/html/index.html` in your browser.
25+
That's it! You can view the documentation under `./build/html/index.html` in
26+
your browser.
2227

2328
## Formatting
2429

@@ -29,5 +34,5 @@ The files in this documentation are formatted using the
2934
rstfmt -w 100 source
3035
```
3136

32-
This tool is not perfect. It breaks on custom directives, so we might switch to either a fork or
33-
something else in the future.
37+
This tool is not perfect. It breaks on custom directives, so we might switch to
38+
either a fork or something else in the future.

docs/requirements.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Sphinx
2+
sphinx-design
3+
sphinxawesome-theme
4+
rstfmt

0 commit comments

Comments
 (0)