-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve php-src docs sphinx build, also on *nix #16743
Open
hakre
wants to merge
4
commits into
php:PHP-8.4
Choose a base branch
from
hakre:docs-sphinx-build
base: PHP-8.4
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+50
−9
Commits on Nov 9, 2024
-
Document .rst file maximum line length of 100
In 19d2b84 ("Create book for docs", 2024-01-30) the build of the php-src documentation has been introduced. It is based on reStructuredText (rst) [Docutils] for its source files, this stems from the sphinx-build utility in use to build the static HTML pages of the php-src documentation. The maximum line length of these text files has been set to 100 characters. This formatting constraint is applied with the rstfmt utility [rstfmt] via its invocation (documented in CI build instructions and README.md:) rstfmt -w 100 source The `-w, --width` option takes a WIDTH argument that is "the target line length in characters" (cf. `rstfmt --help`.) There is also an `--ext EXT` argument option, that is "the extension of files to look at when passed a directory" ("source" is the name of a directory in the invocation above) and defaults to "rst". Henceforth, the editor configuration [EditorConfig] can benefit from documenting this expectation in the repositories .editorconfig file, which has been introduced already earlier in 5c38fbe ("Added editorconfig file", 2016-06-26). [Docutils]: https://docutils.sourceforge.io/index.html "Docutils: Documentation Utilities — Written in Python, for General- and Special-Purpose Use" [rstfmt]: https://github.com/dzhu/rstfmt "A formatter for reStructuredText" [EditorConfig]: https://editorconfig.org/ "EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs"
Configuration menu - View commit details
-
Copy full SHA for 63bd0f4 - Browse repository at this point
Copy the full SHA 63bd0f4View commit details -
Makefile for php-src docs build
In 19d2b84 ("Create book for docs", 2024-01-30) the php-src documentation (php-src docs) build has been introduced, yet the build instructions, namely `make html`, did not yield the expected results within the parenting setup of the php-src project on *nix systems. The reason is that the `make html` build instruction does not execute the make.bat file which contains the recipe to build the static HTML pages. This is because — different to Windows systems — *nix systems do not have the concept of [COMSPEC] etc. for executables, and therefore we cannot expect for build scripts an interpreter for the batch file. Adding a Makefile suffices to recover the build of php-src ./docs on a *nix system. NOTE: The "help" target has been intentionally left out as this Sphinx builder [1] (with the same name) is not available in the configuration, nor in use in CI (.github/workflows/docs.yml), and otherwise appeared undocumented. Consequentially, the makefile goal does not include it, as well as a target for any other unspecfied builder. [COMSPEC]: https://en.wikipedia.org/wiki/COMSPEC "COMSPEC or ComSpec is one of the environment variables used in DOS, OS/2 and Windows, which normally points to the command line interpreter, which is by default COMMAND.COM in DOS,[1] Windows 95, 98, and ME or CMD.EXE in OS/2 and Windows NT. — Wikipedia" [1]: https://www.sphinx-doc.org/en/master/usage/builders/index.html "Built-in Sphinx builders"
Configuration menu - View commit details
-
Copy full SHA for 1e82ef9 - Browse repository at this point
Copy the full SHA 1e82ef9View commit details -
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"
Configuration menu - View commit details
-
Copy full SHA for 193b0b8 - Browse repository at this point
Copy the full SHA 193b0b8View commit details -
Remove deprecated theme configuration
For the configured Awesome Sphinx Theme [1] highlighting extension, the sphinx-build currently yields the following diagnostics: WARNING: while setting up extension sphinxawesome_theme.highlighting: \ You no longer have to include the `sphinxawsome_theme.highlighting` \ extension. This extension will be removed in the next major release. (via `make html`, the configuration file is `source/conf.py`.) The diagnostic message was introduced by sphinxawesome-theme 5.2.0, released May 31, 2024. [2], [3] Removing the extension from the list of extensions in the configuration file levitates. No changes to requirements.txt, the extension was transitive as bundled by the Awesome Sphinx Theme [1], and 5.2.0 deprecates it with the new feature to "Support `pygments_style_dark` option that allows you to set a different syntax highlighting scheme in light and dark modes." [3] [1]: https://sphinxawesome.xyz/ "Awesome Sphinx Theme — Create functional and beautiful websites for your documentation with Sphinx." [2]: https://pypi.org/project/sphinxawesome-theme/5.2.0/#history [3]: https://github.com/kai687/sphinxawesome-theme/releases/tag/5.2.0
Configuration menu - View commit details
-
Copy full SHA for 3240524 - Browse repository at this point
Copy the full SHA 3240524View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.