from argparse import ArgumentParser
import glob
import os
from typing import List
import markdown
from .site_builder import SiteBuilder

MAX_WIDTH = 1000


def buildParser() -> ArgumentParser:
    parser = ArgumentParser(prog="obscura")

    parser.add_argument("input_directory", help="root directory of the gallery to process")
    parser.add_argument("output_directory", help="root directory to output to")

    return parser


image_embed_template = """
<img src="{image_path}" width={width} />
"""


IMAGE_STATS_TABLE = ""


def main() -> None:
    args = buildParser().parse_args()

    destination = os.path.abspath(args.output_directory)
    os.chdir(args.input_directory)
    builder = SiteBuilder("./", destination)
    builder.build()


if __name__ == "__main__":
    main()
