mirror of https://github.com/YosysHQ/yosys.git
Docs: Fix links for view/edit source
This commit is contained in:
parent
76d85fefac
commit
ab4bda8ae2
|
@ -11,6 +11,29 @@ yosys_ver = "0.48"
|
||||||
# select HTML theme
|
# select HTML theme
|
||||||
html_theme = 'furo-ys'
|
html_theme = 'furo-ys'
|
||||||
html_css_files = ['custom.css']
|
html_css_files = ['custom.css']
|
||||||
|
html_theme_options: dict[str] = {
|
||||||
|
"source_repository": "https://github.com/YosysHQ/yosys/",
|
||||||
|
"source_branch": "main",
|
||||||
|
"source_directory": "docs/",
|
||||||
|
}
|
||||||
|
|
||||||
|
# try to fix the readthedocs detection
|
||||||
|
html_context: dict[str] = {
|
||||||
|
"READTHEDOCS": True,
|
||||||
|
"display_github": True,
|
||||||
|
"github_user": "YosysHQ",
|
||||||
|
"github_repo": "yosys",
|
||||||
|
"slug": "yosys",
|
||||||
|
}
|
||||||
|
|
||||||
|
# override source_branch if not main
|
||||||
|
git_slug = os.getenv("READTHEDOCS_VERSION_NAME")
|
||||||
|
if git_slug not in [None, "latest", "stable"]:
|
||||||
|
html_theme_options["source_branch"] = git_slug
|
||||||
|
|
||||||
|
# edit only works on branches, not tags
|
||||||
|
if os.getenv("READTHEDOCS_VERSION_TYPE", "branch") != "branch":
|
||||||
|
html_theme_options["top_of_page_buttons"] = ["view"]
|
||||||
|
|
||||||
# These folders are copied to the documentation's HTML output
|
# These folders are copied to the documentation's HTML output
|
||||||
html_static_path = ['_static', "_images"]
|
html_static_path = ['_static', "_images"]
|
||||||
|
|
Loading…
Reference in New Issue