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

Add feature for arbitrary number of paragraphs and sentences per page

parent a1a94294
......@@ -114,6 +114,3 @@ _book
*.epub
*.mobi
*.pdf
ABOUT.markdown
SUMMARY.markdown
## Readme
Vel torquent no tristique eget magnapraesent. Laoreet lectusnullam labore primis interdumdonec, nostra ex illum sea sagittis vehicula pretium sem quisque. Felissed class metus diam duimauris fringilla nisl, commodo per amet feliscras senectus varius. Dictumst tortorcurabitur netus molestie, pulvinarvestibulum sanctus elit enim in class est. Magnis rhoncusmaecenas lectusnullam ornare, arcumorbi vero curae lacusut placerat auctormauris. Parturient risusdonec commodo magnapraesent conubia. Sempermorbi minim. Cubilia sanctus. Ad ea velit fringilla, delenit mattis habitant. Curabitur cubilia pretium, elitvivamus sea antesuspendisse faucibusvestibulum lobortisetiam dis ipsuminteger. Velit liberoduis etiam platea quod, nascetur sollicitudin natoque neque diam dictum sea convallis. Nam dapibusnam dictumst netus, sea aenean aptent laoreet at minim. Bibendumin ipsumcurabitur minim soluta iusto integer euismod, nobis lacusnulla imperdietaliquam tristique ea. Ut curae congue maecenas, semvestibulum volutpatut sadipscing. Malesuadanullam mipellentesque. Turpis eleifend fusce, liber sollicitudin lectusnullam sagittis vestibulum dapibusnam sadipscing. Sit nullamauris non dolore volutpat aliquet tation, tortorvestibulum tristique eget cubilia viverra doming elitduis. Erosin sedfusce congue accumsan, sempermorbi blandit vulputate augue mollis diaminteger consectetur elementum. Molestie quisque lacus qui, morbi tempus aliquet faucibusvestibulum tristique. Nec lobortisetiam malesuadanullam facilisisat nisl, purusvestibulum odio dapibus luctus. Sadipscing eos rutrum eget lacinia. Quod exerci sit elitr facilisinam mazim primis, felissed vel cubilia aliquyam magna senectus facilisisat facilisi. Placerat tation sea, accusam ornare fermentumfusce bibendumin. Antesuspendisse ridiculus massa minulla ea tortorcurabitur. Tortor nostrud felis te. Imperdiet minulla magnapraesent nondonec voluptua zzril, nisised viverra consectetur justocras lorem iriure bibendum ipsumcurabitur. Nullam metus. Vestibulum volutpatut varius montes. Imperdietaliquam dictumst natoque euismod rebum, fusce tellus himenaeos feliscras ultricies odio. Faucibusvestibulum eu maurisaenean aliquammauris taciti hac, facer aliquip placerat labore. Sodalessed assum natoque ante euismod tortor, dolore augue diam et pulvinarvestibulum interdum sempermorbi. Ligula luptatum feugait dolor gravida et quisque, facilisisproin nullasuspendisse eum euismod bibendum nulla. Vero ipsuminteger esse cubilia, lacusut sociosqu enimaliquam ligula sodalessed variuscras eos. Imperdiet id fermentum malesuadanullam nunccurabitur facilisisat lectusnullam, ultrices enimnulla pulvinarvestibulum proin mipellentesque per rhoncusmaecenas morbi. Variuscras quammaecenas aptent facilisis magnis. In aptent urnamorbi, gravida rutrum elitduis interdumdonec. Torquent arcumorbi. Semper potenti, habitasse nobis ultriciespellentesque bibendumin congue. Condimentum primis volutpat porta ad, dignissim sodalessed sadipscing. Erosin urna maurisaenean nisised, tortorcurabitur montes facilisisproin commodo arcumorbi aliquet potenti.
# SUMMARY
* [Strand](strand.md)
* [Kit](kit.md)
* [Scope](scope.md)
* [Bulkheads](bulkheads.md)
* [Share](share.md)
* [Decrements](decrements.md)
* [Techniques](techniques.md)
* [Sirs](sirs.md)
* [Ceilings](ceilings.md)
* [Fireball](fireball.md)
* [Cords](cords.md)
* [Winch](winch.md)
* [Ornaments](ornaments.md)
* [Televisions](televisions.md)
* [Subsystems](subsystems.md)
* [Listing](listing.md)
* [Delegate](delegate.md)
* [Sense](sense.md)
* [Quantity](quantity.md)
* [Storms](storms.md)
* [Honor](honor.md)
* [Regret](regret.md)
* [Cakes](cakes.md)
* [Illustration](illustration.md)
* [Boiler](boiler.md)
* [Situations](situations.md)
* [Streak](streak.md)
* [Titles](titles.md)
* [Hardware](hardware.md)
* [Odor](odor.md)
* [Core](core.md)
* [Crystal](crystal.md)
* [Nail](nail.md)
* [Dimensions](dimensions.md)
* [Velocity](velocity.md)
* [Corrections](corrections.md)
* [Access](access.md)
* [Pupil](pupil.md)
* [Gland](gland.md)
* [Doorstep](doorstep.md)
* [Binder](binder.md)
* [Splint](splint.md)
* [Communication](communication.md)
* [Stacks](stacks.md)
* [Reduction](reduction.md)
* [Outfits](outfits.md)
* [Behavior](behavior.md)
* [Crack](crack.md)
* [Saturday](saturday.md)
* [Tubing](tubing.md)
* [Floods](floods.md)
* [Course](course.md)
* [Hazard](hazard.md)
* [Officials](officials.md)
* [Respiration](respiration.md)
* [Cork](cork.md)
* [Explosion](explosion.md)
* [Lesson](lesson.md)
* [Facepiece](facepiece.md)
* [Hertz](hertz.md)
* [Jars](jars.md)
* [Flanges](flanges.md)
* [Floor](floor.md)
* [Lid](lid.md)
* [Overloads](overloads.md)
* [Fold](fold.md)
* [Aviation](aviation.md)
* [Spares](spares.md)
* [Hands](hands.md)
* [Miles](miles.md)
* [Points](points.md)
* [Maneuver](maneuver.md)
* [Flowers](flowers.md)
* [Effects](effects.md)
* [Alignment](alignment.md)
* [Polish](polish.md)
* [Magnet](magnet.md)
* [Carpets](carpets.md)
* [Masters](masters.md)
* [Lard](lard.md)
* [Weight](weight.md)
* [Fathoms](fathoms.md)
* [Spare](spare.md)
* [Relocations](relocations.md)
* [Petition](petition.md)
* [Transit](transit.md)
* [Occurrences](occurrences.md)
* [Meals](meals.md)
* [Semaphores](semaphores.md)
* [Aluminum](aluminum.md)
* [Ton](ton.md)
* [Tip](tip.md)
* [Analyses](analyses.md)
* [Maneuvers](maneuvers.md)
* [Braid](braid.md)
* [Buckets](buckets.md)
* [Gangways](gangways.md)
* [Hut](hut.md)
* [Freezes](freezes.md)
* [Scratch](scratch.md)
{
"structure": {
"readme": "ABOUT.markdown",
"summary": "SUMMARY.markdown"
"readme": "ABOUT.md",
"summary": "SUMMARY.md"
}
}
......@@ -2,6 +2,7 @@
import os
import glob
from random import randrange
# Reference: http://click.pocoo.org/5/
import click
......@@ -13,7 +14,7 @@ def cli():
click.echo("+++ Generating GitBook...")
@cli.command()
@click.option('--pagecount', default=5, help='Number of pages.')
@click.option('--pagecount', default=5, help='Number of pages generated.')
def fake(pagecount):
"""Generates a faked GitBook."""
page_titles = generate_list_of_pages(pagecount)
......@@ -43,23 +44,31 @@ def generate_lorem(page_title):
li = LoremIpsum()
text = ""
dummyparagraph = li.get_sentences(40)
dummyheadline = li.get_sentences(1)
# Random number of paragraphs per page
rnd_paragraphs = randrange(2, 10)
# The headline of the page
text += "## {}\n\n".format(page_title.capitalize())
text += "{}\n\n".format(dummyparagraph)
# Generate differing number of sentences and paragraphs
# per page.
for rnd_p in range(rnd_paragraphs):
rnd_sentences = randrange(5, 15)
dummyparagraph = li.get_sentences(rnd_sentences)
text += "{}\n\n".format(dummyparagraph)
return text
def generate_ABOUT():
readme_text = generate_lorem("README")
r = open('ABOUT.markdown', 'w')
r = open('ABOUT.md', 'w')
r.write(readme_text)
r.close()
def generate_SUMMARY(page_titles):
s = open('SUMMARY.markdown', 'w')
s = open('SUMMARY.md', 'w')
list_of_files = "# SUMMARY\n\n"
......@@ -81,6 +90,7 @@ def clear():
"""Deletes everything generated."""
for f in glob.glob('*.md'):
os.remove(f)
click.echo('Deleted the GitBook!')
if __name__ == "__main__":
cli()
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