148 |
pub.apply_transforms(document) |
pub.apply_transforms(document) |
149 |
peg['cvsignore'].append(rstfile[0:len(rstfile)-4]+'.gen.html') |
peg['cvsignore'].append(rstfile[0:len(rstfile)-4]+'.gen.html') |
150 |
|
|
151 |
#conversion have succeeded so far, parsing peg's metadata |
#conversion have succeeded so far, parsing peg's metadata |
152 |
#from its document tree |
#from its document tree |
153 |
if rstfile == peg['rst']: |
if rstfile == peg['rst']: |
154 |
peg['html'] = rstfile[0:len(rstfile)-4]+'.gen.html' |
peg['html'] = rstfile[0:len(rstfile)-4]+'.gen.html' |
155 |
peg['topic'] = getTagValue(document, 'title', always_raw=1) |
peg['topic'] = getTagValue(document, 'title', always_raw=1) |
156 |
peg['topic'] = peg['topic'] |
peg['topic'] = peg['topic'] |
157 |
peg['last-modified'] = getFieldTagValue(document, 'last-modified') |
peg['last-modified'] = getFieldTagValue(document, 'last-modified') |
158 |
#we may have got 'rawsource', which needs some tidying |
#we may have got 'rawsource', which needs some tidying |
159 |
if peg['last-modified'].startswith('$Date'): |
if peg['last-modified'].startswith('$Date'): |
160 |
peg['last-modified'] = peg['last-modified'][7:len(peg['last-modified'])-11].replace('/', '-') |
peg['last-modified'] = peg['last-modified'][7:len(peg['last-modified'])-11].replace('/', '-') |
161 |
peg['status'] = getTagValue(document, 'status') or undefined |
peg['status'] = getTagValue(document, 'status') or undefined |
162 |
stakeholders = getFieldTagValue(document, 'stakeholder') |
stakeholders = getFieldTagValue(document, 'stakeholder') |
163 |
if not stakeholders: |
if not stakeholders: |
164 |
stakeholders = getFieldTagValue(document, 'stakeholders') |
stakeholders = getFieldTagValue(document, 'stakeholders') |
165 |
peg['stakeholders'] = [s.strip() for s in stakeholders.split(',')] |
peg['stakeholders'] = [s.strip() for s in stakeholders.split(',')] |
166 |
peg['authors'] = getTagValue(document, 'author', all=1) |
peg['authors'] = getTagValue(document, 'author', all=1) |
167 |
else: |
else: |
168 |
status = getTagValue(document, 'status') |
status = getTagValue(document, 'status') |
169 |
if status: |
if status: |
170 |
peg['rstfiles'].append({'filename': rstfile, 'status': status}) |
peg['rstfiles'].append({'filename': rstfile, 'status': status}) |
171 |
|
|
172 |
except: |
except: |
173 |
dbg_fail('PEG %s: Docutil raised an exception while converting %s. ' % (pegdir, rstfile)) |
dbg_fail('PEG %s: Docutil raised an exception while converting %s. ' % (pegdir, rstfile)) |