Skip to content

gh-105812: [PoC] add :deco: role and adapt some rst files - #118743

Closed
erlend-aasland wants to merge 6 commits into
python:mainfrom
erlend-aasland:docs/deco-role
Closed

erlend-aasland wants to merge 6 commits into
python:mainfrom
erlend-aasland:docs/deco-role

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented May 7, 2024 •

Copy link
Copy Markdown
Contributor
@erlend-aasland

Copy link
Copy Markdown
Contributor Author

This works fine for :deco:`mydeco` , but fails for :deco:`!mydeco` . I know nothing about Sphinx internals; pointers appreciated :)

I'm probably butchering the Sphinx/docutils API here; apologies in advance
@erlend-aasland

Copy link
Copy Markdown
Contributor Author

I'm probably misusing the docutils/Sphinx API here, but I got this working using a custom inner node class. Perhaps overriding result_nodes() is more preferable?

Anyway, here are some screenshots:

Screenshot 2024-05-20 at 12 57 26 Screenshot 2024-05-20 at 12 57 38
@erlend-aasland

Copy link
Copy Markdown
Contributor Author

Well, older versions of Sphinx don't like it; I guess I should consider overriding result_nodes() instead.

@erlend-aasland
erlend-aasland marked this pull request as draft October 14, 2024 23:32
@erlend-aasland

Copy link
Copy Markdown
Contributor Author

I'll work on this locally instead of polluting the CPython PR list.

@erlend-aasland
erlend-aasland deleted the docs/deco-role branch November 5, 2024 11:50
@AA-Turner

Copy link
Copy Markdown
Member

@erlend-aasland I'd accept this as a feature in Sphinx, if you'd be interested -- we could then backport here.

A

@erlend-aasland

Copy link
Copy Markdown
Contributor Author

@erlend-aasland I'd accept this as a feature in Sphinx, if you'd be interested -- we could then backport here.

Definitely! I need some help hashing this out; I haven't found the time to delve into the nitty gritty Sphinx details.

@erlend-aasland

Copy link
Copy Markdown
Contributor Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants