mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-04-28 11:43:56 +00:00
doc: improvements for sphinx generation
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>
This commit is contained in:
parent
b55e6a8d74
commit
3b86c9710e
@ -57,13 +57,17 @@ author = u'Project ARCN developers'
|
|||||||
# Makefile from the acrn-hypervisor repo by finding these lines:
|
# Makefile from the acrn-hypervisor repo by finding these lines:
|
||||||
# MAJOR_VERSION=0
|
# MAJOR_VERSION=0
|
||||||
# MINOR_VERSION=1
|
# MINOR_VERSION=1
|
||||||
|
# RC_VERSION=1
|
||||||
|
|
||||||
try:
|
try:
|
||||||
version_major = None
|
version_major = None
|
||||||
version_minor = None
|
version_minor = None
|
||||||
version_rc = None
|
version_rc = None
|
||||||
for line in open(os.path.normpath("../acrn-hypervisor/Makefile")) :
|
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)]
|
key, val = [x.strip() for x in line.split('=', 2)]
|
||||||
if key == 'MAJOR_VERSION':
|
if key == 'MAJOR_VERSION':
|
||||||
version_major = val
|
version_major = val
|
||||||
@ -124,6 +128,7 @@ except ImportError:
|
|||||||
'searchbox.html',
|
'searchbox.html',
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
sys.stderr.write('Warning: sphinx_rtd_theme missing. Use pip to install it.\n')
|
||||||
else:
|
else:
|
||||||
html_theme = "sphinx_rtd_theme"
|
html_theme = "sphinx_rtd_theme"
|
||||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||||
|
Loading…
Reference in New Issue
Block a user