sphinx-needs icon indicating copy to clipboard operation
sphinx-needs copied to clipboard

Support Needs definition inside Plantuml

Open twodrops opened this issue 2 years ago • 8 comments

I would like to define Needs within a Plantuml document like this:

@startuml

'@rst
'.. comp-sw:: MyAwesomeComponent
'  :id: COMP_SW_MyAwesomeComponent
'  :status: impemented
'  :tags: sys-arch
'@endrst

component MyAwesomeComponent 

@enduml

twodrops avatar Jul 23 '22 11:07 twodrops

It could be doable with needuml. But where shall these needs get represented in the documentation? Or shall they be just "internal" and have no own representation?

danwos avatar Jul 26 '22 03:07 danwos

The usecase is to have PlantUML diagrams which are linked to other needs. Perhaps this is now possible with needuml. Will refine the usecase together with the user and get back.

twodrops avatar Jul 26 '22 05:07 twodrops

@twodrops: Any updates for this one?

danwos avatar Aug 23 '22 06:08 danwos

Sorry, I didn't manage it yet. I will invite for a joint meeting with you and the requestor so that we can directly check what is possible with needuml

twodrops avatar Aug 23 '22 09:08 twodrops

Idea:

' @rst
'
' .. req:: REQ 1
'    :id: REQ_1
'
'     Need content
' @endrst

node "compoent X" as comp_x

Directive uml_extract load everything between @rst and @endrest into the current directive position in the rest file.

danwos avatar Aug 26 '22 14:08 danwos

How about .. umlimport:: as the directive name, similar to .. needimport::

twodrops avatar Aug 26 '22 14:08 twodrops

Maybe this can be better done by a generic extension, called e.g. rst-extractor. This extension could handle every text-based file and is not specific to uml and co.

Example

.. rst-extract:: myuml.puml
   :start: @rst
   :end: @endrst 
   :remove: '

.. rst-extract:: app.py
   :start: @rststart
   :end: @rstend

Could be used for rst, md, XML, python, c, ...

Start/End arguments or comment prefixes can be configured.

danwos avatar Aug 26 '22 14:08 danwos

This will be a real cool feature. Go ahead :)

twodrops avatar Aug 26 '22 14:08 twodrops