Skip to content
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

Bug: needextract does not support "layout" anymore #1107

Open
danwos opened this issue Feb 13, 2024 · 1 comment
Open

Bug: needextract does not support "layout" anymore #1107

danwos opened this issue Feb 13, 2024 · 1 comment
Assignees
Labels

Comments

@danwos
Copy link
Member

danwos commented Feb 13, 2024

Setting layout in needextract does not have any effect. Instead, the original layout is taken.

You can see this also in our documentation:
https://sphinx-needs.readthedocs.io/en/latest/directives/needextract.html#layout

The results do not use the set layout focus_r from above.

image

@chrisjsewell
Copy link
Member

@danwos to note, I'm not sure if this ever actually worked 😅; there is an old version 1.2.0 build still available on RTD, and you can also see it does not work there: https://sphinx-needs.readthedocs.io/en/rtd_jaav/directives/needextract.html#layout
its certainly not a new problem (more than a year old)

I've found why, but don't have a solution available yet.
Here:

env.resolve_references(node_container, docname, env.app.builder) # type: ignore[arg-type]

The need_container looks like this initially: <container><Need>...</></>,
but then because this now gets processed by all the post-transforms, including the one to transform needs, afterwards it looks like:
<container><container classes="need_container" ids="SNCB-c3f165af"><table ...,
i.e. you have already turned it in to a table,
so then when you run build_need in the next lines, it doesn't do anything because the need is already built.

In #794, you actually added a commented out line: # node_container += needs[need_id]["need_node"].children.
This feels more like what is meant to happen, i.e. only the children should be "re-processed", not the whole need node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants