diff --git a/docs/conf.py b/docs/conf.py index 8cb8fd1..36f5e1d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,6 +13,9 @@ from docutils import nodes # noqa: E402 from sphinx.application import Sphinx # noqa: E402 +DEV_BUILD = os.getenv("BUILDDIR", None) == "latest" +BRANCH = "develop" if DEV_BUILD else "release" + project = "LSP Devtools" copyright = "2023, Alex Carney" author = "Alex Carney" @@ -48,6 +51,19 @@ html_theme = "furo" html_title = "LSP Devtools" # html_static_path = ["_static"] +html_theme_options = { + "source_repository": "https://github.com/swyddfa/lsp-devtools/", + "source_branch": BRANCH, + "source_directory": "docs/", +} + +if DEV_BUILD: + html_theme_options["announcement"] = ( + "This is the unstable version of the documentation, features may change or " + "be removed without warning. " + 'Click here ' + "to view the released version" + ) def lsp_role(name, rawtext, text, lineno, inliner, options={}, content=[]):