Example #1
0
def check_for_trailing_hyphen():
    "Make sure there are no lines with broken hyphenation"
    with Path(config.combined_markdown).open(encoding="utf8") as bk:
        book = bk.readlines()
    for n, line in enumerate(book):
        if line.rstrip().endswith("-") and not line.rstrip().endswith("--"):
            print(n, end=": ")
            show(line)
Example #2
0
def check_listing_widths():
    "Make sure listings don't exceed max width of %d" % config.code_width
    listings = CodeListing.parse_listings(config.combined_markdown)
    for listing in listings:
        for n, line in enumerate(listing):
            if len(line) > config.code_width:
                print("-" * 60)
                print(listing[0].rstrip())
                print(n, end=": ")
                show(line)
                print("line length: %d" % len(line))