X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=generate-documentation.py;h=613dec73940f7c2f11cb6d5fa625e28dd1c67209;hb=38dbac3e0b3c24486d3f548ae63dabd6e1d73bc3;hp=f0b73873a4a94108dbc93c0689996d817d8828d3;hpb=e5152598cf72fb46c396f79edebc68e9fb4fec73;p=dygraphs.git diff --git a/generate-documentation.py b/generate-documentation.py index f0b7387..613dec7 100755 --- a/generate-documentation.py +++ b/generate-documentation.py @@ -1,4 +1,7 @@ -#!/usr/bin/python +#!/usr/bin/env python + +# Generate docs/options.html + import json import glob import re @@ -12,12 +15,14 @@ debug_tests = [] # [ 'tests/zoom.html' ] # Pull options reference JSON out of dygraph.js js = '' in_json = False -for line in file('dygraph.js'): +for line in file('dygraph-options-reference.js'): if '' in line: in_json = True elif '' in line: in_json = False elif in_json: + if line.endswith("\\\n"): # hacked in line continuation support with trailing \. + line = line[:-2] js += line # TODO(danvk): better errors here. @@ -68,7 +73,7 @@ for nu, opt in docs.iteritems(): if label not in labels: labels.append(label) -print """ +print """ Dygraphs Options Reference @@ -77,6 +82,9 @@ print """ p.option { padding-left: 25px; } + div.parameters { + padding-left: 15px; + } #nav { position: fixed; } @@ -89,7 +97,7 @@ print """ """ print """ -