Only read spec headers when rendering index
This commit is contained in:
@ -31,10 +31,14 @@ def spec_index():
|
|||||||
for f in os.listdir(SPEC_DIR):
|
for f in os.listdir(SPEC_DIR):
|
||||||
if f.endswith('.rst'):
|
if f.endswith('.rst'):
|
||||||
path = safe_join(SPEC_DIR, f)
|
path = safe_join(SPEC_DIR, f)
|
||||||
# read file
|
# read file header
|
||||||
|
header = ''
|
||||||
with codecs.open(path, encoding='utf-8') as fd:
|
with codecs.open(path, encoding='utf-8') as fd:
|
||||||
content = fd.read()
|
for line in fd:
|
||||||
parts = publish_parts(source=content, source_path=SPEC_DIR, writer_name="html")
|
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'])
|
meta = get_metadata_from_meta(parts['meta'])
|
||||||
|
|
||||||
spec = {
|
spec = {
|
||||||
|
Reference in New Issue
Block a user