-
-
Notifications
You must be signed in to change notification settings - Fork 201
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
Fix for admonitions being displayed out of their original context. #910
base: main
Are you sure you want to change the base?
Fix for admonitions being displayed out of their original context. #910
Conversation
… in context. Signed-off-by: Putnam, Kevin <[email protected]> Changes to be committed: modified: breathe/renderer/sphinxrenderer.py
(Sort of replies to #889 (comment)) @intelkevinputnam Via blame I see the commit that added this is 7f579b1, PR #670. Quite long ago but rationale seems to be that it matched Sphinx's own style. As a result, I'm not sure about potential side effects this might have for other users. @jakobandersen Do you remember or have insight is whether If it was only for stylistic reason with the default big block rendering of |
Sounds good. I'll update the PR as a configurable option. Any guidance on naming the parameter? |
@intelkevinputnam Initially I'm thinking something like # user in conf.py will have to import
# (unless there is a better way, but this errors early, instead of at runtime)
from docutils import nodes
# this would match current behaviour.
breathe_detaileddesc_pullup_types = [ nodes.note, nodes.warning ] Then the implementation can loop over the supplied types and pull them up. As for the default value, I think empty Thanks for the help! |
Gotcha. Easily doable. Some additional thoughts: TL;DR - would it make sense to define different behaviors for I ran into this problem because I am dealing with pages and pages of documentation written in Markdown with admonitions scattered throughout. The presentation is meant to be linear for all the content which is all contained in the Based on the original PR, I think this feature was developed for classes (for example) where there are many objects that might be rendered in any order. This would help to collect them in a sensible way. Which might mean that a given user might want one behavior for pages and another for groups and classes. What do you think? |
@intelkevinputnam Very good catch, makes sense to do it based upon directive then. We could update the setting value to use an array per directive in a dictionary instead of a plain array in this case. # no entry for "doxygenpage", so would default to []
breathe_detaileddesc_pullup_types = {
"doxygenclass": [ nodes.note, nodes.warning ],
"doxygengroup": []
} Not 100% sure if above syntax is correct, but the general idea should be good. I am not sure if we should set one or more directives to not- |
@vermeeren I agree that sorting should be a requested behavior. I'll take a stab at implementing it. |
…n detailed descriptions. TODO: Determine method for toggling whether to pull them up for different object types. Signed-off-by: Putnam, Kevin <[email protected]>
…e used eg. doxygenpage. Syntax: breathe_detaileddesc_pullup_types = {"doxygenpage":["note","warning"]} Signed-off-by: Putnam, Kevin <[email protected]>
@vermeeren I used strings to denote the node to pull up rather than the type value.
|
Signed-off-by: Putnam, Kevin <[email protected]>
Signed-off-by: Putnam, Kevin <[email protected]>
@vermeeren can you help with this check error? I tried to match |
Signed-off-by: Putnam, Kevin <[email protected]>
@michaeljones It looks to me like the linter is now blocking my PR on a file I haven't changed. Should I go ahead and submit the correction it is asking for? |
Hi @intelkevinputnam. I had a similar issue where the notes where not displayed in order. I tried removing the pullups. But still the behavior is same. Is there some other reasons that might lead to this kind of behavior |
@anjalirajasekhar I just returned from vacation, so I'm a little rusty. Which directive are you using? |
Hi @intelkevinputnam , sorry for the late reply. I am using doxygenpage directive |
I would expect the same order shown in doxygen's HTML output. This problem has surfaced in #835, #889, and #957. Although I do understand the desire to preserve previous behavior, I suspect it was a stylistic decision. Looking at #670, I think it was trying to consolidate various/similar "simple sections" ( Note Doxygen's HTML renderer only consolidates block-level sections that are written consecutively. @param p1 some text
@param p2 some text If a block-level section is interrupted by another block-level section, then doxygen will output the sections in the given order. @param p1 some text
@note some info.
@param p2 some text Admonitions (like doxygen's @param p1
@parblock
some text about p1
@note some info about p1.
@endparblock
@param p2 some text |
Removes 'pullup' for admonitions in detailed description to keep them in context.
File changed: breathe/renderer/sphinxrenderer.py
This is a fix for #889