Skip to content

Commit

Permalink
Integrate spec_splitter into the publishing flow
Browse files Browse the repository at this point in the history
  • Loading branch information
rubys committed Aug 16, 2012
1 parent 56b30ef commit 4abbc15
Show file tree
Hide file tree
Showing 5 changed files with 471 additions and 437 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
scripts/*.pyc
output
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ Deliverables of the HTML Working Group
Build instructions:

python scripts/publish.py [html|2dcontext]

output is placed in output/[html|2dcontext]
24 changes: 22 additions & 2 deletions scripts/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@

if len(sys.argv)>1 and sys.argv[1] == 'html':
select = 'w3c-html'
spec = 'html'
elif len(sys.argv)>1 and sys.argv[1] == '2dcontext':
select = '2dcontext'
spec = select = '2dcontext'
else:
sys.stderr.write("Usage: python %s [html|2dcontext]\n" % sys.argv[0])
exit()

print 'parsing'
os.chdir(os.path.abspath(os.path.join(__file__, '../..')))
source = open('source')
succint = StringIO()
Expand Down Expand Up @@ -54,10 +56,28 @@
'w3c_compat_xref_normalization': False,
}

print 'indexing'
filtered.seek(0)
tree = generator.fromFile(filtered, **opts)
filtered.close()

output = open('Overview.html', 'wb')
try:
os.makedirs('output/%s' % spec)
except:
pass

if spec == 'html':
output = open('output/html/onepage.html', 'wb')
else:
output = open('output/%s/Overview.html' % spec, 'wb')

generator.toFile(tree, output, **opts)
output.close()

if spec == 'html':
print 'splitting'
import spec_splitter
spec_splitter.w3c = True
spec_splitter.main('output/html/onepage.html', 'output/html')
os.rename('output/html/Overview.html', 'output/html/spec.html')
os.rename('output/html/onepage.html', 'output/html/Overview.html')
Loading

0 comments on commit 4abbc15

Please sign in to comment.