Sphinx extension for extracting metadata for the page.

New in version 2.2.

This extension extracts any meta information (useful for content like page descriptions for social media) and extracts their information into the document’s top-level metadata.

This metadata can then be used when building sites or tools that process the page’s compiled documentation (when not simply relying on the generated HTML).

The metadata will be available in the document’s meta information, keyed off by the name used in the meta directive, the content, and any other attributes provided.

If multiple pieces of metadata exist for the same key, the information will be assembled into a list under that key. Otherwise, the information will be assigned directly to the key.


To use this, you just need to add the extension in

extensions = [



Set up the Sphinx extension.


Set up the Sphinx extension.

This listens for the event needed to process the document tree for metadata extraction.

New in version 2.2.


app (sphinx.application.Sphinx) – The Sphinx application being run.