accessing Date from the docinfo metadata
sphinx.environment.BuildEnvironment.process_metadata deletes the docinfo node when it has finished stashing selected nodes' contents in its
This means that docinfo node that is not an instance of the two currently accepted classes (
docutils.nodes.field) is discarded and not accessible to extensions. However, some other field types might be legitimately used by extensions. I'm thinking specifically of my own use case, which involves inspecting the date field to create a date-based index. More generally, I think there could be legitimate uses for many things that subclasses
docutils.nodes.Bibliographic. (authors? copyright? status?)
Would it be possible to either
- emit an event before
process_metadatais called in
read_docto enable extension to access the bibliographic fields (there is already
'source-read'of course, but that's before the doctree exists), or
- stash the metadata from other bibliographic fields in the environment's metadata attribute along with the author/generic field metadata?
If I were to write a patch for this functionality, would either of these options be more likely to be accepted into the mainline?