mirror of https://github.com/CrimsonTome/tldr.git
Repaired indentation error.
parent
6251e4eb3b
commit
f320863c9d
|
@ -72,27 +72,27 @@ def main(loc, colorscheme):
|
||||||
# Sorting all filenames in the directory, to maintain the order of the PDF
|
# Sorting all filenames in the directory, to maintain the order of the PDF
|
||||||
allmd.sort()
|
allmd.sort()
|
||||||
|
|
||||||
# Conversion of Markdown to HTML
|
# Conversion of Markdown to HTML
|
||||||
for page_number, md in enumerate(allmd, start=1):
|
for page_number, md in enumerate(allmd, start=1):
|
||||||
|
|
||||||
with open(md, "r") as inp:
|
with open(md, "r") as inp:
|
||||||
text = inp.readlines()
|
text = inp.readlines()
|
||||||
|
|
||||||
with open("htmlout.html", "w") as out:
|
with open("htmlout.html", "w") as out:
|
||||||
out.write(header)
|
out.write(header)
|
||||||
|
|
||||||
for line in text:
|
for line in text:
|
||||||
if re.match(r'^>', line):
|
if re.match(r'^>', line):
|
||||||
line = line[:0] + '####' + line[1:]
|
line = line[:0] + '####' + line[1:]
|
||||||
html = markdown.markdown(line)
|
html = markdown.markdown(line)
|
||||||
out.write(html)
|
out.write(html)
|
||||||
out.write(footer)
|
out.write(footer)
|
||||||
|
|
||||||
group.append(HTML("htmlout.html").render())
|
group.append(HTML("htmlout.html").render())
|
||||||
print("Rendered page {} of the directory {}".format(
|
print("Rendered page {} of the directory {}".format(
|
||||||
str(page_number), operating_sys))
|
str(page_number), operating_sys))
|
||||||
|
|
||||||
allmd.clear()
|
allmd.clear()
|
||||||
|
|
||||||
# Merging all the documents into a single PDF
|
# Merging all the documents into a single PDF
|
||||||
for doc in group:
|
for doc in group:
|
||||||
|
|
Loading…
Reference in New Issue