Skip to content

Commit d998695

Browse files
committed
docs: update release notes, roadmap, document Doxygen tagfile
1 parent 3b7bf0b commit d998695

10 files changed

+401
-202
lines changed
5.88 KB
Loading
5.88 KB
Loading

docs/sphinx/source/strictdoc_01_user_guide.rst

Lines changed: 162 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,93 +1862,6 @@ This section contains an anchor named ``Anchor ABC``.
18621862

18631863
.. _ANCHOR-EXAMPLE:
18641864

1865-
.. _SECTION-UG-Search-and-filtering:
1866-
1867-
Search and filtering
1868-
====================
1869-
1870-
.. list-table::
1871-
:align: left
1872-
:header-rows: 0
1873-
1874-
* - **MID:**
1875-
- de584af947a445e5bcc782bab6a93baf
1876-
1877-
StrictDoc supports search and filtering of document content. However, this feature has not been extensively tested and is hidden behind a feature flag. To activate it, enable the corresponding setting in the ``strictdoc.toml`` configuration file:
1878-
1879-
.. code-block::
1880-
1881-
[project]
1882-
1883-
features = [
1884-
"SEARCH"
1885-
]
1886-
1887-
The web interface includes the Search screen, designed for conducting queries against a document tree. The command-line interface supports filtering of requirements and sections through the ``export`` commands.
1888-
1889-
Query engine
1890-
------------
1891-
1892-
.. list-table::
1893-
:align: left
1894-
:header-rows: 0
1895-
1896-
* - **MID:**
1897-
- 29ffc3e91d8045589b0837f647286128
1898-
1899-
The syntax of the search query is inspired by Python, utilizing a fixed grammar that converts search queries into corresponding Python expressions.
1900-
1901-
Important rules:
1902-
1903-
- Every query component shall start with ``node.``.
1904-
- ``and`` and ``or`` expressions must be grouped using round brackets.
1905-
- Only double quotes are accepted for strings.
1906-
1907-
.. list-table:: Query examples
1908-
:widths: 50 50
1909-
:header-rows: 1
1910-
1911-
* - **Query**
1912-
- **Description**
1913-
1914-
* - ``node.is_requirement``
1915-
- Find all requirements.
1916-
1917-
* - ``node.is_section``
1918-
- Find all sections.
1919-
1920-
* - ``node.is_root``
1921-
- Find all requirements or sections from documents with ``ROOT: True``. See :ref:`Document <SECTION-UG-Document>` for the description of the ``ROOT`` option.
1922-
1923-
* - ``(node.is_requirement and "System" in node["TITLE"])``
1924-
- Find all requirements with a TITLE that equals to "System".
1925-
1926-
* - ``(node.is_requirement and node.has_parent_requirements)``
1927-
- Find all requirements which have parent requirements.
1928-
1929-
* - ``(node.is_requirement and node.has_child_requirements)``
1930-
- Find all requirements which have child requirements.
1931-
1932-
Filtering content
1933-
-----------------
1934-
1935-
.. list-table::
1936-
:align: left
1937-
:header-rows: 0
1938-
1939-
* - **MID:**
1940-
- d52d86750ad54ce1b3263ebb092451c0
1941-
1942-
Both ``export`` command-line interface commands support filtering documentation content with ``--filter-requirements`` and ``--filter-sections`` options.
1943-
1944-
Both options are based on the Query Engine, so the same rules that are valid for Search also apply for filtering. When a filter is applied, only the whitelisted requirements/sections will be exported.
1945-
1946-
Example:
1947-
1948-
.. code-block::
1949-
1950-
strictdoc export . --filter-requirements '"System" in node["TITLE"]'
1951-
19521865
Markup
19531866
======
19541867

@@ -2225,8 +2138,6 @@ Traceability between requirements and source code
22252138
* - **MID:**
22262139
- 4398b17f61ad4dd290e72d7888597f48
22272140

2228-
**Note:** This feature is experimental, the documentation is incomplete.
2229-
22302141
StrictDoc allows connecting requirements to source code files in two ways:
22312142

