Help: Add documentation style section headers to cmake-developer.7
Give the style guides titles instead of numbers so we can link to them.
This commit is contained in:
parent
4207b3a3bb
commit
eaafe756d5
|
@ -465,11 +465,12 @@ with an explicit target.
|
|||
Style
|
||||
-----
|
||||
|
||||
1)
|
||||
Style: Command Signatures
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Command signatures should be marked up as plain literal blocks, not as
|
||||
cmake ``code-blocks``.
|
||||
|
||||
2)
|
||||
Signatures are separated from preceding content by a horizontal
|
||||
line. That is, use:
|
||||
|
||||
|
@ -485,30 +486,40 @@ Style
|
|||
|
||||
This signature is used for ...
|
||||
|
||||
3)
|
||||
Style: Boolean Constants
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Use "``OFF``" and "``ON``" for boolean values which can be modified by
|
||||
the user, such as :prop_tgt:`POSITION_INDEPENDENT_CODE`. Such properties
|
||||
may be "enabled" and "disabled". Use "``True``" and "``False``" for
|
||||
inherent values which can't be modified after being set, such as the
|
||||
:prop_tgt:`IMPORTED` property of a build target.
|
||||
|
||||
4)
|
||||
Style: Whitespace
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
Use two spaces for indentation. Use two spaces between sentences in
|
||||
prose.
|
||||
|
||||
5)
|
||||
Style: Starting Literal Blocks
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Prefer to mark the start of literal blocks with ``::`` at the end of
|
||||
the preceding paragraph. In cases where the following block gets
|
||||
a ``code-block`` marker, put a single ``:`` at the end of the preceding
|
||||
paragraph.
|
||||
|
||||
6)
|
||||
Style: Line Length
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Prefer to restrict the width of lines to 75-80 columns. This is not a
|
||||
hard restriction, but writing new paragraphs wrapped at 75 columns
|
||||
allows space for adding minor content without significant re-wrapping of
|
||||
content.
|
||||
|
||||
7)
|
||||
Style: Document Self-References
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Mark up self-references with ``inline-literal`` syntax. For example,
|
||||
within the add_executable command documentation, use
|
||||
|
||||
|
@ -524,13 +535,17 @@ Style
|
|||
|
||||
which is used elsewhere.
|
||||
|
||||
8)
|
||||
Style: Linkable References
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Mark up all other linkable references as links, including repeats. An
|
||||
alternative, which is used by wikipedia (`<http://en.wikipedia.org/wiki/WP:REPEATLINK>`_),
|
||||
is to link to a reference only once per article. That style is not used
|
||||
in CMake documentation.
|
||||
|
||||
9)
|
||||
Style: Technical Terms
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Mark up references to keywords in signatures, file names, and other
|
||||
technical terms with ``inline-literl`` syntax, for example:
|
||||
|
||||
|
@ -540,8 +555,9 @@ Style
|
|||
:prop_tgt:`WIN32_EXECUTABLE` target property is enabled. That command
|
||||
creates the file ``<name>.exe`` on Windows.
|
||||
|
||||
Style: Referencing Concepts
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
10)
|
||||
If referring to a concept which corresponds to a property, and that
|
||||
concept is described in a high-level manual, prefer to link to the
|
||||
manual section instead of the property. For example:
|
||||
|
@ -575,7 +591,6 @@ Style
|
|||
(``IMPORTED``), a target property (:prop_tgt:`IMPORTED`), or a
|
||||
concept (:ref:`Imported Targets`).
|
||||
|
||||
11)
|
||||
Where a property, command or variable is related conceptually to others,
|
||||
by for example, being related to the buildsystem description, generator
|
||||
expressions or Qt, each relevant property, command or variable should
|
||||
|
@ -583,7 +598,9 @@ Style
|
|||
particular information relating to the command should be in the
|
||||
documentation of the command.
|
||||
|
||||
12)
|
||||
Style: Section Titles
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
When marking section titles, make the section decoration line as long as
|
||||
the title text. Use only a line below the title, not above. For
|
||||
example:
|
||||
|
@ -595,7 +612,9 @@ Style
|
|||
|
||||
Capitalize the first letter of each non-minor word in the title.
|
||||
|
||||
13)
|
||||
Style: Referencing CMake Domain Objects
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
When referring to properties, variables, commands etc, prefer to link
|
||||
to the target object and follow that with the type of object it is.
|
||||
For example:
|
||||
|
@ -617,16 +636,19 @@ Style
|
|||
|
||||
If policy :prop_tgt:`CMP0022` is set to ``NEW`` the behavior is ...
|
||||
|
||||
14)
|
||||
Style: Command Signature Markup
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Signatures of commands should wrap optional parts with square brackets,
|
||||
and should mark list of optional arguments with an ellipsis (``...``).
|
||||
Elements of the signature which are specified by the user should be
|
||||
specified with angle brackets, and may be referred to in prose using
|
||||
``inline-literal`` syntax.
|
||||
|
||||
15)
|
||||
Use American English spellings in prose.
|
||||
Style: Prose
|
||||
^^^^^^^^^^^^
|
||||
|
||||
Use American English spellings in prose.
|
||||
|
||||
Modules
|
||||
=======
|
||||
|
|
Loading…
Reference in New Issue