Keep docs version in conf.py

This commit is contained in:
Miodrag Milanovic 2024-05-07 15:35:25 +02:00
parent 90dd508156
commit b4034a881e
2 changed files with 10 additions and 11 deletions

View File

@ -1012,7 +1012,7 @@ docs/reqs:
DOC_TARGET ?= html
docs: docs/source/cmd/abc.rst docs/gen_examples docs/gen_images docs/guidelines docs/usage docs/reqs
$(Q) YOSYS_VER=$(YOSYS_VER) $(MAKE) -C docs $(DOC_TARGET)
$(Q) $(MAKE) -C docs $(DOC_TARGET)
clean:
rm -rf share

View File

@ -4,7 +4,8 @@ import os
project = 'YosysHQ Yosys'
author = 'YosysHQ GmbH'
copyright ='2022 YosysHQ GmbH'
copyright ='2024 YosysHQ GmbH'
yosys_ver = "0.40"
# select HTML theme
html_theme = 'furo'
@ -46,12 +47,18 @@ extensions = ['sphinx.ext.autosectionlabel', 'sphinxcontrib.bibtex']
autosectionlabel_prefix_document = True
autosectionlabel_maxdepth = 1
# set version
if os.getenv("READTHEDOCS") and os.getenv("READTHEDOCS_VERSION") == "latest":
release = yosys_ver + "-dev"
else:
release = yosys_ver
# assign figure numbers
numfig = True
bibtex_bibfiles = ['literature.bib']
latex_elements = {
'releasename': ' ',
'preamble': r'''
\usepackage{lmodern}
\usepackage{comment}
@ -63,14 +70,6 @@ latex_elements = {
extensions.append('sphinx.ext.todo')
todo_include_todos = False
# attempt to get version
env_yosys_ver = os.getenv("YOSYS_VER")
if env_yosys_ver:
if os.getenv("READTHEDOCS") and os.getenv("READTHEDOCS_VERSION") == "latest":
release = env_yosys_ver + "-dev"
else:
release = env_yosys_ver
# custom cmd-ref parsing/linking
sys.path += [os.path.dirname(__file__) + "/../"]
extensions.append('util.cmdref')