Add a Sphinx extension for extracting page metadata.

Review Request #12864 — Created March 3, 2023 and updated — Latest diff uploaded

Information

beanbag-docutils
master

Reviewers

Modern versions of docutils and Sphinx allow for setting certain kinds
of page metadata, using .. meta::. This is useful for SEO/social media
page descriptions, for instance.

The problem is, these get compiled directly to a block of <meta> tags,
which isn't what we want in our case, since we render docs more
explicitly and need to use this metadata for multiple things.

This change introduces an extension that walks the document, extracts
the metadata, and stores it in the document's structured metadata
storage, where we can get access to it.

Unit tests passed.

Added some metadata to a page, and verified our website could extract it
and use it.

Also verified the presence in the compiled JSON files.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Add a Sphinx extension for extracting page metadata.
Modern versions of docutils and Sphinx allow for setting certain kinds of page metadata, using `.. meta::`. This is useful for SEO/social media page descriptions, for instance. The problem is, these get compiled directly to a block of `<meta>` tags, which isn't what we want in our case, since we render docs more explicitly and need to use this metadata for multiple things. This change introduces an extension that walks the document, extracts the metadata, and stores it in the document's structured metadata storage, where we can get access to it.
89ccdbfc41e3d67e14da6104af5bf6492eb1c6f6 Christian Hammond
beanbag_docutils/sphinx/ext/metadata.py
beanbag_docutils/sphinx/ext/tests/test_metadata.py
beanbag_docutils/sphinx/ext/tests/testcase.py
docs/index.rst
docs/coderef/index.rst
Loading...