summaryrefslogtreecommitdiffstats
path: root/Utilities/Sphinx
Commit message (Collapse)AuthorAgeFilesLines
* Utilities/Sphinx: Restore html search index link anchorsBrad King2023-07-131-1/+1
| | | | | | | | | | | | | Since commit 37e015d4a6 (Utilities/Sphinx: Refactor Sphinx reference recording, 2023-03-08, v3.27.0-rc1~342^2~1), anchors in links to cmake domain objects generated in html search results were missing their object type prefix, and thus did not link to the object. Restore our `get_objects` implementation's second tuple entry to what we used prior to that commit. This matches what Sphinx's builtin python, rst, and javascript modes do. Fixes: #25067
* Merge topic 'sphinx-docutils-warning' into release-3.27Brad King2023-06-231-1/+12
|\ | | | | | | | | | | | | 0c14b6085a Utilities/Sphinx: Fix warning from docutils 0.18.1+ Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8578
| * Utilities/Sphinx: Fix warning from docutils 0.18.1+Henry Schreiner2023-06-221-1/+12
| | | | | | | | | | Also might fix 0.18.0 exactly, which apparently forgot to add the backward compat shim.
* | Utilities/Sphinx: Fix parallel documentation buildsMatthew Woehlke2023-06-221-1/+15
|/ | | | | | | | | | | | | | | | In commit d78bfa1ecc (Utilities/Sphinx: support cmakedomain running in parallel, 2022-10-24, v3.26.0-rc1~495^2) we declared the domain as parallel-safe without actually implementing the required `merge_domaindata` method. Since then, commit 37e015d4a6 (Utilities/Sphinx: Refactor Sphinx reference recording) changed how we store resolved references, such that our separate fix for 3.26 does not work in 3.27+. While at it, correct a crusty comment that was overlooked during the aforementioned refactoring. Issue: #24076 Co-authored-by: Jared Dillard <jared.dillard@gmail.com>
* Utilities/Sphinx: Fix some flake8 gripesMatthew Woehlke2023-06-131-7/+6
| | | | Reorder some imports to better conform to what flake8 wants.
* Utilities/Sphinx: Don't ignore flake8 E402Matthew Woehlke2023-06-132-21/+18
| | | | | | | | Refactor commit 1f39a3cd1a (Utilities/Sphinx: Restore explicit check for Sphinx 2.x or later) to avoid needing to suppress flake8 E402. While ignoring it with respect to the docutils/sphinx imports and the sphinx version check was correct, the need to disable it for the whole file was suboptimal.
* Utilities/Sphinx: Restore explicit check for Sphinx 2.x or laterBrad King2023-06-122-3/+8
| | | | | | | | Refactoring in commit adbc8c982d (Utilities/Sphinx: Fix flake8 gripes in cmake.py, 2023-03-13, v3.27.0-rc1~317^2) moved the assertion added by commit cef51925a4 (Utilities/Sphinx: Require Sphinx 2.x or later, 2023-03-13, v3.27.0-rc1~317^2~2) to after imports, which is too late to clearly reject older Sphinx versions.
* Utilities/Sphinx: Fix flake8 E124 diagnostic in cmake.pyBrad King2023-06-121-1/+1
|
* Sphinx: Modernize UTF-8 encoding handling when updating CMake.qhpCraig Scott2023-04-071-4/+4
|
* Sphinx: Specify encoding when opening files for title extractionCraig Scott2023-04-071-2/+3
| | | | | | | | | | When the encoding is not specified, open() may choose an encoding based on the locale in use. That encoding may have no relationship to the encoding of the file being opened. Use the locale from the document settings instead, which should better match the file's encoding. Fixes: #24679
* Utilities/Sphinx: Fix flake8 gripes in cmake.pyMatthew Woehlke2023-03-151-42/+87
| | | | | | | | Edit Utilities/Sphinx/cmake.py to avoid lines longer than 79 characters and to obey other flake8-checked style rules. This will allow using flake8 to check for possible issues without having to wade through noise about improper styling. (Also, of course, consistent styling is beneficial in its own right.)
* Utilities/Sphinx: Use f-strings in cmake.pyMatthew Woehlke2023-03-151-16/+15
| | | | | | | | | Port all uses of old-style % string formatting to use f-strings. These are generally more readable (and tend to be shorter as well). Although this requires Python 3.6 or later, that should be available 'stock' on most or all platforms still under support, and besides, we were already using f-strings in some places.
* Utilities/Sphinx: Require Sphinx 2.x or laterMatthew Woehlke2023-03-151-36/+6
| | | | | | | Tweak our Sphinx extensions slightly to assert that Sphinx is at least 2.x. Remove hacks for older versions of Sphinx. This cleans up a bunch of messy code and, more importantly, paves the way for consolidating our import statements.
* Utilities/Sphinx: Add 'cref' roleMatthew Woehlke2023-03-141-1/+18
| | | | | | | | | | | | | Add a role that can be used to create local links (a la '`LINK`_'), but that also applies literal style. This is particularly useful for referring to subcommands within the command's documentation in a style that is consistent with ':command:`BAR <foo(BAR)>`' but is much less verbose. Although this is intended for subcommands, it works with any local reference. Co-authored-by: Brad King <brad.king@kitware.com>
* Utilities/Sphinx: Factor out part of CMakeXRefRoleMatthew Woehlke2023-03-141-13/+29
| | | | | | | Refactor the portion of CMakeXRefRole that escapes angle brackets in reference titles to the equivalent of a C++ template class. This will allow us to reuse that logic for reference roles that aren't derived from XRefRole.
* Merge topic 'version-hanging-indent'Brad King2023-03-141-0/+11
|\ | | | | | | | | | | | | 038f4c12e3 Utilities/Sphinx: Add hanging indent to version notes Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8325
| * Utilities/Sphinx: Add hanging indent to version notesMatthew Woehlke2023-03-141-0/+11
| | | | | | | | | | | | | | Tweak HTML styling of version-{added,changed} notes to include a hanging indent. This makes it more obvious what text is part of such a note in cases where the note is lengthy (especially if more than one paragraph), rather than the relevant text blending into the surrounding prose.
* | Utilities/Sphinx: Restore trailing parens on command cross-referencesBrad King2023-03-141-3/+8
|/ | | | | | | | | | Since commit cc21d0e478 (Utilities/Sphinx: Make signatures linkable, 2023-03-09) we always convert `cmake:command` domain cross-references to use the explicit `text <text>` form. This breaks the XRefRole's `fix_parens` setting that we use to render `cmd` as `cmd()`. Instead, transform `cmd(sub)` to `cmd(sub) <cmd(sub)>` to preserve the sub-command link destination, but leave `cmd` alone and let XRefRole convert it to `cmd()`.
* Merge topic 'smart-wrap-signatures'Brad King2023-03-142-12/+76
|\ | | | | | | | | | | | | 39ecaa5da1 Utilities/Sphinx: Improve word wrap of signatures Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8317
| * Utilities/Sphinx: Improve word wrap of signaturesMatthew Woehlke2023-03-132-12/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement logic to support several styles of parsing in the new signature directive that control where line breaks are allowed in a signature. The default is 'smart', which forbids breaks inside of square- or angle-brackets. The 'verbatim' option forbids all breaks. In all cases, breaks are always allowed where a newline appears in the source. This seems to Just Work for most writers, but HTML needs some special handling that is accomplished by a new CSS rule and assigning the 'nbsp' class to spaces that are not allowed to break. (ROFF's line wrapping is rather unfortunate here, as it prefers splitting and hyphenating words rather than breaking at a space.)
* | Utilities/Sphinx: Allow explicit target for genexMatthew Woehlke2023-03-131-5/+29
|/ | | | | | | | | | | | | | | | Split the genex directive into its own class, allowing a slight simplification of CMakeObject. Add ability to specify an explicit target name for the same. Use this to provide a target for the `$<TARGET_PROPERTY:prop>` generator expression which is otherwise missing one (due to overlap with `$<TARGET_PROPERTY:tgt,prop>`). With this one can write: :genex:`$<TARGET_PROPERTY:prop> <TARGET_PROPERTY:prop>` to link the second variant. Fixes: #24573
* Utilities/Sphinx: Make signatures linkableMatthew Woehlke2023-03-091-10/+29
| | | | | | | | | | | Add signatures to the collection of observed objects (which can be referenced elsewhere). Don't automatically strip parameters from a :command: reference, as these may now link signatures. (Do, however, munge them into 'text <ref>' form if they aren't already, as not doing so adds an extra '()' for some reason.) Correspondingly, change xref resolution to try to match 'command' when a ref like 'command(args)' is not matched, so that existing links to commands that have not been converted to use the new signature directive don't immediately break.
* Utilities/Sphinx: Refactor Sphinx reference recordingMatthew Woehlke2023-03-081-18/+39
| | | | | | | | | Rewrite how we record objects in our Sphinx extensions to more closely conform to how other domains do likewise, and to store more information than was previously being stored. This is a first step toward being able to record and reference signatures.
* Utilities/Sphinx: Add a directive to document command signaturesMatthew Woehlke2023-03-032-3/+105
| | | | | | | Add a `signature` directive to offer a CMake version of Sphinx's `function` directive, similar to that found in other domains (py, cpp, etc.). Like others, this takes one or more signatures as arguments and creates dt/dd nodes from the signatures and the directive contents.
* Utilities/Sphinx: Drop commented-out code from cmake domain implBrad King2023-02-241-12/+1
| | | | Inspired-by: Alex Turbov <i.zaufi@gmail.com>
* Utilities/Sphinx: Configure linkcheck allowed permanent redirectsBrad King2023-02-171-0/+8
| | | | | Some permanent redirects are part of the structure of their site to make URLs look nicer. Allow them.
* Configure CMake itself with policies through CMake 3.25Brad King2023-02-011-1/+1
|
* Merge topic 'doc-guide-link-style'Brad King2022-11-091-0/+11
|\ | | | | | | | | | | | | 977c38c339 Help: Render guide links as normal text instead of monospace Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7886
| * Help: Render guide links as normal text instead of monospaceAlex Turbov2022-11-081-0/+11
| | | | | | | | | | The guide document names are phrases, not code-like man-page names. Add CSS selectors for `:guide:` links and revert unnecessary properties.
* | Build: Add `SPHINX_LINKCHECK` build optionAlex Turbov2022-11-072-1/+19
| | | | | | | | Run `sphinx-build` to check external links and report broken one.
* | Build: Do not redirect `sphinx-build` output if CMake running in verbose modeAlex Turbov2022-11-071-3/+34
| | | | | | | | | | | | | | | | | | Configuring with `--log-level=VERBOSE` a user can see an output of `sphinx-build` at build time. The other way is to have `VERBOSE` envvar set at configure time. And finally one can set `CMAKE_VERBOSE_MAKEFILE` CMake cache variable.
* | Build: Deduplicate `add_custom_command()` calls for Sphinx targetsAlex Turbov2022-11-071-32/+25
| |
* | Utilities/Sphinx: support cmakedomain running in parallelHenry Schreiner2022-10-241-0/+1
| | | | | | | | | | | | Fixes: #24076 Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
* | Configure CMake itself with policies through CMake 3.24Brad King2022-10-121-1/+1
|/
* Utilities/Sphinx: Avoid deprecated docutils error handling helpersBrad King2022-10-111-12/+6
| | | | | | | | | | The `SafeString` and `ErrorString` classes are deprecated and will be removed in Docutils 0.21 or later. They help avoid encoding errors during exception handling in Python <= 2.7, but these days we always use Python 3 to build the documentation, at least during development, when error cases are most likely to occur. Fixes: #24039
* Build: Modernize some `foreach` calls to use `IN LISTS`/`IN ITEMS`Alex Turbov2022-09-221-9/+3
|
* QtHelp: Update Sphinx issue URLs in commentsFeRD (Frank Dana)2022-09-041-2/+2
| | | | | | The QtHelp Sphinx generation code contains two links to Sphinx issues that used old, dead BitBucket URLs. Those issues were migrated to GitHub, so the dead links can be replaced with working ones.
* Configure CMake itself with policies through CMake 3.23Brad King2022-06-141-1/+1
|
* Merge topic 'doc-cmake.org-tutorial-archive'Brad King2022-04-292-6/+54
|\ | | | | | | | | | | | | | | | | 4cb616fed6 Tutorial: Provide a source archive when published on cmake.org 37fb70591e Utilities/Sphinx: Add variables listing pre-sphinx commands eb7d913a21 Utilities/Sphinx: Clarify names of variables listing post-sphinx commands Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7215
| * Tutorial: Provide a source archive when published on cmake.orgBrad King2022-04-282-0/+46
| | | | | | | | | | | | | | | | | | Provide readers following the tutorial on `cmake.org` a direct link to download the tutorial's source examples. Previously readers had to fetch the CMake source tree separately and look for the tutorial source examples inside it. Fixes: #22475
| * Utilities/Sphinx: Add variables listing pre-sphinx commandsBrad King2022-04-271-0/+2
| |
| * Utilities/Sphinx: Clarify names of variables listing post-sphinx commandsBrad King2022-04-271-6/+6
| |
| * Merge branch 'doc-qhelpgenerator' into release-3.23Brad King2022-04-081-6/+6
| |\ | | | | | | | | | Merge-request: !7150
| * \ Merge topic 'ci-cmake.org-help' into release-3.23Brad King2022-04-061-0/+6
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | b691906d27 gitlab-ci: Build qthelp-format release documentation for cmake.org 1ceec19c20 gitlab-ci: Add objects.inv to cmake.org html documentation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7146
| * \ \ Merge topic 'ci-cmake.org-help' into release-3.23Brad King2022-04-054-6/+85
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2808281730 gitlab-ci: update cmake.org documentation in release package pipeline ed00a29cce gitlab-ci: consolidate jobs for cmake.org/cmake/help/git-{master,stage} docs 5c2e8ce515 Utilities/Sphinx: Add OpenSearch link to html page headers on cmake.org a14905d4df Utilities/Sphinx: Add option to build outdated version banner for cmake.org cca73b54ae Utilities/Sphinx: Add undocumented option to build docs for cmake.org Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7144
* | | | | CMake: Use FindPython instead of FindPythonInterp to build CMake itselfKyle Edwards2022-04-211-2/+2
| | | | | | | | | | | | | | | | | | | | Fixes: #23444
* | | | | Merge topic 'doc-qhelpgenerator'Brad King2022-04-081-6/+6
|\ \ \ \ \ | | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | bf69fa32c4 Utilities/Sphinx: Update qthelp generation to qhelpgenerator 37904abb58 Help: Add "Updates" section header in 3.22 release notes Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7150
| * | | | Utilities/Sphinx: Update qthelp generation to qhelpgeneratorBrad King2022-04-071-6/+6
| | |_|/ | |/| | | | | | | | | | `qcollectiongenerator` is deprecated in favor of `qhelpgenerator`.
* | | | Merge topic 'ci-cmake.org-help'Brad King2022-04-061-0/+6
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | b691906d27 gitlab-ci: Build qthelp-format release documentation for cmake.org 1ceec19c20 gitlab-ci: Add objects.inv to cmake.org html documentation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7146
| * | | gitlab-ci: Build qthelp-format release documentation for cmake.orgBrad King2022-04-061-0/+6
| | |/ | |/| | | | | | | | | | Previously the qthelp-format release documentation on `cmake.org` was built manually.