Skip to content

Commit

Permalink
doc: improvements for sphinx generation
Browse files Browse the repository at this point in the history
Handle version retrieval better when comments are present.
Add warning if Sphinx theme (read_the_docs) is missing.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
  • Loading branch information
dbkinder authored and jren1 committed May 15, 2018
1 parent b55e6a8 commit 3b86c97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion doc/conf.py
Expand Up @@ -57,13 +57,17 @@
# Makefile from the acrn-hypervisor repo by finding these lines:
# MAJOR_VERSION=0
# MINOR_VERSION=1
# RC_VERSION=1

try:
version_major = None
version_minor = None
version_rc = None
for line in open(os.path.normpath("../acrn-hypervisor/Makefile")) :
if line.count("=") :
# remove comments
line = line.split('#', 1)[0]
line = line.rstrip()
if (line.count("=") == 1) :
key, val = [x.strip() for x in line.split('=', 2)]
if key == 'MAJOR_VERSION':
version_major = val
Expand Down Expand Up @@ -124,6 +128,7 @@
'searchbox.html',
]
}
sys.stderr.write('Warning: sphinx_rtd_theme missing. Use pip to install it.\n')
else:
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
Expand Down

0 comments on commit 3b86c97

Please sign in to comment.