strictdoc
strictdoc copied to clipboard
Issue with Mixing FREETEXT and REQUIREMENT in .sdoc Files
Environment
StrictDoc Version: 0.0.47 Python Version: 3.11.6
Description:
I've encountered an issue when working with .sdoc files in StrictDoc. The problem arises when I attempt to use a mix of FREETEXT and REQUIREMENT elements in a single document. It would be great if the document allowed alternating between these two types of tags, but currently, this does not seem to be supported.
Steps to Reproduce:
-
Create a .sdoc file.
-
Insert the following content:
[DOCUMENT]
TITLE: TestDoc
[GRAMMAR]
ELEMENTS:
- TAG: REQUIREMENT
FIELDS:
- TITLE: UID
TYPE: String
REQUIRED: True
- TITLE: TITLE
TYPE: String
REQUIRED: True
- TITLE: STATEMENT
TYPE: String
REQUIRED: False
[FREETEXT]
Test
[/FREETEXT]
[REQUIREMENT]
UID: TEST-0111
TITLE: T1
STATEMENT: Test
[FREETEXT]
Test
[/FREETEXT]
- Try to run the StrictDoc server
Error
raise self.nm
arpeggio.NoMatch: Expected Not at position ../strictdoc/TestDoc.sdoc:(30, 2) => 'T: Test [*FREETEXT] '.
Was this intended or is there something I am missing?
This is a known issue. Currently, the grammar of StrictDoc is hardcoded to always have free texts to be the first nodes in Document or Section. There was another user's report where they also wanted this to be more flexible.
Changing it to the way you are suggesting is easily doable, and I will prioritize it to be done this year still.
One thing that could help us during the implementation:
So far I haven't seen a document where a free text would be between the surrounding requirements or a free text would be the last one in a section or a document. Could you give an example of your immediate use case?
In other words, I would like to understand which kind of information requires these in-between free texts? It doesn't have to be your real work example but something that gives me an idea. Thanks.
I ran into the same issue while manually translating a pretty unstructured text document into sdoc. Something like this:
This may not happen under one of the following conditions:
- Situation
- Situation
Short sidebar discussion about 2
- Situation
Longer discussion about all of the above
I wanted to translate the three numbered items into requirements, and the other items into freetexts.
Same use case for me. Unstructured documents some type of information in the middle between requirements or a footer with extra notes about the document.
[DOCUMENT]
TITLE: TestDoc
[GRAMMAR]
ELEMENTS:
- TAG: REQUIREMENT
FIELDS:
- TITLE: UID
TYPE: String
REQUIRED: True
- TITLE: TITLE
TYPE: String
REQUIRED: True
- TITLE: STATEMENT
TYPE: String
REQUIRED: False
[REQUIREMENT]
UID: TEST-0111
TITLE: T1
STATEMENT: Test
[FREETEXT]
A footer
[/FREETEXT]
Ok, understood. Thanks @dahbar and @rosensymmetri.
@mettta and I are already discussing the implementation. I don't want to give false promises but I think we could do it within January or probably much sooner.
Closed with the release: https://github.com/strictdoc-project/strictdoc/releases/tag/0.0.57. Please see the release notes.