22322143
1. Linking source files to requirements by adding special markers in the source code without modifying the requirements.
@@ -2284,7 +2195,7 @@ To activate language-aware traceability, configure the project with the followin
22842195
"SOURCE_FILE_LANGUAGE_PARSERS"
22852196
]
22862197
2287-
Currently, only Python and C parsers are implemented. Upcoming implementations include parsers for Rust, C++, Bash, and more.
2198+
Currently, only Python and C/C++ parsers are implemented. Upcoming implementations include parsers for Rust, Bash, and more.
22882199

22892200
Linking source code to requirements
22902201
-----------------------------------
@@ -2296,7 +2207,7 @@ Linking source code to requirements
22962207
* - **MID:**
22972208
- c787c538cc0a422fb2898b525ec1006d
22982209

2299-
To connect a source file to a requirement, a dedicated ``@relation`` marker must be added to the source file. Several marker types are supported, depending on the programming language. For example, the ``scope=class`` option is available for Python files but not for C files, as C does not support classes.
2210+
To connect a source file to a requirement, a dedicated ``@relation`` marker must be added to the source file. Several marker types are supported, depending on the programming language. For example, the ``scope=class`` option is available for Python files but not for C files, as C does not support classes. The marker supports both () and {} for arguments.
23002211

23012212
.. note::
23022213

@@ -2306,6 +2217,8 @@ To connect a source file to a requirement, a dedicated ``@relation`` marker must
23062217

23072218
The legacy ``@sdoc`` marker is still supported by StrictDoc but is deprecated. ``@relation`` is the new correct marker name.
23082219

2220+
It is also possible to use @relation markers and be compatible with Doxygen. See :ref:`Doxygen <SECTION-UG-Doxygen>`.
2221+
23092222
**1\) Linking a file to a requirement**
23102223

