Commit 61f03911 authored by Axel Dürkop's avatar Axel Dürkop
Browse files

Add main script

parent b9d3fca9
#!/usr/bin/env python3
from random_words import LoremIpsum
bookpages = ['einleitung.md', 'hauptteil.md', 'mittelteil.md', 'schluss.md']
def generate_fakebook():
generate_README()
generate_SUMMARY()
for page in bookpages:
open_file_and_write(page)
def open_file_and_write(page):
text = generate_lorem()
tmp_file = open(page, "w")
tmp_file.write(text)
tmp_file.close()
def generate_lorem():
li = LoremIpsum()
text = ""
dummyparagraph = li.get_sentences(40)
dummyheadline = li.get_sentences(1)
text += "## {}\n\n".format(dummyheadline)
text += "{}\n\n".format(dummyparagraph)
return text
def generate_README():
readme_text = generate_lorem()
r = open('README.md', 'w')
r.write(readme_text)
r.close()
def generate_SUMMARY():
s = open('SUMMARY.md', 'w')
list_of_files = "# SUMMARY\n\n"
for p in bookpages:
list_of_files += "- [{}]({})\n".format(p,p)
s.write(list_of_files)
s.close()
if __name__ == "__main__":
generate_fakebook()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment