mirror of https://github.com/zulip/zulip.git
Add a tool to draw the Django template inheritance graph
(imported from commit e10bb719d62a76abfea76c7fc69093a3cc33272e)
This commit is contained in:
parent
dbd88b28f3
commit
37c51b80cc
|
@ -0,0 +1 @@
|
|||
/graph.svg
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
# Draws the Django template inheritance graph.
|
||||
|
||||
cd "$(dirname "$0")"/../templates
|
||||
|
||||
(
|
||||
echo 'digraph {'
|
||||
for t in $(find -name '*.html' -printf '%P\n'); do
|
||||
echo "\"$t\";"
|
||||
perl -lne 'print "\"'"$t"'\" -> \"$1\";" if m/{%\s*extends\s*"([^"]+)"/' "$t"
|
||||
done
|
||||
echo '}'
|
||||
) > graph.dot
|
||||
|
||||
dot -Tsvg graph.dot > graph.svg
|
||||
rm graph.dot
|
||||
echo file://"$(pwd)"/graph.svg
|
Loading…
Reference in New Issue