wpilibsuite / sphinxext-opengraph

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

Implement RTD Support #30

Closed Daltz333 closed 3 years ago

Daltz333 commented 3 years ago

This PR implements retrieving site URL from ReadTheDocs.

This is enabled by default on RTD platforms and when site URL is not set. Users who set site URL manually will not be overridden, so this is backwards compatible.

TheTripleV commented 3 years ago

Ooh thanks for reminding me of test cases.

For test cases: You can set environment variables with https://docs.pytest.org/en/stable/monkeypatch.html#monkeypatching-environment-variables:~:text=behavior.%22%22%22-,monkeypatch.setenv(%22USER%22%2C%20%22TestingUser%22) You can probably set html_baseurl and needed rtd vars in conf.py of each test root.

It would be nice if you could include test cases for:

TheTripleV commented 3 years ago

Fixed the tests (kinda).

urlparse(config["html_baseurl"])

doesn't return None; It returns a parse object.

All 3 of the tests pass when run individually but don't work when run together.

Daltz333 commented 3 years ago

It is currently not running tests, because I'm small brain. Will figure out later.