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
ENH: Allow admonitions to be style as a sidebar #836
Conversation
here's the demo: Here's the original (unaffected) sidebar from kitchen-sink: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good to me! Two quick questions:
-
Given that the sidebar is a bit more limited in space, I wonder if it'd be better to not apply the left margin to the content. E.g. here's what it looks like with that removed:
-
Do you think this should just be the default styling for the sidebar? Maybe it would be a grey color if no
:admonition:
is given, and it could be colored by addingnote
etc? -
Alternatively, we could keep the sidebar as-is, and add a helper class for admonitions that would make it behave like a sidebar. E.g. we could ask people to do:
```{note} :class: sidebar My note ```
Good idea
No strong feeling here. Both seem equally usable. Only difference I can think of is the actual HTML (whether it's an |
I gave this some thought, and I think no. We don't know what users will do with the sidebar - maybe it's just an image, we should leave this container flexible by default. They should be able to get the grey one via |
I think the biggest benefit of going the opposite direction and supporting:
would be on the implementation side. E.g. if we just add these 4 CSS rules to our admonition (e.g. triggered via {
max-width: 40%;
float: right;
clear: both;
margin-left: 0.5rem;
} results in: |
Ok I'm convinced. Feel free to push that change, I'm out of office until Tuesday. |
Although I think you also need a rule for the inner content left margin. But still, that's a much nicer implementation |
Sounds good, I will try and give it a shot if I have a moment. I am hoping to do a little flurry of PR merges so that we can make a release relatively soon. |
OK, the latest pushes re-work this to trigger the behavior with a I will merge this once the RTD docs pass and I re-confirm that it looks as-expected, since @drammock said he's out for several days :-) |
Ah one extra change here - I realized that we were starting to put "instructional" information in the |
This makes it easy to style docutils
.. sidebar::
to match our admonition style, by adding classes like this: