0
Files
src/net/docs/generate-dot-to-svg.py
Eric Roman c6d0333623 Remove //net/docs/README.txt in favor of a shell script.
The comments regarding generating HTML files no longer seems relevant, as the
canonical reference for working with markdown files in Chromium is
https://chromium.googlesource.com/chromium/src/+/master/docs/README.md#Creating-Documentation

This leaves only some notes about how to re-generate the svg files, which seems
better suited for a shell script.

Change-Id: I943b1d387ae578b698d72a30fe7282fe455b8e63
Reviewed-on: https://chromium-review.googlesource.com/1024511
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552824}
2018-04-23 20:52:18 +00:00

24 lines
767 B
Python
Executable File

#!/usr/bin/python
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""The diagrams included in the network stack documentation were
generated with Graphviz, and both source (.dot) and output (.svg) are
included in the repository. If graphviz is installed, the output may
be regenerated by running this script."""
import glob
import os
import subprocess
def main():
for dot_filename in glob.glob("*.dot"):
svg_filename = os.path.splitext(dot_filename)[0] + ".svg"
print "Generating %s from %s" % (svg_filename, dot_filename)
subprocess.check_call(["dot", "-Tsvg", dot_filename, "-o", svg_filename])
if __name__ == "__main__":
main()