acrn-hypervisor/doc/scripts/show-versions.py
David B. Kinder 0e317d56bf doc: clean up PDF generation for ACRN docs
PRs #5945 and #5949 introduced fixes to the doc building process to
support PDF generation of the documentation set.  This PR refines the
doc build process, cleaning up the Makefile, adding display of tool
version information, and updates the doc building documentation to
include additional dependencies needed for building the PDF and
instructions for how to build the PDF.  The latexpdf make target is
provided to just run the latex and PDF producing process that depends on
the HTML artifacts from a make html run.  A new make pdf target is
provided that combines the two steps into one.

A new know-issues pattern file is added that verifies the expected
output from the latexpdf process is returned, as it can't be completely
eliminated without losing potential error messages that need to be
resolved.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-04-26 19:50:44 -07:00

44 lines
1.3 KiB
Python
Executable File

#!/usr/bin/env python3
#
# Copyright (c) 2018, Intel Corporation
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Show installed versions of doc building tools
import os.path
import sys
import pkg_resources
import subprocess
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
# Check all requirements listed in requirements.txt and print out version installed (if any)
print ("doc build tool versions found on your system...\n")
rf = open(os.path.join(sys.path[0], "requirements.txt"),"r")
for reqs in pkg_resources.parse_requirements(rf):
try:
ver = pkg_resources.get_distribution(reqs.project_name).version
print (" " + reqs.project_name.ljust(25," ") + " version: " + ver)
except:
print (color.RED + color.BOLD + reqs.project_name + " is missing." + color.END +
" (Hint: install all dependencies with " + color.YELLOW +
"\"pip3 install --user -r scripts/requirements.txt\"" + color.END + ")")
rf.close()
# Print out the version of Doxygen (not installed via pip3)
print (" " + "doxygen".ljust(25," ") + " version: " + subprocess.check_output(["doxygen", "-v"]).decode("utf-8"))