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:
Brad King 2014-06-02 13:58:01 -04:00
parent 4207b3a3bb
commit eaafe756d5
1 changed files with 132 additions and 110 deletions

View File

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