Skip to content

Switch to Docutils HTML5 writer instead of the HTML4 one #3004

Open
@qookei

Description

@qookei
  • I have searched the issues (including closed ones) and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.
  • I am willing to lend a hand to help implement this feature.

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 the writer_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 actual section 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions