useblocks / sphinx-needs-enterprise

Sphinx-Needs Functions for enterprise users
http://useblocks.com/sphinx-needs-enterprise/
Other
5 stars 1 forks source link

sni import does not understand sphinx configurations in conf.py #41

Closed twodrops closed 2 years ago

twodrops commented 2 years ago

sni import reuses the configuration in conf.py. It does not however load conf.py in the context of a sphinx-build. This causes certain configurations in conf.py to fail, for example, the support for sphinx tags.

This is similar to the open-needs IDE issue: https://github.com/open-needs/open-needs-ide/issues/24

danwos commented 2 years ago

I'm not sure if this can be solved by sne import, as the conf.py could make internally so many checks, that it is simply out of our control.

In such a scenario I would split the conf.py into two files: 1) A small_conf.py file, which uses no external data and make no checks based on it (e.g. ENV vars). It can also contain the sphinx-Needs config for needs_types and needs_services only. 2) The normal conf.py file, which imports everything from small_conf.py.

And the we can use sne import -c docs/small_conf.py ... and all should work :)

twodrops commented 2 years ago

I find it a good solution