Skip to content

Commit

Permalink
Keep docs version in conf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mmicko committed May 7, 2024
1 parent 90dd508 commit b4034a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 9 additions & 10 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

project = 'YosysHQ Yosys'
author = 'YosysHQ GmbH'
copyright ='2022 YosysHQ GmbH'
copyright ='2024 YosysHQ GmbH'
yosys_ver = "0.40"

# select HTML theme
html_theme = 'furo'
Expand Down Expand Up @@ -46,12 +47,18 @@
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}
Expand All @@ -63,14 +70,6 @@
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')
Expand Down

0 comments on commit b4034a8

Please sign in to comment.