Skip to content

Custom, extensible needflow #443

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

Closed
danwos opened this issue Dec 13, 2021 · 1 comment
Closed

Custom, extensible needflow #443

danwos opened this issue Dec 13, 2021 · 1 comment

Comments

@danwos
Copy link
Member

danwos commented Dec 13, 2021

Currently needflow draws everything based on a given filter.
But there are scenarios, where a user wants to manipulate or extend this drawing, before it gets finally realized in the documentation.

Use cases are:

  • Add hints to specific needs
  • Set own links between needs
  • Add single needs (could be done by adding a "... id=='NEED_ID'" to the filter, but there must be easier ways)
  • Build own views of need objects.

You can do all this already, by just using planutml and define a picture completely by hand.
But there must be easier, more stable and reliable ways to get it done.

So here is the idea:

Technical concept

Provide a new directive needuml, which content takes a PlantUML definition.
So it acts as the uml directive form sphinxcontrib.plantuml.

But it has some special features, which manipulates the given plantuml-code.

Ideas:

.. needuml::
  
   [[def(type=="req")]]
   [[def_list(ID_1, ID_123)]]

   [[links(type=="req")]]

   card "my_own_card" as my_card
   my_card -> ID_1

This gets "translated" to:

.. uml::

   ` Definitions from  [[def(type=="req")]]
   node "A requirement need" as ID_REQ_1
   node "Another requirement need" as ID_REQ_2
  
   ' Definition from [[def_list(ID_1, ID_123)]]
   node "Title of need ID_1"  as ID_1
   node "Title of need ID_123"  as ID_123

   ' Links from [[links(type=="req")]]
   ID_REQ_1 --> ID_REQ_2

   ' User defined content
   card "my_own_card" as my_card
   my_card -> ID_1

So the goal is to have some "functions" (like the dynamic functions), which create plantuml-valid code, which gets injected into the given
plantuml-code.

Ideas for functions:

  • def(filter_string): Creates plantuml-objects based on filter_string
  • def_list(list[]): Create plantuml objects based on given ID list
  • **links(filter_string): Create links between plantuml-objects. Objects must be defined by user or ``def() in advance

For sure, all these functions could get some additional options:

  • type: Define the used node type and don't take it from conf.py
  • color
  • link_type: Only connect plantuml-objects based provided link type

So I think there is room to implement a lot of ideas.

But lets starts with the basics for this tickets and just implement:

  • The directive needuml
  • The function-replacement mechanism
  • The functions: def() and links()
@danwos
Copy link
Member Author

danwos commented Jul 11, 2022

Doable via needuml now

@danwos danwos closed this as completed Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant