Commit Graph

17 Commits

Author SHA1 Message Date
Brad King
d9ab1fb5da Help/dev: Fix formatting in CMake Documentation Guide 2024-06-05 12:58:47 -04:00
scivision
53a542936e Help: Convert http URLs to https 2024-03-07 09:42:45 -05:00
Brad King
6828b9df5a Help/dev: Extend documentation guide with another section nesting level 2023-07-31 11:21:10 -04:00
Matthew Woehlke
302f5171d8 Utilities/Sphinx: Add 'cref' role
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>
2023-03-14 15:20:47 -04:00
Brad King
08d31c227b Merge topic 'smart-wrap-signatures'
39ecaa5da1 Utilities/Sphinx: Improve word wrap of signatures

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8317
2023-03-14 09:39:52 -04:00
Matthew Woehlke
2e37a20f02 Utilities/Sphinx: Allow explicit target for genex
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
2023-03-13 17:04:52 -04:00
Matthew Woehlke
39ecaa5da1 Utilities/Sphinx: Improve word wrap of signatures
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.)
2023-03-13 13:31:38 -04:00
Matthew Woehlke
cc21d0e478 Utilities/Sphinx: Make signatures linkable
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.
2023-03-09 11:32:07 -05:00
Matthew Woehlke
74e3c1d313 Utilities/Sphinx: Add a directive to document command signatures
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.
2023-03-03 17:05:02 -05:00
Brad King
6e85ad7f8b Help/dev: Add per-directive sections in CMake Documentation Guide 2023-02-24 12:25:35 -05:00
Brad King
74f1fbb7a1 Help/dev: Cover module function naming in CMake Documentation Guide 2021-12-08 17:05:25 -05:00
Ben Boeckel
054754359a cmRST: support versionadded and versionchanged directives
This makes `versionadded` and `versionchanged` directives show up in
`cmake --help-*` output instead of disappearing (and potentially making
empty sections).

Fixes: #22808
2021-10-27 09:15:00 -04:00
Brad King
7d498d6b43 Utilities/Sphinx: Add role and directive for 'genex' in CMake domain
This enables cross-reference syntax for CMake generator expressions:

    :genex:`SOME_GENEX`
    :genex:`$<SOME_GENEX>`
    :genex:`$<SOME_GENEX:...>`

and definition of CMake generator expressions via a directive:

    .. genex:: SOME_GENEX
    .. genex:: $<SOME_GENEX>
    .. genex:: $<SOME_GENEX:...>

It also adds generator expressions defined by the directive and by
`Help/genex/SOME_GENEX.rst` documents to the index.
2021-01-18 12:35:41 -05:00
Brad King
cc1f53351c Help/dev: Mention 'cpack_gen' domain object in CMake Documentation Guide
This was accidentally left out of commit 2a2829cc75 (Help: Add new
section for CPack generators, 2018-06-15, v3.13.0-rc1~394^2~3).
2021-01-18 12:35:40 -05:00
Brad King
954a9e9893 Help/dev: Mention 'envvar' domain object in CMake Documentation Guide
This was accidentally left out of commit 8acf46caf1 (Utilities/Sphinx:
Add role and directive for 'envvar' in CMake domain, 2018-04-19,
v3.12.0-rc1~200^2~1).
2021-01-18 12:35:40 -05:00
Brad King
8369e3e782 Help/dev: Modernize module example in the CMake Documentation Guide 2018-11-20 21:03:01 +11:00
Brad King
a82282a08c Help/dev: Factor out a CMake Documentation Guide for developing the docs
Remove this content from the `cmake-developer(7)` manual because it
is relevant only to developers working on CMake itself.  Move it to
a guide in the developer documentation.
2018-11-14 14:38:13 -05:00