Fix a subtle rendering bug when catting spec sections

Throw in gendoc.py if a spec section doesn't end with \n\n

There needs to be TWO new lines at the end of each spec section else the
title of the next section merges into the last paragraph of the earlier
section. This happens without rst2html producing a warning, and results
in the section heading of a file disappearing(!)
pull/977/head
Kegan Dougal 9 years ago
parent 8e7b33ac99
commit ad26b7f8cb

@ -18,7 +18,14 @@ def glob_spec_to(out_file_name):
with open(out_file_name, "wb") as outfile:
for f in sorted(glob.glob("../specification/*.rst")):
with open(f, "rb") as infile:
outfile.write(infile.read())
section = infile.read()
# we need TWO new lines else the next file's title gets merged
# the last paragraph *WITHOUT RST PRODUCING A WARNING*
if not section[-2:] == '\n\n':
raise Exception(
"The file " + f + " does not end with 2 new lines."
)
outfile.write(section)
def rst2html(i, o):

Loading…
Cancel
Save