-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Switch to Docutils HTML5 writer instead of the HTML4 one #3004
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your participation and understanding. |
I apologize for the delay in responding to this issue, which has been raised before in #2549. Given that some years have passed since that issue was closed, perhaps it is time to revisit this topic, particularly because according to the Docutils release notes, it seems It occurs to me that maybe the Docutils writer could also be a configurable setting? @qookei: Given the concerns raised in #2549 regarding whether Docutils produces valid HTML5, can you run the output through some validators and confirm that the current released version of Docutils can produce valid HTML5? |
@qookei: Any thoughts on my comment above? |
Oh apologies, I looked at your response on my phone, but forgot to respond later. With the skeleton generated by This seems fine to me, and the reported warnings can be fixed by changing the theme's templates (HTML generated with the theme I wrote validates with no messages). EDIT: The above warnings are also reported with the default HTML4 writer. |
I've just change
And my blog was built correctly (some random https://validator.w3.org/) obviously it needs a lot of more work got get it merged (a lot of tests need to be updated) |
If someone would like to submit a pull request that implements the needed changes for a switch to the Docutils HTML5 writer, I would be happy to include it in a subsequent major Pelican release. |
Feature Request
Pelican has used the Docutils HTML4 writer for about 11 years at this point, and I think it's time to put it to rest. Since 0.13, Docutils includes an HTML5 writer called
html5_polyglot
, which generates (X)HTML5, with correct semantic tags for article sections, etc.As far as I can tell at a glance, all that is needed is just swapping out the import. I have done so in a custom plugin, by subclassing
pelican.readers.RstReader
and changing thewriter_class
(along with the translator) and it appears to work just fine.Note that this is a breaking change in some aspects. For example, themes that add styles for
div.section
will break as now those are replaced with actualsection
tags (they still have their ids though).Also worth of note is that while issue #959 is similar, it's not related as at that time Docutils did not know about HTML5.
The text was updated successfully, but these errors were encountered: