Size: 1099
Comment:
|
Size: 1103
Comment: converted to 1.6 markup
|
Deletions are marked like this. | Additions are marked like this. |
Line 8: | Line 8: |
http://starship.python.net/crew/friedrich/HTMLgen/image/docclass.jpg | {{http://starship.python.net/crew/friedrich/HTMLgen/image/docclass.jpg}} |
HTMLgen. [Python]에서 [HTML]을 만들어내는 모듈. 최대한 [OOP]적으로 [HTML]들을 만들어낼 수 있다.
http://starship.python.net/crew/friedrich/HTMLgen/html/main.html
다음의 문서들을 만들어낼 수 있는데,
가장 기본적인 SimpleDocument의 사용
import HTMLgen d=HTMLgen.SimpleDocument() p=HTMLgen.Paragraph("this is test") d.append(p) print d
좀 더 복잡한 SeriesDocument : 링크정보나 전후정보들을 사용할때
def overview(filename, aft=None, fore=None, top=None, home=None): doc=SeriesDocument("HTMLgen.rc") #문서에 필요한 리소스를 읽는다. doc.title=doctitle doc.subtitle='Overview' doc.banner=('../image/HTMLgen_banner.jpg') doc.goprev, doc.gonext, doc.gotop, doc.gohome = aft,fore,top,home doc.append_file(os.path.join(datadir, 'overview-txt.html')) #기존에 만들어둔 페이지 삽입 doc.write(os.path.join(htmldir,filename))