def space_after_each_listing_x():
    "Ensures there's a space after each code listing"
    with Path(config.combined_markdown).open(encoding="utf8") as ojmd:
        book = ojmd.readlines()
    cl = CodeListing(book, 0)
    while cl:
        cl.ensure_trailing_space()
        cl = CodeListing.next(cl)
示例#2
0
def space_after_each_listing_x():
    "Ensures there's a space after each code listing"
    with Path(config.combined_markdown).open(encoding="utf8") as ojmd:
        book = ojmd.readlines()
    cl = CodeListing(book, 0)
    while cl:
        cl.ensure_trailing_space()
        cl = CodeListing.next(cl)
示例#3
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))