cpython icon indicating copy to clipboard operation
cpython copied to clipboard

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

Open erlend-aasland opened this issue 1 year ago • 3 comments

  • Issue: gh-105812

📚 Documentation preview 📚: https://cpython-previews--118743.org.readthedocs.build/

erlend-aasland avatar May 07 '24 21:05 erlend-aasland

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

erlend-aasland avatar May 07 '24 21:05 erlend-aasland

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 avatar May 20 '24 17:05 erlend-aasland

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

erlend-aasland avatar May 20 '24 17:05 erlend-aasland

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

erlend-aasland avatar Nov 05 '24 11:11 erlend-aasland

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

A

AA-Turner avatar Nov 05 '24 12:11 AA-Turner

@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 avatar Nov 05 '24 22:11 erlend-aasland

@AA-Turner: I created https://github.com/sphinx-doc/sphinx/issues/13105.

erlend-aasland avatar Nov 06 '24 08:11 erlend-aasland