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

gh-105812: [PoC] add :deco: role and adapt some rst files#118743
erlend-aasland wants to merge 6 commits into
python:mainfrom
erlend-aasland:docs/deco-role

Conversation

@erlend-aasland

@erlend-aaslanderlend-aasland commented May 7, 2024

Copy link
Copy Markdown
Contributor

@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

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
ContributorAuthor

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 26Screenshot 2024-05-20 at 12 57 38

@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

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
ContributorAuthor

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
ContributorAuthor

@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
ContributorAuthor

@AA-Turner: I created sphinx-doc/sphinx#13105.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@erlend-aasland@AA-Turner