dcc-tiler 0.1.2

A library and CLI for counting / rendering tilings of various shapes
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# This script is used to generate the example images located in the img/ directory
# This is done by scanning the README.md file for images

import re
import os

# This regex matches expressions of the form:
RE = re.compile(r"!\[dcc_tiler_cli --single (.*?)\]\(img\/(.*?)\.svg\)")

# This forms the base for the command that we eventually run
command = "cargo run --release -- --single {} > img/{}.svg"

with open("README.md", "r") as readme:
    for line in readme.readlines():
        # find all matches as above
        for (options, filename) in RE.findall(line):
            os.system(command.format(options, filename))