Replies: 1 comment
-
@danwos Thanks a lot for all the great ideas you wrote above. Firstly, some comments on my current requirements In my project we need a central "needs model" to generate the following:
Additional to this, it would be nice to have a "needs model" to model needs as a structure which is closer to the domain. This means if we have 10 need types and 100 need options, from the domain point of view those options might be valid for some of the need-types only. sphinx-needs currently supports only a flat list of options. It would be nice if the model can show this, but in the generated conf.py it would be removed and (if possible) need-warnings created to check that the options-usage is according to the defined model. The last part was your idea @danwos :) |
Beta Was this translation helpful? Give feedback.
-
Problem
In some bigger projects it is often the case, that a tool-configuration needs to be reused in different tools as well.
For instance the configured
need-types
shall be documented in a sphinx project, they shall be part of an IDE specific config to allow auto-completion during writing and they shall be presented in a diagram as need-model.Additionally configs may need to be shared, inherited or archived.
The problem is, that each "representation/usage" need common but also additional kind of information:
So from the technical part an overall config would be needed, which is then separated into tool-specific configs.
Example:
![image](https://user-images.githubusercontent.com/998700/122008043-e08dd480-cdb8-11eb-8f61-a5b2cbc84022.png)
But replacing a config file with an even more complex config file sounds not like a good solution.
Idea
Instead of creating a new, additional "super-config", we could also use one of the needed "configs/output formats" to store all information.
And the only format, which allows to have an extensible format to define additional options is
rst
, or better Sphinx together with Sphinx-Needs. Therefor I call this conceptConfAsDocs
It may be used like this:
![image](https://user-images.githubusercontent.com/998700/122009397-56df0680-cdba-11eb-995a-e9e3144bf474.png)
Audience
Who may use it:
Who should not use it (overkill):
Spec (rough)
in my understanding we have two kind of main information/objects:
config
: The name of the configuration parameters, which are need/supported by a toolvalues
: The value for a config parameter, which shall be set for a specific tool instance/project.Therefore the rst code may look like:
So the defined config parameters are available as directives, to easily add a value.
This would need to run a sphinx-build action twice, if a new config parameter got added.
Reason: 1. Run: Detect all config parameters. 2. Run: Register config-params as directives.
The config-parameter set is defined only once per tool, so for Open-Source projects they may be shared and and get imported, if no project specific documentation is needed for them.
Values types to be supported:
I'm not yet 100% sure what is the best way to define and manipulate lists and dicts.
In the example you see that for each entry in a list a single directive-call is made.
So in this case it is really easy to document each single element of a list.
There may be options to override a complete list to define it completely by one directive.
Have to make some tests :) (Feedback welcome!)
Simplification
As you may have recognized, each config must be assigned to a tool.
And each config-value must be assigned to a tool and an instance.
As in most cases most configs and config-values for a tool/instance are written down on the same page, there are some simplification planned.
The above example can be written also like this:
conf_tool
andconf_instance
allow to activate/set the related values for each followingconfig
andconfig-value
.They get used until another
conf_tool
orconf_instance
is used.Output
The output shall not use the typical layout/style of sphinx-needs.
Instead new layouts and styles shall be configured, to allow a more seamless integration into the documentation flow.
Other magics / ideas
Rule: instance.tool.config, e.g.
my-project.sphinx.html-theme
config
needs andvalue
needs shall be set automatically.That's all folks. Any feedback?
Beta Was this translation helpful? Give feedback.
All reactions