Fix version number in doc guide

This commit is contained in:
Wilson Snyder 2021-04-11 20:38:37 -04:00
parent adce7ecf4b
commit a9bd112e0c
3 changed files with 12 additions and 3 deletions

View File

@ -54,6 +54,9 @@ POD2TEXT = pod2text
MKINSTALLDIRS = $(SHELL) $(srcdir)/src/mkinstalldirs
PERL = @PERL@
# Version (for docs/guide/conf.py)
PACKAGE_VERSION_NUMBER = @PACKAGE_VERSION_NUMBER@
# Destination prefix for RPMs
DESTDIR =

4
docs/_static/css/vlt_sphinx.css vendored Normal file
View File

@ -0,0 +1,4 @@
/*Verilator blue #008fd7; set in html*/
.wy-side-nav-search > div.version {
color: #111;
}

View File

@ -20,14 +20,16 @@ import sphinx_rtd_theme
def get_vlt_version():
filename = "../../src/config_rev.h"
filename = "../../Makefile"
with open(filename) as fh:
for line in fh:
match = re.search(r'= "([a-z0-9.]+)', line)
match = re.search(r"PACKAGE_VERSION_NUMBER *= *([a-z0-9.]+)", line)
if match:
return match.group(1)
return "unknown"
def setup(app):
app.add_css_file('css/vlt_sphinx.css')
# ----------------------------------------------------------------------
# -- Project information
@ -63,7 +65,7 @@ extensions = []
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = [
'_build', 'Thumbs.db', '.DS_Store', 'internals.rst', 'xml.rst'
'_build', 'Thumbs.db', '.DS_Store', 'internals.rst', 'xml.rst', 'gen/ex_*'
]
# Warn about refs