wpilibsuite / sphinxext-opengraph

Sphinx extension to generate unique OpenGraph metadata
https://sphinxext-opengraph.readthedocs.io
Other
74 stars 27 forks source link

Add per-file overrides using field lists #50

Closed ItayZiv closed 2 years ago

ItayZiv commented 2 years ago

Use field lists to implement per page overrides Closes #11. It seems like __init__.py might be due for a slight rewrite after this change.

ItayZiv commented 2 years ago

Probably should be done at this point, but it really does seem like __init__.py is getting a bit messy, and test_options.py might also be due for a cleanup to make all the tests more similar.

TheTripleV commented 2 years ago

Regarding the names of the fields, do field lists support underscores? If so, I think using underscores instead of hyphens would be better as the variable names in conf.py and the names of the field list keys would match.

Also, since making this extension support all opengraph tags would be nice. So, transforming all field list entries of the form :og:X: Y to tags mapping og:X to Y.

ItayZiv commented 2 years ago

Regarding the underscores for names, I think it's supported but field lists everywhere else use hyphens, so I think it'd be better to be consistent with that.

TheTripleV commented 2 years ago

Note, relative image paths in the custom overrides are broken (intentionally) in this PR. A fix should be included as a part of #53.