-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add object description options mechanism #75
Conversation
be5ccba
to
4fcd782
Compare
docs/conf.py
Outdated
html_wrap_signatures_with_css = ["py"] | ||
object_description_options_patterns.append( | ||
("py:.*", dict(wrap_signatures_with_css=True)) | ||
) |
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.
I just pushed the v0.5.0 tag without knowing your work on this was changing the config option names. These config option changes seem like a breaking change, so I'd use a major version bump for the next tag.
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.
It is true that it is a breaking change, but on the other hand if we get this in soon I doubt too many people will have used the new options yet.
Also v0 generally means no stability guarantees.
But yeah it could make sense to increase to v1.
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.
I'm ok with bumping minor version because I'd also consider v0 as "beta" state.
b341983
to
d312942
Compare
Please hold. I'm having trouble getting the solution to #70 working. I'm trying object_description_pattern = [
("cpp:functionParam", dict(include_in_toc=False, generate_synopses=None))
] But it still shows param in the toc and synopses are the entire paragraph (albeit still incorrect because of #69 ) |
Nevermind. I see the typo in the config option now. That also explains why the docs weren't rebuilding when I changed the typo'd option's setting. All is good to go when you are. |
According to the docs you added, the I'm starting to notice that this more generic approach (making the user specify a specific object type) is too generic as it requires intimate knowledge of sphinx inner workings (most of which aren't really documented like |
I will have to fix the doc issues. It could be nice to have a more powerful version of rst-example that lets us use modified conf.py but that might be tricky to implement. Most of the time the object type matches the directive name so it should be fairly easy to understand. However it is true that the param types are hidden --- we would need to document them. |
Originally, I had two rst-results type directives. Only the simpler form made it to PR. The other more complicated form was meant to take the first literal block designated as RST (via the node's Wouldn't using a modified conf.py for an example snippet require a independent (or possible divergent from primary) sphinx env object? That sounds a bit more than just "tricky". It would be great for tests/validation though. |
I could revisit the tabbed results idea and grab the first literal block with a caption title ending in "conf.py" (probably would use |
Yeah, using a modified conf.py would require running a separate sphinx build entirely (but presumably just for a single page) and then somehow incorporating the result into the main documentation. Probably would work best as a link to a separate page, or embedded as an iframe that is zoomed out perhaps. This would be particularly nice for demonstrating the mkdocs-material |
|
I also can't seem to get object_description_options_patterns = [
("cpp:.*", dict(include_object_description_fields_in_toc=False)),
] |
It seems that option is actually named |
Fixed. |
c55fb8b
to
5634244
Compare
5634244
to
0079225
Compare
This replaces manny config options with a more general "object description options" mechanism that allows various options to be configured on a per domain/object type basis. This commit also adds a number of features built on top of that mechanism: - Generating object description synopses for the std domain, including custom object types added using `app.add_object_type`. - Excluding certain object types from the TOC - Excluding the object type from the cross-reference tooltip. Fixes #70. Co-authored-by: Brendan <[email protected]>
0079225
to
fdea0c9
Compare
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.
Testing looks good now. I can't find any other objections.
Thanks for the very thorough review! |
This replaces manny config options with a more general "object
description options" mechanism that allows various options to be
configured on a per domain/object type basis.
This commit also adds a number of features built on top of that mechanism:
Generating object description synopses for the std domain, including
custom object types added using
app.add_object_type
.Excluding certain object types from the TOC
Excluding the object type from the cross-reference tooltip.
Fixes #70.