From: Magnus Jacobsson Date: Sun, 7 Jun 2020 15:47:15 +0000 (+0200) Subject: Add HTML output format X-Git-Tag: 2.44.1~11^2^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fff9bc2862c2b947cb9f4d4151479217549ea931;p=graphviz Add HTML output format --- diff --git a/ci/generate-configuration-table.py b/ci/generate-configuration-table.py index c8954fd1b..f47cbc259 100755 --- a/ci/generate-configuration-table.py +++ b/ci/generate-configuration-table.py @@ -5,10 +5,12 @@ from optparse import OptionParser import os import json import sys +import re def main(): supported_output_formats = [ 'JSON', + 'HTML', ] parser = OptionParser(usage='usage: %prog [options] files...') parser.description = 'Generate a table of the Graphviz compile ' \ @@ -61,6 +63,63 @@ def main(): if opts.output_format.upper() == 'JSON': print(json.dumps(table, indent=4)) + elif opts.output_format.upper() == 'HTML': + colspan = str(len(platforms) + 1) + indent = '' + print(indent + '') + print(indent + '') + indent += ' ' + print(indent + '') + indent += ' ' + print(indent + '') + print(indent + '') + indent = indent[:-2] + print(indent + '') + print(indent + '') + indent += ' ' + header = table_sections[0].replace('will be', 'was') + print(indent + '

' + header + ':

') + print(indent + '') + indent += ' ' + print(indent + '') + indent += ' ' + print(indent + '') + indent += ' ' + print(indent + '') + for platform in platforms: + print(indent + '') + indent = indent[:-2] + print(indent + '') + print(indent + '') + print(indent + '') + indent += ' ' + indent = indent[:-2] + for section_name in table_sections[1:]: + print(indent + '') + for component_name in component_names[section_name]: + print(indent + '') + indent += ' ' + print(indent + '') + for platform in platforms: + component_value = table[section_name][component_name][platform] + print(indent + '') + indent = indent[:-2] + print(indent + '') + print(indent + '') + indent = indent[:-2] + print(indent + '') + indent = indent[:-2] + print(indent + '
' + platform + '
' + section_name + ':
' + component_name + '' + component_value + '
 
') + indent = indent[:-2] + print(indent + '') + indent = indent[:-2] + print(indent + '') # Python trick to get a main routine if __name__ == "__main__":