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

🐈 Add built-in styling for Sphinx-annotated ASTs #443

Merged
merged 5 commits into from
Aug 20, 2024

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Aug 1, 2024

In #431 I explored adding pass-through rendering support for Sphinx AST nodes (generated from a separate extension for Sphinx). This PR instead looks for annotations on a canonical MyST AST to make the styling required to improve Sphinx rendering. Currently this is only focused on autodoc nodes.

There are some limitations in our AST right now that make this a bit fiddly, namely that many node types don't support custom classes. Consequently, some of the selectors are more like heuristics, but they are all gated on a parent class starting with sphinx-.

1722518444-wayshot
1722518425-wayshot
1722518401-wayshot

Copy link

changeset-bot bot commented Aug 1, 2024

🦋 Changeset detected

Latest commit: caa99a4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@myst-theme/styles Patch
@myst-theme/providers Patch
@myst-theme/frontmatter Patch
@myst-theme/diagrams Patch
@myst-theme/jupyter Patch
@myst-theme/site Patch
@myst-theme/common Patch
@myst-theme/icons Patch
@myst-theme/book Patch
@myst-theme/article Patch
myst-to-react Patch
myst-demo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@agoose77
Copy link
Collaborator Author

agoose77 commented Aug 1, 2024

This styling isn't perfect, but it's simple enough to start with.

@agoose77 agoose77 requested a review from rowanc1 August 1, 2024 13:28
@agoose77 agoose77 changed the title 🐈 Add built-styling for Sphinx-annotated ASTs 🐈 Add built-in styling for Sphinx-annotated ASTs Aug 1, 2024
@rowanc1 rowanc1 merged commit d4e240a into main Aug 20, 2024
2 checks passed
@rowanc1 rowanc1 deleted the agoose77/feat-styles-for-sphinx branch August 20, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants