Skip to content

Docs EPUB: fix meta tags connected with Open Graph #134071

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

m-aciek
Copy link
Contributor

@m-aciek m-aciek commented May 15, 2025

  • Move meta theme-color tag from sphinxext-opengraph custom tags config directly to layout.html. Previously it would be added for all HTML-related Sphinx builders, after it's only added when builder == HTML.
  • Partially revert Custom tags and EPUB builder sphinx-doc/sphinxext-opengraph#136 to discuss alternative fixes.)

It's a follow-up to #133720. This change should fix EPUB builds. When testing locally for #133720 I didn't have sphinxext-opengraph installed in the environment, that's why I didn't catch it earlier, I'm sorry.

Could we please backport it for supported versions and 3.12?

Before:

After:


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

@hugovk
Copy link
Member

hugovk commented May 16, 2025

Do meta tags even make sense for EPUB (and other builders)? If not, it's probably better to skip them altogether for those builders. Could save us future headaches as well.

@m-aciek m-aciek marked this pull request as draft May 16, 2025 14:02
@m-aciek
Copy link
Contributor Author

m-aciek commented May 16, 2025

Do meta tags even make sense for EPUB (and other builders)? If not, it's probably better to skip them altogether for those builders. Could save us future headaches as well.

It looks like they don't. https://chatgpt.com/share/6827445c-70f0-8004-bed3-353546e96afa

@methane started the implementation of skipping them on the extension side.

@hugovk
Copy link
Member

hugovk commented May 16, 2025

It looks like they don't. chatgpt.com/share/6827445c-70f0-8004-bed3-353546e96afa

I'd prefer an authoritative source rather than a webpage that says "ChatGPT can make mistakes. Check important info."

@m-aciek
Copy link
Contributor Author

m-aciek commented May 16, 2025

It looks like they don't. chatgpt.com/share/6827445c-70f0-8004-bed3-353546e96afa

I'd prefer an authoritative source rather than a webpage that says "ChatGPT can make mistakes. Check important info."

I wasn't able to confirm that searching manually in a limited time.

@cclauss
Copy link
Contributor

cclauss commented May 27, 2025

The epub download is still broken.

@hugovk
Copy link
Member

hugovk commented May 27, 2025

Can we add a conditional in conf.py to skip these tags for non-HTML, or does it need to go in the sphinxext-opengraph extension or somewhere else?

@m-aciek
Copy link
Contributor Author

m-aciek commented May 27, 2025

Can we add a conditional in conf.py to skip these tags for non-HTML, or does it need to go in the sphinxext-opengraph extension or somewhere else?

In my opinion the cleanest would be to have it in sphinxext-opengraph, if/when sphinx-doc/sphinxext-opengraph#137 is merged. (Though the CI is failing there, probably it needs addressing first.)

Probably we could leverage tags to put this logic in conf.py.

@cclauss
Copy link
Contributor

cclauss commented Jun 13, 2025

Can we please do as suggested at #134071 (comment) above?

It is painful not to be able to read the Python EPUB docs.

@hugovk
Copy link
Member

hugovk commented Jun 13, 2025

@cclauss Would you like to open a PR?

@cclauss
Copy link
Contributor

cclauss commented Jun 13, 2025

I would have opened a PR a long time ago if I knew how to fix this problem.

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.

3 participants

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant