Skip to content

new feature FRAGMENT_FROM_FILE #629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 73 additions & 4 deletions docs/sphinx/source/strictdoc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,79 @@ Special feature of ``[COMPOSITE_REQUIREMENT]``: like ``[SECTION]`` element, the
often, a more basic combination of nested ``[SECTION]`` and ``[REQUIREMENT]``
elements should do the job.

Include files
~~~~~~~~~~~~~

StrictDoc ``.sdoc`` files can be built-up from including other fragment documents.

The ``[FRAGMENT_FROM_FILE]`` element can be used anywhere body elements can be
used ( e.g.``[SECTION]``, ``[REQUIREMENT``, ``[COMPOSITE_REQUIREMENT]`` etc.) and will
evaluate by inserting its contents from the file referenced by its ``FILE:`` property
where it was used in the parent document. The files included must start with a ``[FRAGMENT]``
directive and cannot contain ``[FREETEXT]`` elements but are otherwise identical to
``*.sdoc`` files. They can have any filename except a``.sdoc`` extension.

Here is an example pair of files similar to examples above. First the
``.sdoc`` file has a ``[FRAGMENT_FROM_FILE]`` that references the latter file.

.. code-block:: text

[DOCUMENT]
TITLE: StrictDoc

[FREETEXT]
...
[/FREETEXT]

[FRAGMENT_FROM_FILE]
FILE: include.ssec

[REQUIREMENT]

Then the referenced file, ``include.ssec``:

.. code-block:: text

[FRAGMENT]

[REQUIREMENT]

[SECTION]
TITLE: Sub section
[/SECTION]

[COMPOSITE_REQUIREMENT]

[REQUIREMENT]

[/COMPOSITE_REQUIREMENT]

Which will resolve to the following document after inclusion:

.. code-block:: text

[DOCUMENT]
TITLE: StrictDoc

[FREETEXT]
...
[/FREETEXT]

[REQUIREMENT]

[SECTION]
TITLE: Sub section
[/SECTION]

[COMPOSITE_REQUIREMENT]

[REQUIREMENT]

[/COMPOSITE_REQUIREMENT]

[REQUIREMENT]


Custom grammars
---------------

Expand Down Expand Up @@ -879,10 +952,6 @@ Planned formats:
`ReqIF Implementation Guide <https://www.prostep.org/fileadmin/downloads/PSI_ImplementationGuide_ReqIF_V1-7.pdf>`_
that attempts to harmonize the developments of ReqIF by requirements
management tools.
- `ProR <http://pror.org>`_
- Doors
- Enterprise Architect
- and others

Import flow (ReqIF -> SDoc):
----------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@
4.2.4
</span>
Composite requirement
</span></li><li><span class="toc-title-no-link" title="Section has no requirements">
<span class="section-number">
4.2.5
</span>
Include files
</span></li></ul>
</li><li><span class="toc-title-no-link" title="Section has no requirements">
<span class="section-number">
Expand Down
91 changes: 87 additions & 4 deletions docs/strictdoc-html/strictdoc-html/docs/strictdoc-TABLE.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
</li><li><a href="#4.2.4-Composite-requirement">
<span class="section-number">4.2.4</span>
Composite requirement
</a></li><li><a href="#4.2.5-Include-files">
<span class="section-number">4.2.5</span>
Include files
</a></li></ul>
</li><li><a href="#4.3-Custom-grammars">
<span class="section-number">4.3</span>
Expand Down Expand Up @@ -1519,6 +1522,90 @@

</div></section>

</article>
<article class="docsection">

<section data-section="meta" class="docsection_section">

<div data-role='anchor' id="4.2.5-Include-files"></div>


<h3
class="section-title"
data-level="4.2.5"
>Include files
</h3>


</section>

<section data-section="description" class="docsection_section"><div class="free-text">
<div class="document">
<p>StrictDoc <tt class="docutils literal">.sdoc</tt> files can be built-up from including other fragment documents.</p>
<p>The <tt class="docutils literal">[FRAGMENT_FROM_FILE]</tt> element can be used anywhere body elements can be
used ( e.g.``[SECTION]``, <tt class="docutils literal">[REQUIREMENT</tt>, <tt class="docutils literal">[COMPOSITE_REQUIREMENT]</tt> etc.) and will
evaluate by inserting its contents from the file referenced by its <tt class="docutils literal">FILE:</tt> property
where it was used in the parent document. The files included must start with a <tt class="docutils literal">[FRAGMENT]</tt>
directive and cannot contain <tt class="docutils literal">[FREETEXT]</tt> elements but are otherwise identical to
<tt class="docutils literal">*.sdoc</tt> files. They can have any filename except a``.sdoc`` extension.</p>
<p>Here is an example pair of files similar to examples above. First the
<tt class="docutils literal">.sdoc</tt> file has a <tt class="docutils literal">[FRAGMENT_FROM_FILE]</tt> that references the latter file.</p>
<pre class="code text literal-block">
[DOCUMENT]
TITLE: StrictDoc

[FREETEXT]
...
[/FREETEXT]

[FRAGMENT_FROM_FILE]
FILE: include.ssec

[REQUIREMENT]
</pre>
<p>Then the referenced file, <tt class="docutils literal">include.ssec</tt>:</p>
<pre class="code text literal-block">
[FRAGMENT]

[REQUIREMENT]

[SECTION]
TITLE: Sub section
[/SECTION]

[COMPOSITE_REQUIREMENT]

[REQUIREMENT]

[/COMPOSITE_REQUIREMENT]
</pre>
<p>Which will resolve to the following document after inclusion:</p>
<pre class="code text literal-block">
[DOCUMENT]
TITLE: StrictDoc

[FREETEXT]
...
[/FREETEXT]

[REQUIREMENT]

[SECTION]
TITLE: Sub section
[/SECTION]

[COMPOSITE_REQUIREMENT]

[REQUIREMENT]

[/COMPOSITE_REQUIREMENT]

[REQUIREMENT]
</pre>
</div>

</div></section>

</article>
<article class="docsection">

Expand Down Expand Up @@ -2081,10 +2168,6 @@
<a class="reference external" href="https://www.prostep.org/fileadmin/downloads/PSI_ImplementationGuide_ReqIF_V1-7.pdf">ReqIF Implementation Guide</a>
that attempts to harmonize the developments of ReqIF by requirements
management tools.</li>
<li><a class="reference external" href="http://pror.org">ProR</a></li>
<li>Doors</li>
<li>Enterprise Architect</li>
<li>and others</li>
</ul>
</div>

Expand Down
96 changes: 92 additions & 4 deletions docs/strictdoc-html/strictdoc-html/docs/strictdoc-TRACE.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@
</li><li><a href="#4.2.4-Composite-requirement">
<span class="section-number">4.2.4</span>
Composite requirement
</a></li><li><a href="#4.2.5-Include-files">
<span class="section-number">4.2.5</span>
Include files
</a></li></ul>
</li><li><a href="#4.3-Custom-grammars">
<span class="section-number">4.3</span>
Expand Down Expand Up @@ -1645,6 +1648,95 @@

</div></section>

</article></div>
<div class="content_item" data-role="children"></div>
</section>
<section class="content_section">

<div class="content_item" data-role="parents"></div>
<div class="content_item" data-role="current"><article class="docsection">

<section data-section="meta" class="docsection_section">

<div data-role='anchor' id="4.2.5-Include-files"></div>


<h3
class="section-title"
data-level="4.2.5"
>Include files
</h3>


</section>

<section data-section="description" class="docsection_section"><div class="free-text">
<div class="document">
<p>StrictDoc <tt class="docutils literal">.sdoc</tt> files can be built-up from including other fragment documents.</p>
<p>The <tt class="docutils literal">[FRAGMENT_FROM_FILE]</tt> element can be used anywhere body elements can be
used ( e.g.``[SECTION]``, <tt class="docutils literal">[REQUIREMENT</tt>, <tt class="docutils literal">[COMPOSITE_REQUIREMENT]</tt> etc.) and will
evaluate by inserting its contents from the file referenced by its <tt class="docutils literal">FILE:</tt> property
where it was used in the parent document. The files included must start with a <tt class="docutils literal">[FRAGMENT]</tt>
directive and cannot contain <tt class="docutils literal">[FREETEXT]</tt> elements but are otherwise identical to
<tt class="docutils literal">*.sdoc</tt> files. They can have any filename except a``.sdoc`` extension.</p>
<p>Here is an example pair of files similar to examples above. First the
<tt class="docutils literal">.sdoc</tt> file has a <tt class="docutils literal">[FRAGMENT_FROM_FILE]</tt> that references the latter file.</p>
<pre class="code text literal-block">
[DOCUMENT]
TITLE: StrictDoc

[FREETEXT]
...
[/FREETEXT]

[FRAGMENT_FROM_FILE]
FILE: include.ssec

[REQUIREMENT]
</pre>
<p>Then the referenced file, <tt class="docutils literal">include.ssec</tt>:</p>
<pre class="code text literal-block">
[FRAGMENT]

[REQUIREMENT]

[SECTION]
TITLE: Sub section
[/SECTION]

[COMPOSITE_REQUIREMENT]

[REQUIREMENT]

[/COMPOSITE_REQUIREMENT]
</pre>
<p>Which will resolve to the following document after inclusion:</p>
<pre class="code text literal-block">
[DOCUMENT]
TITLE: StrictDoc

[FREETEXT]
...
[/FREETEXT]

[REQUIREMENT]

[SECTION]
TITLE: Sub section
[/SECTION]

[COMPOSITE_REQUIREMENT]

[REQUIREMENT]

[/COMPOSITE_REQUIREMENT]

[REQUIREMENT]
</pre>
</div>

</div></section>

</article></div>
<div class="content_item" data-role="children"></div>
</section>
Expand Down Expand Up @@ -2272,10 +2364,6 @@
<a class="reference external" href="https://www.prostep.org/fileadmin/downloads/PSI_ImplementationGuide_ReqIF_V1-7.pdf">ReqIF Implementation Guide</a>
that attempts to harmonize the developments of ReqIF by requirements
management tools.</li>
<li><a class="reference external" href="http://pror.org">ProR</a></li>
<li>Doors</li>
<li>Enterprise Architect</li>
<li>and others</li>
</ul>
</div>

Expand Down
Loading