23112224
The marker must be added to the top comment of a file.
@@ -2329,7 +2242,7 @@ The marker must be added to the top comment of a file.
23292242
@relation(REQ-1, scope=class)
23302243
"""
23312244
2332-
**3\) Linking a function to a requirement (Python and C only)**
2245+
**3\) Linking a function to a requirement (Python, C, and C++ only)**
23332246

23342247
.. code:: python
23352248
@@ -2354,6 +2267,10 @@ or
23542267
print("Hello, World\n");
23552268
}
23562269
2270+
.. note::
2271+
2272+
For the C and C++ languages, if a ``@relation`` marker is included in a function declaration prototype (which is the most common practice), StrictDoc also creates a link between the requirement and the corresponding C function definition.
2273+
23572274
**4\) Linking a range to a requirement**
23582275

23592276
.. code:: python
@@ -3061,6 +2978,72 @@ The following is a list of features that are considered less portable when it co
30612978

30622979
It is easier to extend StrictDoc to produce a format supported by a given tool than it is to make the other tool export a 100%-identical content back to StrictDoc. If there is a need to interface with a tool X and something is missing in StrictDoc, please reach out to the developers (see :ref:`Contact the developers <SDOC_UG_CONTACT>`).
30632980

2981+
Interoperability with other tools
2982+
=================================
2983+
2984+
.. _SECTION-UG-Doxygen:
2985+
2986+
Doxygen
2987+
-------
2988+
2989+
.. list-table::
2990+
:align: left
2991+
:header-rows: 0
2992+
2993+
* - **MID:**
2994+
- a8664547ac7e41399d7d8d263869abc6
2995+
2996+
HTML documentation generated by StrictDoc can be integrated with Doxygen documentation.
2997+
2998+
Doxygen includes a ``TAGFILE`` feature that allows linking to external documentation. This tagfile is in XML format and looks like this:
2999+
3000+
.. code::
3001+
3002+
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
3003+
<tagfile doxygen_version="1.9.8">
3004+
<compound kind="file">
3005+
<name>REQ-1</name>
3006+
<filename>strictdocfolder/mystrictdocreq.html#REQ-1</filename>
3007+
</compound>
3008+
</tagfile>
3009+
3010+
StrictDoc automatically generates a Doxygen tagfile containing the requirements using the export command:
3011+
3012+
.. code::
3013+
3014+
strictdoc export . --formats=html,doxygen
3015+
3016+
When a requirement is referenced in a source code comment block with the command ``\ref REQ-1``, Doxygen includes a link to the corresponding ``<filename/>`` in the output.
3017+
3018+
The location of the StrictDoc export can be specified in the TAGFILE field, either as a relative path, e.g., ``TAGFILES = strictdoc.tag=../../strictdoc``, or as an absolute URL, e.g., ``TAGFILES = strictdoc.tag=http://example.com/strictdoc``.
3019+
3020+
To make the StrictDoc @relation keyword work with Doxygen, an alias has to be created:
3021+
3022+
.. code::
3023+
3024+
ALIASES += relation{2}="\ref \1"
3025+
3026+
resulting in the following syntax to be recognized by Doxygen: ``@relation{REQ-1, scope=function}``.
3027+
3028+
Relevant Doxygen documentation:
3029+
3030+
- `Linking to external documentation <https://www.doxygen.nl/manual/external.html>`_
3031+
- `TAGFILES <https://www.doxygen.nl/manual/config.html#cfg_tagfiles>`_
3032+
3033+
Valispace
3034+
---------
3035+
3036+
.. list-table::
3037+
:align: left
3038+
:header-rows: 0
3039+
3040+
* - **MID:**
3041+
- 5fe39dedfa4640d2bd7127ff23b0e3de
3042+
3043+
Valispace provides a Python API, including an example script for exporting all project requirements in JSON format. See `Examples: Get a complete project requirements tree <https://github.com/valispace/ValispacePythonAPI/pull/22>`_.
3044+
3045+
The ``GetAllProjectRequirementsTree.py`` script can be used to create a converter that generates SDoc text files customized to the specifics of the project.
3046+
30643047
.. _SDOC_UG_EXPERIMENTAL_FEATURES:
30653048

30663049
Experimental features
@@ -3079,6 +3062,93 @@ A feature is considered stable when all its known edge cases have been covered a
30793062

30803063
See also :ref:`Selecting features <SDOC_UG_CONFIG_FEATURES>` for general instructions.
30813064

3065+
.. _SECTION-UG-Search-and-filtering:
3066+
3067+
Search and filtering
3068+
--------------------
3069+
3070+
.. list-table::
3071+
:align: left
3072+
:header-rows: 0
3073+
3074+
* - **MID:**
3075+
- de584af947a445e5bcc782bab6a93baf
3076+
3077+
StrictDoc supports search and filtering of document content. However, this feature has not been extensively tested and is hidden behind a feature flag. To activate it, enable the corresponding setting in the ``strictdoc.toml`` configuration file:
3078+
3079+
.. code-block::
3080+
3081+
[project]
3082+
3083+
features = [
3084+
"SEARCH"
3085+
]
3086+
3087+
The web interface includes the Search screen, designed for conducting queries against a document tree. The command-line interface supports filtering of requirements and sections through the ``export`` commands.
3088+
3089+
Query engine
3090+
~~~~~~~~~~~~
3091+
3092+
.. list-table::
3093+
:align: left
3094+
:header-rows: 0
3095+
3096+
* - **MID:**
3097+
- 29ffc3e91d8045589b0837f647286128
3098+
3099+
The syntax of the search query is inspired by Python, utilizing a fixed grammar that converts search queries into corresponding Python expressions.
3100+
3101+
Important rules:
3102+
3103+
- Every query component shall start with ``node.``.
3104+
- ``and`` and ``or`` expressions must be grouped using round brackets.
3105+
- Only double quotes are accepted for strings.
3106+
3107+
.. list-table:: Query examples
3108+
:widths: 50 50
3109+
:header-rows: 1
3110+
3111+
* - **Query**
3112+
- **Description**
3113+
3114+
* - ``node.is_requirement``
3115+
- Find all requirements.
3116+
3117+
* - ``node.is_section``
3118+
- Find all sections.
3119+
3120+
* - ``node.is_root``
3121+
- Find all requirements or sections from documents with ``ROOT: True``. See :ref:`Document <SECTION-UG-Document>` for the description of the ``ROOT`` option.
3122+
3123+
* - ``(node.is_requirement and "System" in node["TITLE"])``
3124+
- Find all requirements with a TITLE that equals to "System".
3125+
3126+
* - ``(node.is_requirement and node.has_parent_requirements)``
3127+
- Find all requirements which have parent requirements.
3128+
3129+
* - ``(node.is_requirement and node.has_child_requirements)``
3130+
- Find all requirements which have child requirements.
3131+
3132+
Filtering content
3133+
~~~~~~~~~~~~~~~~~
3134+
3135+
.. list-table::
3136+
:align: left
3137+
:header-rows: 0
3138+
3139+
* - **MID:**
3140+
- d52d86750ad54ce1b3263ebb092451c0
3141+
3142+
Both ``export`` command-line interface commands support filtering documentation content with ``--filter-requirements`` and ``--filter-sections`` options.
3143+
3144+
Both options are based on the Query Engine, so the same rules that are valid for Search also apply for filtering. When a filter is applied, only the whitelisted requirements/sections will be exported.
3145+
3146+
Example:
3147+
3148+
.. code-block::
3149+
3150+
strictdoc export . --filter-requirements '"System" in node["TITLE"]'
3151+
30823152
.. _SECTION-UG-Project-statistics-screen:
30833153

30843154
Project statistics screen

docs/sphinx/source/strictdoc_03_faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ and other formats using Sphinx.
195195
If you are reading this documentation at
196196
https://strictdoc.readthedocs.io/en/latest
197197
then you are already looking at the example: this documentation stored in
198-
`strictdoc_02_faq <https://github.com/strictdoc-project/strictdoc/blob/main/docs/strictdoc_02_faq.sdoc>`_
198+
`strictdoc_03_faq <https://github.com/strictdoc-project/strictdoc/blob/main/docs/strictdoc_03_faq.sdoc>`_
199199
is converted to RST format by StrictDoc which is further converted to the HTML
200200
website by readthedocs which uses Sphinx under the hood. The
201201
``StrictDoc -> RST -> Sphinx -> PDF`` example is also generated using readthedocs:

docs/sphinx/source/strictdoc_04_release_notes.rst

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,39 @@ $$$$$$$$$$$$$
88
* - **MID:**
99
- 0dd2649ec4784c9480eac6f4aef3158b
1010

11-
This document maintains a record of all changes to StrictDoc since November 2023. It serves as a user-friendly version of the changelog, complementing the automatically generated, commit-by-commit changelog available here: `StrictDoc Changelog <https://github.com/strictdoc-project/strictdoc/blob/main/CHANGELOG.md>`_.
11+
This document maintains a record of all changes to StrictDoc since November 2023. It serves as a user-friendly version of the changelog, complementing the automatically generated, commit-by-commit changelog available as GitHub releases: `StrictDoc Releases <https://github.com/strictdoc-project/strictdoc/releases>`_.
12+
13+
Unreleased (2024-11-XX)
14+
=======================
15+
16+
.. list-table::
17+
:align: left
18+
:header-rows: 0
19+
20+
* - **MID:**
21+
- f4e63483a11b442993c47b5d0574e89b
22+
23+
This release introduces language-aware tracing between requirements and C++ source code.
24+
25+
Currently, only C++ functions can be traced using a marker like ``@relation(REQ-1, scope=function)``. The ability to add markers to classes has not yet been implemented.
26+
27+
A new export format has been added to generate a Doxygen tagfile for a documentation tree. When the tagfile is registered in the Doxygen configuration, requirements can be referenced using Doxygen keywords. For example: ``\relation{REQ-1, scope=function}``. Special thanks to @johanenglund for contributing the idea and helping to implement the solution.
28+
29+
Additionally, a minor HTML2PDF formatting issue has been resolved. Previously, RST admonitions were not rendered correctly when spanning across two pages.
30+
31+
0.3.0 (2024-11-21)
32+
==================
33+
34+
.. list-table::
35+
:align: left
36+
:header-rows: 0
37+
38+
* - **MID:**
39+
- b39a3b3d9f8640e380dad5a2fdb75d79
40+
41+
This release includes an enhancement to the feature for tracing requirements to C source code.
42+
43+
From now on, if a ``@relation`` marker is specified in a C function declaration, StrictDoc will perform its "magic" and automatically connect the referenced requirement to the corresponding C function definition. This allows a ``@relation`` marker to be placed in the main documentation block, typically located above C function declarations, while ensuring the requirement is also linked to the function definition.
1244

1345
0.2.1 (2024-11-10)
1446
==================

docs/sphinx/source/strictdoc_11_developer_guide.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,18 @@ Python code
143143
raised when it is consistently deprecated by major software platforms like
144144
Ubuntu or GitHub Actions.
145145

146-
- All developer tasks are collected in the ``tasks.py`` which is run by Invoke
147-
tool. Run the ``invoke --list`` command to see the list of available commands.
146+
- All developer tasks are collected in the ``tasks.py`` which is run by Invoke tool. Run the ``invoke --list`` command to see the list of available commands.
148147

149148
- Formatting is governed by ``black`` which reformats the code automatically
150149
when the ``invoke check`` command is run.
151150

152151
- If a string literal gets too long, it should be split into a multiline
153152
literal with each line being a meaningful word or a subsentence.
154153

155-
- For "element is non-None" checks, a full form shall be used, for example: ``if foo is not None`` instead of ``if foo``. This helps to avoid any confusion with all sorts of strings (empty or non-empty ``str``, ``Optional[str]``) that are used extensively in StrictDoc's codebase. The non-None and non-empty string check shall therefore be as follows: ``if foo is not None and len(foo) > 0``. The explicit check also applies to any other kinds of objects besides strings: ``if foo is not None`` instead of ``if foo``. Rationale: ``if foo`` makes it unclear whether the intention is to check `is not None` or also ``len(foo) > 0``.
154+
- Avoid shortening variable names unnecessarily. For example, use 'buffer' instead of 'buf', 'document' instead of 'doc', 'function' instead of 'func', 'length' instead of 'len', etc. Note: While some older parts of StrictDoc may not adhere to this guideline, they are planned to be refactored in the future.
155+
156+
- For "element is non-None" checks, a full form shall be used, for example: ``if foo is not None`` instead of ``if foo``. This helps to avoid any confusion with all sorts of strings (empty or non-empty ``str``, ``Optional[str]``) that are used extensively in StrictDoc's codebase. The non-None and non-empty string check shall therefore be as follows: ``if foo is not None and len(foo) > 0``. The explicit check also applies to any other kinds of objects besides strings: ``if foo is not None`` instead of ``if foo``. Rationale: ``if foo`` makes it unclear whether the intention is to check ``is not None`` or also ``len(foo) > 0``.
157+
156158
- For lambdas and short for loops, the recent convention is to add ``_`` to the variables of a for loop or a lambda to visually highlight their temporary use within the current scope which is done to counter the fact that these variables can leak and be used outside of the scope of the loop. Example:
157159

158160
.. code-block:: python
@@ -161,7 +163,9 @@ Python code
161163
# use a_, b_ within the loop.
162164
163165
- The function arguments with the default values shall be avoided. This convention improves the visibility of the function interfaces at the coast of increased verbosity which is the price that StrictDoc development is willing to pay, maintaining the software long-term. The all-explicit function parameters indication is especially useful when the large code refactorings are made.
166+
164167
- StrictDoc has been making a gradual shift towards a stronger type system. Although type annotations haven't been added everywhere in the codebase, it is preferred to include them for all new code that is written.
168+
165169
- If a contribution includes changes in StrictDoc's code, at least the
166170
integration-level tests should be added to the ``tests/integration``. If the
167171
contributed code needs a fine-grained control over the added behavior, adding

0 commit comments

Comments
 (0)