Requirement Identifiers

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jul 18 13:36:02 UTC 2019


On 11/07/2019 15:44, Sebastian Huber wrote:
> On 11/07/2019 15:19, Joel Sherrill wrote:
>> Early on, we discussed that there wasn't a Rest backend to Doorstop. 
>> If we are having
>> to add that anyway, can each "category" be generated as a chapter?
>>
>> We could generate 100+ chapters but we can't have 100+ requirements 
>> documents.
> 
> We will have custom attributes, such as type and verification-method, so 
> we need a custom documentation generator anyway:
> 
> YAML files -> Doorstop -> Custom Translator -> Sphinx/ReST -> PDF | HTML
> 
> It will be sections or chapters not documents.

I just had a look at Doorstop to figure out how difficult it is to write 
a custom translator. It is very easy. The following script visits all 
items of a Doorstop document hierarchy loaded from the current 
directory. In the ItemVisitor() you can aggregate all the data you need 
and then dump it in your custom format. This is currently not documented:

https://github.com/jacebrowning/doorstop/blob/develop/docs/api/scripting.md

If we start to use this, then we should improve the Doorstop documentation.

Here is the script:

from doorstop.core.builder import build

class ItemVisitor:
     def __call__(self, item, document, tree):
         print(f"item {item} document {document} tree {tree}")
         return
         yield

tree = build()
tree.load()
tree.validate(item_hook=ItemVisitor())

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


More information about the devel mailing list