def main(name, filename, *argv): # print the contents of the given file ft = Filist(filename) ft.sub_lines(r'<programlisting>plasTeXpython', r'<programlisting language="python">') ft.sub_lines(r'plasTeXangle', r'<>') # label the last chapters as appendices #i, match = ft.search_lines('<chapter id="tools">') #ft.sub_lines(r'<chapter', r'<appendix', start=i) #ft.sub_lines(r'</chapter', r'</appendix', start=i+1) ft.sub_lines( r'<emphasis role="bold">[email protected]</emphasis>', r'<phrase role="keep-together"><emphasis role="bold">[email protected]</emphasis></phrase>' ) print ft
def main(name, filename, *argv): # print the contents of the given file ft = Filist(filename) ft.move_indexterms() ft.sub_lines(r'section\*', r'section') ft.sub_lines(r'\\begin{code}', r'\\begin{verbatim}plasTeXjava') ft.sub_lines(r'\\end{code}', r'\\end{verbatim}') ft.sub_lines(r'\\begin{stdout}', r'\\begin{verbatim}') ft.sub_lines(r'\\end{stdout}', r'\\end{verbatim}') ft.sub_lines(r'Chapter~\\ref', r'~\\ref') ft.sub_lines(r'Section~\\ref', r'~\\ref') ft.sub_lines(r'page~\\pageref', r'~\\ref') ft.sub_lines(r'Figure~\\ref', r'~\\ref') ft.sub_lines(r'Exercise~\\ref', r'~\\ref') ft.sub_lines(r'\\java{\\%', r'\\java{%') print ft
def main(name, filename, *argv): # print the contents of the given file ft = Filist(filename) ft.sub_lines(r'<programlisting>plasTeXjava', r'<programlisting language="java">') # label the last three chapters as appendices i, match = ft.search_lines('<chapter id="development">') ft.sub_lines(r'<chapter', r'<appendix', start=i) ft.sub_lines(r'</chapter', r'</appendix', start=i+1) ft.sub_lines(r'<emphasis role="bold">[email protected]</emphasis>', r'<phrase role="keep-together"><emphasis role="bold">[email protected]</emphasis></phrase>') print ft