From 30ae6c38160c5b2cf21c9a55236477ffdd7782a4 Mon Sep 17 00:00:00 2001 From: Sam Wu Date: Fri, 17 Mar 2023 12:45:10 -0600 Subject: [PATCH] add version number in docs --- docs/conf.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 78bbd32fa..22fa417da 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -4,9 +4,15 @@ # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html +import subprocess from rocm_docs import ROCmDocs -docs_core = ROCmDocs("hipBLAS Documentation") +getVersionCmd = r'sed -n -e "s/^.*VERSION_STRING.* \"\([0-9\.]\{1,\}\).*/\1/p" ../CMakeLists.txt' +version = subprocess.getoutput(getVersionCmd) +if len(version) == 0: + version = '1.0.0' # optional version number override if CMakeLists.txt does not have the version + +docs_core = ROCmDocs("hipBLAS {}".format(version)) docs_core.run_doxygen() docs_core.setup()