{"action":"created","issue":{"url":"https://api.github.com/repos/sphinx-doc/testing2/issues/284","labels_url":"https://api.github.com/repos/sphinx-doc/testing2/issues/284/labels{/name}","comments_url":"https://api.github.com/repos/sphinx-doc/testing2/issues/284/comments","events_url":"https://api.github.com/repos/sphinx-doc/testing2/issues/284/events","html_url":"https://github.com/sphinx-doc/testing2/issues/284","id":53261493,"number":284,"title":"accessing Date from the docinfo metadata","user":{"login":"shimizukawa","id":151623,"avatar_url":"https://avatars.githubusercontent.com/u/151623?v=3","gravatar_id":"","url":"https://api.github.com/users/shimizukawa","html_url":"https://github.com/shimizukawa","followers_url":"https://api.github.com/users/shimizukawa/followers","following_url":"https://api.github.com/users/shimizukawa/following{/other_user}","gists_url":"https://api.github.com/users/shimizukawa/gists{/gist_id}","starred_url":"https://api.github.com/users/shimizukawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shimizukawa/subscriptions","organizations_url":"https://api.github.com/users/shimizukawa/orgs","repos_url":"https://api.github.com/users/shimizukawa/repos","events_url":"https://api.github.com/users/shimizukawa/events{/privacy}","received_events_url":"https://api.github.com/users/shimizukawa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sphinx-doc/testing2/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/sphinx-doc/testing2/labels/markup","name":"markup","color":"FFFFFF"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-02T16:27:19Z","updated_at":"2015-01-02T16:27:22Z","closed_at":"2015-01-02T16:27:20Z","body":"Currently `sphinx.environment.BuildEnvironment.process_metadata` deletes the docinfo node when it has finished stashing selected nodes' contents in its `metadata` attribute.\n\nThis means that docinfo node that is //not// an instance of the two currently accepted classes (`docutils.nodes.author`, `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`. (author//s//? copyright? status?)\n\nWould it be possible to either \n# emit an event before `process_metadata` is called in `read_doc` to enable extension to access the bibliographic fields (there is already `'source-read'` of course, but that's before the doctree exists), or\n# stash the metadata from other bibliographic fields in the environment's metadata attribute along with the author/generic field metadata?\n\nIf I were to write a patch for this functionality, would either of these options be more likely to be accepted into the mainline?\n\n----------------------------------------\n- Bitbucket: https://bitbucket.org/birkenfeld/sphinx/issue/284\n- Originally reported by: [dan90](https://bitbucket.org/dan90)\n- Originally created at: 2009-11-12T15:14:42.844\n"},"comment":{"url":"https://api.github.com/repos/sphinx-doc/testing2/issues/comments/68539195","html_url":"https://github.com/sphinx-doc/testing2/issues/284#issuecomment-68539195","issue_url":"https://api.github.com/repos/sphinx-doc/testing2/issues/284","id":68539195,"user":{"login":"shimizukawa","id":151623,"avatar_url":"https://avatars.githubusercontent.com/u/151623?v=3","gravatar_id":"","url":"https://api.github.com/users/shimizukawa","html_url":"https://github.com/shimizukawa","followers_url":"https://api.github.com/users/shimizukawa/followers","following_url":"https://api.github.com/users/shimizukawa/following{/other_user}","gists_url":"https://api.github.com/users/shimizukawa/gists{/gist_id}","starred_url":"https://api.github.com/users/shimizukawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shimizukawa/subscriptions","organizations_url":"https://api.github.com/users/shimizukawa/orgs","repos_url":"https://api.github.com/users/shimizukawa/repos","events_url":"https://api.github.com/users/shimizukawa/events{/privacy}","received_events_url":"https://api.github.com/users/shimizukawa/received_events","type":"User","site_admin":false},"created_at":"2015-01-02T16:27:22Z","updated_at":"2015-01-02T16:27:22Z","body":"_From dan mackinlay on 2009-11-16 13:50:25+00:00_\n\nOf course, the other option might be to use some kind of transform to extract the bibliographic metadata using some kind of transform before Sphinx gets to it, but this feels like an artificial solution to me."}}