19 |
# MA 02111-1307 USA |
# MA 02111-1307 USA |
20 |
# |
# |
21 |
|
|
22 |
|
# $Id$ |
23 |
|
|
24 |
# |
# |
25 |
# Written by Benja Fallensten, Vesa Kaihlavirta, Asko Soukka |
# Written by Benja Fallensten, Vesa Kaihlavirta, Asko Soukka |
26 |
# |
# |
138 |
rstfiles = [f for f in peg['files'] if f.endswith('.rst')] |
rstfiles = [f for f in peg['files'] if f.endswith('.rst')] |
139 |
|
|
140 |
for rstfile in rstfiles: |
for rstfile in rstfiles: |
141 |
|
config.input_filename = rstfile |
142 |
|
config.output_filename = '' |
143 |
pub = Publisher() |
pub = Publisher() |
144 |
pub.set_reader('standalone', None, 'restructuredtext') |
pub.set_reader('standalone', None, 'restructuredtext') |
145 |
filename = _slashify(config.working_directory)+rstfile |
filename = _slashify(config.working_directory)+rstfile |
149 |
try: |
try: |
150 |
pub.set_io() |
pub.set_io() |
151 |
document = pub.reader.read(pub.source, pub.parser, pub.settings) |
document = pub.reader.read(pub.source, pub.parser, pub.settings) |
152 |
|
config.output_filename = rstfile[0:len(rstfile)-4]+'.gen.html' |
153 |
pub.apply_transforms(document) |
pub.apply_transforms(document) |
154 |
peg['ignore'].append(rstfile[0:len(rstfile)-4]+'.gen.html') |
peg['ignore'].append(config.output_filename) |
155 |
|
config.output_filename = '' |
156 |
|
|
157 |
#conversion have succeeded so far, parsing peg's metadata |
#conversion have succeeded so far, parsing peg's metadata |
158 |
#from its document tree |
#from its document tree |
187 |
elif file[len(file)-4:len(file)] in ('.rst', '.txt'): |
elif file[len(file)-4:len(file)] in ('.rst', '.txt'): |
188 |
peg['html'] = file |
peg['html'] = file |
189 |
break |
break |
190 |
|
config.intput_filename = '' |
191 |
|
|
192 |
#finally adds peg's metadata into pegtable |
#finally adds peg's metadata into pegtable |
193 |
pegtable.append(peg) |
pegtable.append(peg) |
194 |
|
|