Exemplo n.º 1
0
def main():
    devices = database.get_devices()
    shutil.rmtree("work_html", ignore_errors=True)
    os.mkdir("work_html")
    commit_hash = database.get_db_commit()
    build_dt = time.strftime('%Y-%m-%d %H:%M:%S')

    docs_toc = ""
    for architecture in sorted(devices["architectures"].keys()):
        docs_toc += "<h3>{} Architecture</h3>".format(architecture.upper())
        docs_toc += "<h4>Bitstream Documentation</h4>"
        docs_toc += "<ul>"
        for part in sorted(
                devices["architectures"][architecture]["parts"].keys()):
            docs_toc += '<li><a href="{}">{} Documentation</a></li>'.format(
                '{}.html'.format(part), part.upper())
            html_tilegrid.main([
                "html_tilegrid", architecture, part,
                path.join("work_html", part + ".html")
            ])
        docs_toc += "</ul>"
    index_html = Template(tang_docs_index).substitute(datetime=build_dt,
                                                      commit=commit_hash,
                                                      docs_toc=docs_toc)
    with open(path.join("work_html", "index.html"), 'w') as f:
        f.write(index_html)
Exemplo n.º 2
0
def main():
	devices = database.get_devices()
	shutil.rmtree("work_html", ignore_errors=True)
	os.mkdir("work_html")
	commit_hash = database.get_db_commit()
	build_dt = time.strftime('%Y-%m-%d %H:%M:%S')

	docs_toc = ""
	for family in sorted(devices["families"].keys()):
		print("Family: " + family)
		docs_toc += "<h3>{} Family</h3>".format(family.upper())
		docs_toc += "<h4>Bitstream Documentation</h4>"
		docs_toc += "<ul>"
		for device in sorted(devices["families"][family]["devices"].keys()):
			print("Device: " + device)
			docs_toc += '<li><a href="{}">{} Documentation</a></li>'.format('{}.html'.format(device),device.upper())
			html_tilegrid.main(["html_tilegrid", family,  device, path.join("work_html",device + ".html")])
		docs_toc += "</ul>"
	index_html = Template(tang_docs_index).substitute(
		datetime=build_dt,
		commit=commit_hash,
		docs_toc=docs_toc
	)
	with open(path.join("work_html", "index.html"), 'w') as f:
		f.write(index_html)
Exemplo n.º 3
0
def generate_device_docs(family, device, folder):
    html_tilegrid.main(
        ["html_tilegrid", family, device,
         path.join(folder, "index.html")])