Replies: 4 comments
-
I agree that this issue not ideal and can cause confusion (as evidenced by my issue #2224). I lean towards CH1 and CH2. Having explicit single and multi line string types (CH1) would make things much clearer and allow the StrictDoc to more meaningfully report errors. Congruence with ReqIF is a bonus too. That said, I’m unsure how CH2 would behave in GUI-driven scenarios like the one in my issue, where a field entered after the STATEMENT in the UI is saved in a way that changes how it’s interpreted. CH3 feels less compelling to me. The distinction between "meta" and "content" fields adds a layer of complexity that doesn’t seem necessary from the user perspective. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
One additional thought: the current implementation also feels quite restrictive if you want to control the ordering of fields within a requirement. Since field order affects how fields are interpreted (i.e. meta vs content), it limits flexibility - especially if there's a reason to place certain fields earlier or later for readability or consistency. |
Beta Was this translation helpful? Give feedback.
-
I'd also like to consider this distinction first. What's the meaning behind "meta" and "content"? Is this just a matter of presentation (table row vs. block, hidden vs. visible), or is there more to it? Regarding presentation
In the example of DO178,
@stanislaw When you say "multi-line", may it be you actually mean "markup"? Multi-line in my understanding is ordinary unicode text that happens to contain one ore multiple Regarding content
Does it still hold that there should be only one content field? We had multiple cases where it was not obvious which field to choose as the content field. For example, "threat" element may have fields "description" and "mitigation", where both are equally important. That said, I'd probably add a CH4:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This issue is not critical, but it sometimes creates confusion for both StrictDoc users and developers. It also adds extra development work in some cases.
Related tickets:
StrictDoc currently has only one
String
type. It does not have separate types for single-line and multi-line strings. Instead, it uses a rule based on the order of fields in a grammar element.This rule helps StrictDoc decide how to display the fields. Meta fields are shown in a single-line format (like a table). Content fields are shown in a block format (multi-line).
Current order rule
StrictDoc checks fields in this order to find the content field:
TITLE → STATEMENT → DESCRIPTION → CONTENT
If none of these fields are found, StrictDoc shows an error and exits.
Example of field syntax
SDoc supports two ways to write strings:
TITLE: Foo
STATEMENT: >>>\n ... \n<<<
But you can still write multi-line text in a single-line format (e.g.,
RATIONALE: BAZ
).TL;DR
Main question:
Can we find a better way to decide if a field is a meta field or a content field, instead of using the current field order rule?
Pros of the current rule
P1) Once a user learns the rule, it's easy to write documents that follow it.
Most documents will include either of {
STATEMENT
,DESCRIPTION
,CONTENT
}, or at least aTITLE
.Problems with the current rule
P1) Compatibility with other tools
This rule is unique to StrictDoc. Other formats like Excel or ReqIF may not follow the same field order.
P2) Mismatch with typed formats
Some formats support string types directly. For example, ReqIF supports:
String
: used for short, single-line textXHTML
: used for longer, multi-line textExample from ReqIF:
StrictDoc has to guess where to place each field (above or below the content field), which is not ideal.
P3) Mixing of two different ideas
StrictDoc currently combines two ideas:
This is too implicit and can cause confusion.
P4) Edge cases not supported
If a document doesn’t have any of the known fields (
STATEMENT
,DESCRIPTION
,CONTENT
,TITLE
), StrictDoc fails. This can happen with custom or experimental documents.Ideas for Improving SDoc
Each idea solves some of the problems, but also has trade-offs.
CH1) Add two new types:
SinglelineString
andMultilineString
String
type.CH2) Enforce strict syntax rules for strings
>>> <<<
for multi-line text.>>> <<<
.See also from #1900 (comment):
CH3) Add a
META: True
field propertyIf we do nothing
If we keep the current behavior:
For formats like Excel, treat all fields as content (non-meta) by default.
Let the user specify which fields should be treated as meta. This is not implemented yet.
For ReqIF, use this rule:
String
→ meta fields (go above the content)XHTML
→ content fields (go below the content)Any feedback is appreciated.
Beta Was this translation helpful? Give feedback.
All reactions