# This python script generates the extra files needed for the frames # version of the manual. It generates the files: # indexframes.html, contents.html and title.html # Output is based on html files created by Michael Rhoades # Script written by Andres Cabrera June 2006 # Licensed under the GPL licence version 3 or later import sys from xml.dom import minidom version = sys.argv[1:] if (len(version)==0): version=[''] indexframesFile = open('html/indexframes.html','w') creditsFile = open('html/credits.html','w') titleFile = open('html/title.html','w') contentsFile = open('html/contents.html','w') indexFile = open('html/index.html','r') index = indexFile.read() indexFile.seek(0) indexparse = minidom.parse(indexFile) frameLink = '''

Frames Version

''' s = '''

The Canonical Csound Reference Manual

''' titleEnd = index.find(s) + len(s) + 1 if (index[titleEnd:titleEnd+len(frameLink)]==frameLink): print '''************************************** Warning: index.html already processed! **************************************''' # indexframes.html ----------------------------------------- indexframesFile.write('''\n\n Csound ''' +version[0]+ ''' Manual - Frames Version <body> <p>This page uses frames, but your browser doesn\'t support them.</p> </body> ''') indexframesFile.close() # credits.html ----------------------------------------- creditsFile.write('''\n \n ''') creditsFile.write(index[index.find('
')+106]) creditsFile.write('
\n \n') creditsFile.close() # title.html ----------------------------------------- titleFile.write('''\n\n The Canonical Csound Reference Manual\n

The Canonical Csound Reference Manual
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | R | S | T | U | V | W | X | Z |
Score Statements | GEN Routines | Quick Reference

\n\n''') titleFile.close() # contents.html ----------------------------------------- contentsFile.write(''' Contents