Only read spec headers when rendering index

This commit is contained in:
str4d
2015-11-25 01:45:01 +00:00
parent e85e0effd8
commit d4a964ecb4

View File

@ -31,10 +31,14 @@ def spec_index():
for f in os.listdir(SPEC_DIR):
if f.endswith('.rst'):
path = safe_join(SPEC_DIR, f)
# read file
# read file header
header = ''
with codecs.open(path, encoding='utf-8') as fd:
content = fd.read()
parts = publish_parts(source=content, source_path=SPEC_DIR, writer_name="html")
for line in fd:
header += line
if not line.strip():
break
parts = publish_parts(source=header, source_path=SPEC_DIR, writer_name="html")
meta = get_metadata_from_meta(parts['meta'])
spec = {