### Install snapcraft Source: https://github.com/strictdoc-project/strictdoc/blob/main/developer/snap/README.md Installs the snapcraft tool using apt. This is a prerequisite for building snap packages. ```bash sudo apt install snapcraft ``` -------------------------------- ### StrictDoc Server Uvicorn Output Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md This is an example of the expected output when starting the StrictDoc server. It indicates that Uvicorn is running and provides the local URL to access the documentation. ```text INFO: Uvicorn running on http://127.0.0.1:5111 (Press CTRL+C to quit) ``` -------------------------------- ### Download and install strictdoc snap package Source: https://github.com/strictdoc-project/strictdoc/blob/main/developer/snap/README.md Downloads a snap package using wget and then installs it in development mode. This is an alternative installation method if the snap is available remotely. ```bash wget path-to-the-built-strictdoc_0.0.18_amd64.snap sudo snap install strictdoc_*.snap --devmode --dangerous ``` -------------------------------- ### Start StrictDoc Server Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Run the 'strictdoc server' command to start a local development server for your documentation. This command is executed from the directory containing your exported documentation. ```bash strictdoc server . ``` -------------------------------- ### Parent Requirement Example Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Example of a parent requirement with a UID and statement. ```default [REQUIREMENT] UID: PARENT-1 TITLE: Parent requirement STATEMENT: >>> ... <<< ``` -------------------------------- ### Install StrictDoc Source: https://github.com/strictdoc-project/strictdoc/blob/main/README.md Installs StrictDoc using pip. Requires Python 3.10 or newer. ```bash pip install strictdoc ``` -------------------------------- ### Install StrictDoc from GitHub (Developer Mode) Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_11_developer_guide.md Clones the StrictDoc repository, installs its dependencies, and provides a command to run the CLI directly. Use this for making source code changes. ```bash git clone https://github.com/strictdoc-project/strictdoc.git && cd strictdoc python developer/pip_install_strictdoc_deps.py python3 strictdoc/cli/main.py ``` -------------------------------- ### Install strictdoc snap package Source: https://github.com/strictdoc-project/strictdoc/blob/main/developer/snap/README.md Installs the built strictdoc snap package in development mode. This command requires root privileges and the '--dangerous' flag. ```bash sudo snap install strictdoc_*.snap --devmode --dangerous ``` -------------------------------- ### Create a StrictDoc file Source: https://github.com/strictdoc-project/strictdoc/blob/main/README.md Example of a minimal StrictDoc file with a document title and a requirement. ```text [DOCUMENT] TITLE: StrictDoc [REQUIREMENT] UID: SDOC-HIGH-REQS-MANAGEMENT TITLE: Requirements management STATEMENT: StrictDoc shall enable requirements management. ``` -------------------------------- ### Doxygen TAGFILE Example Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md An example of a Doxygen TAGFILE in XML format used for linking to external documentation. ```default REQ-1 strictdocfolder/mystrictdocreq.html#REQ-1 ``` -------------------------------- ### Install libtidy on Linux Ubuntu Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_11_developer_guide.md Installs the libtidy package required for HTML markup validation tests on Ubuntu systems. ```bash sudo apt install tidy ``` -------------------------------- ### Run StrictDoc development server Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_11_developer_guide.md Execute this command to start the StrictDoc development server from the project's root directory. ```bash invoke server ``` -------------------------------- ### Install Nightly Build of StrictDoc using Pip Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Install the latest development version of StrictDoc directly from the Git repository. Use this for access to the newest features and fixes before they are released to stable. ```default pip install -U --pre git+https://github.com/strictdoc-project/strictdoc.git@main ``` -------------------------------- ### Doxygen Configuration for TAGFILES Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Example configuration for Doxygen to specify the location of StrictDoc tagfiles. ```text TAGFILES = strictdoc.tag=../../strictdoc ``` -------------------------------- ### Install Core Python Dependencies Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_11_developer_guide.md Installs essential Python packages like Invoke, Tox, and TOML required for StrictDoc development. ```bash pip install invoke tox toml ``` -------------------------------- ### Run StrictDoc local web server Source: https://github.com/strictdoc-project/strictdoc/blob/main/README.md Starts the StrictDoc local web server. The server runs on http://127.0.0.1:5111 by default. ```bash strictdoc server . ``` -------------------------------- ### Sample Requirement Block Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md A basic example of a [REQUIREMENT] block with a TITLE and STATEMENT. ```text [DOCUMENT] TITLE: StrictDoc [REQUIREMENT] UID: SDOC-HIGH-DATA-MODEL STATEMENT: STATEMENT: StrictDoc shall be based on a well-defined data model. ``` -------------------------------- ### Example REVERSE_ROLE Grammar Source: https://github.com/strictdoc-project/strictdoc/blob/main/developer/tasks/20260610_add_reverse_role_name_support_feat_2755/task.md This example demonstrates how to define a REVERSE_ROLE for a Parent relation in the StrictDoc grammar. The REVERSE_ROLE is optional and only used for display purposes. ```yaml RELATIONS: - TYPE: Parent ROLE: Refines REVERSE_ROLE: Refined by ``` -------------------------------- ### Project Configuration for Traceability Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Example of creating a ProjectConfig object in Python to enable the REQUIREMENT_TO_SOURCE_TRACEABILITY feature. This is used for language-aware parsing and traceability. ```python from strictdoc.core.project_config import ProjectConfig def create_config() -> ProjectConfig: config = ProjectConfig( project_features=[ "REQUIREMENT_TO_SOURCE_TRACEABILITY" ], ) return config ``` -------------------------------- ### FREETEXT to TEXT Migration Example Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Demonstrates the conversion of a FREETEXT node to a TEXT node during the FREETEXT-TEXT migration in StrictDoc. ```plaintext [FREETEXT] This is a free text node. [/FREETEXT] ``` ```plaintext [TEXT] STATEMENT: >>> This is a free text node. <<< ``` -------------------------------- ### Custom SDoc Grammar Definition Example Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md This example demonstrates how to declare a custom grammar with various field types including String, SingleChoice, MultipleChoice, Tag, and Relations. It shows the structure for defining elements and their fields. ```text [DOCUMENT] TITLE: How to declare a custom grammar [GRAMMAR] ELEMENTS: - TAG: TEXT FIELDS: - TITLE: UID TYPE: String REQUIRED: False - TITLE: STATEMENT TYPE: String REQUIRED: True - TAG: REQUIREMENT FIELDS: - TITLE: UID TYPE: String REQUIRED: True - TITLE: ASIL TYPE: SingleChoice(A, B, C, D) REQUIRED: True - TITLE: VERIFICATION TYPE: MultipleChoice(Review, Analysis, Inspection, Test) REQUIRED: True - TITLE: UNIT TYPE: Tag REQUIRED: True - TITLE: TITLE TYPE: String REQUIRED: True - TITLE: STATEMENT TYPE: String REQUIRED: True - TITLE: COMMENT TYPE: String REQUIRED: True REQUIRED: True RELATIONS: - Type: Parent - Type: File [TEXT] STATEMENT: >>> This document is an example of a simple SDoc custom grammar. <<< [REQUIREMENT] UID: ABC-123 ASIL: A VERIFICATION: Review, Test UNIT: OBC, RTU TITLE: Function B STATEMENT: System A shall do B. COMMENT: Test comment. RELATIONS: - TYPE: Parent VALUE: REQ-001 - TYPE: File VALUE: /full/path/file.py ``` -------------------------------- ### Doxygen Configuration for Absolute URL TAGFILES Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Example configuration for Doxygen to specify an absolute URL for StrictDoc tagfiles. ```text TAGFILES = strictdoc.tag=http://example.com/strictdoc ``` -------------------------------- ### StrictDoc Export Command Output Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md This is an example of the expected output when running the 'strictdoc export' command. It shows the progress and completion of the export process. ```text $ strictdoc export hello.sdoc Parallelization: Enabled Step 'Collect traceability information' start Step 'Find and read SDoc files' start Reading SDOC: hello.sdoc .................................... 0.08s Step 'Find and read SDoc files' took: 0.09 sec Step 'Collect traceability information' start Step 'Collect traceability information' took: 0.01 sec Step 'Collect traceability information' took: 0.11 sec Published: StrictDoc ........................................ 0.24s ... Export completed. Documentation tree can be found at: .../output/html ``` -------------------------------- ### Create a Basic StrictDoc File Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md This is an example of the SDoc text language used to define a document title and a requirement. Ensure the file ends with a newline character. ```text [DOCUMENT] TITLE: StrictDoc [REQUIREMENT] UID: SDOC-HIGH-REQS-MANAGEMENT TITLE: Requirements management STATEMENT: StrictDoc shall enable requirements management. ``` -------------------------------- ### Minimal SDoc Document Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md A basic example of an SDoc document structure, including the mandatory document declaration and title. ```text [DOCUMENT] TITLE: StrictDoc ``` -------------------------------- ### Document with Grammar from File Source: https://github.com/strictdoc-project/strictdoc/blob/main/developer/tasks/20260607_markdown_grammar/task.md Example of a Markdown document specifying its grammar by referencing a file path. ```markdown # Document example **Grammar**: `requirements.gra.md` ``` -------------------------------- ### Valid Document Structure Example Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md A valid SDoc document structure, demonstrating the required [DOCUMENT] element followed by a title. ```text [DOCUMENT] TITLE: StrictDoc (newline) ``` -------------------------------- ### Display Math Example in Markdown Source: https://github.com/strictdoc-project/strictdoc/blob/main/developer/tasks/20260613_math_formulas_in_markdown/task.md Shows how to use double dollar signs for display mathematical formulas in Markdown. This syntax renders the formula on its own line, typically centered. ```markdown The total mass shall satisfy $m_t = m_d + m_p \le 160\,kg$. ``` -------------------------------- ### SDoc Multiline String Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_02_feature_map.md Shows the custom solution in SDoc for declaring multiline strings, using '>>>' to delimit the start and end. ```default [REQUIREMENT] TITLE: Requirement ABC STATEMENT: >>> The multiline requirement statement without any nesting. >>> ``` -------------------------------- ### SDoc Requirement Block Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_02_feature_map.md Example of defining a requirement using SDoc markup, inspired by TOML's bracket syntax for blocks. ```default [REQUIREMENT] TITLE: Requirement ABC STATEMENT: The system A shall do B when C. ``` -------------------------------- ### Inline Math Example in Markdown Source: https://github.com/strictdoc-project/strictdoc/blob/main/developer/tasks/20260613_math_formulas_in_markdown/task.md Demonstrates how to use single dollar signs for inline mathematical formulas within a Markdown document. The content between the dollar signs is treated as LaTeX. ```markdown The spacecraft dry mass is $m_d = 120\,kg$ and the propellant mass is $m_p = 30\,kg$. ``` -------------------------------- ### Requirement with MID and UID Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Example of a requirement node showing both a Machine Identifier (MID) and a Unique Identifier (UID). MIDs provide a stable, independent way to identify nodes. ```default [REQUIREMENT] MID: 06ab121d3c0f4d8c94652323b8f735c6 UID: SDOC-SSS-70 STATUS: Active TITLE: Move nodes between documents STATEMENT: >>> The Requirements Tool shall allow moving nodes (sections, requirements) between documents. <<< ``` -------------------------------- ### Server Command Help Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Discover the available options for the server command to configure the StrictDoc web server. ```bash strictdoc server --help ``` -------------------------------- ### Enable All StrictDoc Features Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md To activate all available features, both stable and experimental, set the 'features' option to 'ALL_FEATURES'. This ensures all screens and buttons are generated. ```default [project] features = [ "ALL_FEATURES" ] ``` -------------------------------- ### Build strictdoc snap package Source: https://github.com/strictdoc-project/strictdoc/blob/main/developer/snap/README.md Builds the strictdoc snap package from the source code. Ensure you are in the './snap' directory. ```bash snapcraft ``` -------------------------------- ### Run Integration Tests Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_11_developer_guide.md Execute integration tests using the invoke command. Use the --focus parameter to run specific tests. ```bash invoke test-integration ``` ```bash invoke test-integration --focus ``` -------------------------------- ### Document with Requirement Node Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Example of a StrictDoc document defining a REQUIREMENT node with a title and statement. ```text [DOCUMENT] TITLE: StrictDoc [REQUIREMENT] TITLE: Requirements management STATEMENT: StrictDoc shall enable requirements management. ``` -------------------------------- ### Export Command Help Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Explore the options for the export command, which is the primary producer of documentation in various formats like HTML, RST, and Excel. ```bash strictdoc export --help ``` -------------------------------- ### Child Requirement Referencing Parent Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Example of a child requirement that establishes a 'Parent' relation to another requirement. ```default [REQUIREMENT] UID: CHILD-1 TITLE: Child requirement STATEMENT: >>> ... <<< RELATIONS: - TYPE: Parent VALUE: PARENT-001 ``` -------------------------------- ### Document with Text Node Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Example of a StrictDoc document containing a basic TEXT node for arbitrary content. ```text [DOCUMENT] TITLE: StrictDoc [TEXT] STATEMENT: >>> StrictDoc is software for technical documentation. <<< ``` -------------------------------- ### Document with Node in TOC Option Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Example of a StrictDoc document configuration setting the NODE_IN_TOC option to True. ```text [DOCUMENT] TITLE: Hello world OPTIONS: NODE_IN_TOC: True ``` -------------------------------- ### Document with Registered Grammar Alias Source: https://github.com/strictdoc-project/strictdoc/blob/main/developer/tasks/20260607_markdown_grammar/task.md Example of a Markdown document specifying its grammar using a pre-registered alias. ```markdown # Document example **Grammar**: `@requirements` ``` -------------------------------- ### Establish WebSocket Connection Source: https://github.com/strictdoc-project/strictdoc/blob/main/strictdoc/export/html/templates/websocket.jinja.html Sets up a WebSocket connection to the server. This code should be used when StrictDoc is running in a server environment. It dynamically determines the WebSocket protocol and URL based on the current window location. ```javascript var clientId = Date.now(); var ws_protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; var ws = new WebSocket(`${ws_protocol}//${window.location.host}/ws/${clientId}`); ``` -------------------------------- ### Document with Inline View Style Option Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Example of a StrictDoc document configuration setting the VIEW_STYLE option to Inline. ```text [DOCUMENT] TITLE: Hello world OPTIONS: VIEW_STYLE: Inline ``` -------------------------------- ### Import Grammar from File Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Shows how to import a grammar definition from an external '.sgra' file into a StrictDoc document. ```default [DOCUMENT] TITLE: Document 1 [GRAMMAR] IMPORT_FROM_FILE: grammar.sgra [REQUIREMENT] TITLE: Requirement title STATEMENT: >>> Requirement statement. <<< ``` -------------------------------- ### Mermaid Pie Chart Source: https://github.com/strictdoc-project/strictdoc/blob/main/tests/end2end/screens/document/view_document/view_document_with_markdown_mermaid/document.md A Mermaid pie chart example. This snippet visualizes data using a pie chart. ```mermaid pie title What Voldemort doesn't have? "FRIENDS" : 2 "FAMILY" : 3 "NOSE" : 45 ``` -------------------------------- ### Basic Document Structure with Sections Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Demonstrates the use of the [SECTION] element to create document chapters and group requirements. This is analogous to Markdown headings. ```text [DOCUMENT] TITLE: StrictDoc [SECTION] TITLE: High-level requirements [REQUIREMENT] UID: HIGH-001 STATEMENT: ... [/SECTION] [SECTION] TITLE: Implementation requirements [REQUIREMENT] UID: IMPL-001 STATEMENT: ... [/SECTION] ``` -------------------------------- ### Reference File from Requirement Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Define a 'File' relation in a requirement to link it to a specific source file. ```text [REQUIREMENT] UID: REQ-001 RELATIONS: - TYPE: File VALUE: file.py TITLE: File reference STATEMENT: This requirement references the file. ``` -------------------------------- ### Invalid Multiline Field with Empty Content Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md An example of invalid SDoc syntax for a multiline field (COMMENT) with no content between the delimiters. ```default [REQUIREMENT] COMMENT: >>> <<< ``` -------------------------------- ### List Available Invoke Tasks Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_11_developer_guide.md Displays all available development tasks managed by Invoke in the project's tasks.py file. ```bash invoke --list ``` -------------------------------- ### Generate Documentation Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_11_developer_guide.md Use the invoke docs task to regenerate documentation on a developer machine. ```bash invoke docs ``` -------------------------------- ### Enable MathJax Feature Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Activate MathJax support in StrictDoc by adding 'MATHJAX' to the 'features' list in the strictdoc.toml configuration file. ```TOML [project] title = "My project" features = [ "MATHJAX" ] ``` -------------------------------- ### Regenerate JUnit XML Fixtures Source: https://github.com/strictdoc-project/strictdoc/blob/main/tests/integration/features/test_reports/junit_xml/nextest/README.md Execute this shell script from the current directory to regenerate all JUnit XML fixtures. Ensure cargo-nextest is installed. ```shell ./regenerate.sh ``` -------------------------------- ### Navigate to StrictDoc File Directory Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Change the current directory to the location of your StrictDoc file. Replace '' with the actual path. ```bash cd /workspace/hello_world ``` -------------------------------- ### Configure StrictDoc Server Host and Port Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md This snippet demonstrates how to configure the server's host and port using the '[server]' section. By default, StrictDoc runs on '127.0.0.1:5111'. ```yaml [project] title = 'Test project with a host "localhost" and a port 5000' [server] host = "localhost" port = 5000 ``` -------------------------------- ### Link Code Range to Requirement (Python) Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Use these markers in Python code to define the start and end of a code range linked to a requirement. ```python def foo(): # @relation(REQ-1, scope=range_start) print("Hello, World!") # @relation(REQ-1, scope=range_end) ``` -------------------------------- ### Defining Requirement Relations Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md Illustrates how to define relations between requirements using TYPE and VALUE attributes. Supports Parent, Child, and File relation types. Circular references are not allowed. ```text [DOCUMENT] TITLE: StrictDoc [REQUIREMENT] UID: REQ-001 STATEMENT: StrictDoc shall enable requirements management. [REQUIREMENT] UID: REQ-002 TITLE: Requirement #2's title STATEMENT: Requirement #2 statement RELATIONS: - TYPE: Parent VALUE: REQ-001 - TYPE: File VALUE: /full/path/file.py ``` -------------------------------- ### Enable Project Statistics Screen Feature Source: https://github.com/strictdoc-project/strictdoc/blob/main/docs/sphinx/source/strictdoc_01_user_guide.md To activate the project statistics screen, add/edit the strictdoc.toml config file in the root of your repository and enable the "PROJECT_STATISTICS_SCREEN" feature. ```toml [project] title = "My project" features = [ "PROJECT_STATISTICS_SCREEN" ] ```