Skip to content

Is it possible to build sub-documents while still reference global ..item:: IDs? #364

@passeris

Description

@passeris

I have a CMake project and would like to build individual component specification documents in addition to the entire documentation. I have a CMake target setup and it builds fine, the only problem is that the document is located in a subfolder, when the sphinx-build starts, mlx.traceability does not know about requirements IDs outside of the folder containing the master_doc which is set to the component design document. That leads to warnings like:

[build] WARNING: Item '!REQ-27883' has no reference to source document.

The folder structure is like this:

Project
   software-packages
      compositionA
         componentA (I define the master_doc to be componentA.rst in my CMake target)
         componentB
   requirements-views
      software_requirements.rst (here is where !REQ-27833 is defined)

My CMake target looks like this:

add_custom_target(
    componentA-html
    ${SPHINX_EXECUTABLE}
    -w error.log
    -q
    -b
    html
    -c
    "${BINARY_BUILD_DIR}"
    -d
    "${SPHINX_CACHE_DIR}"
    "${CMAKE_CURRENT_SOURCE_DIR}"
    "${SPHINX_HTML_DIR}/domain/subsystems/driving-functions/Project"
    -D 
    master_doc=componentA
    COMMENT "Building HTML documentation with Sphinx"
)

The variables are defined as follows:

BINARY_BUILD_DIR => /domain/build/_build
SPHINX_CACHE_DIR => /domain/build/_doctrees
CMAKE_CURRENT_SOURCE_DIR => /domain/subsystems/driving-functions/Project/software-packages/compositionA/ComponentA
SPHINX_HTML_DIR => /domain/build/doc/user-doc/html

The above will output an html document to folder Project, but that comes at the price of a warning. If I build the entire domain however (our overall and comprehensive document including all other subsystems), I will not get that warning because mlx knows about the IDs. I'm trying to save time however in builds and would like to rapidly build component level documents, kind of like what AUTOSAR does with their software components like Pwm driver, Com, Rte, and others. These documents are then indenpendently reviewable and stand on their own.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions