How to use the pcbdraw.mdrenderer function in PcbDraw

To help you get started, we’ve selected a few PcbDraw examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yaqwsx / PcbDraw / pcbdraw / populate.py View on Github external
try:
        validate_args(args)
    except RuntimeError as e:
        print(e)
        sys.exit(1)

    if args["type"] == "html":
        renderer = Renderer(mistune.Renderer)
        outputfile = "index.html"
        try:
            template = read_template(find_data_file(args["template"], '.handlebars', TEMPLATES_SUBDIR))
        except IOError:
            print("Cannot open template file " + args["template"])
            sys.exit(1)
    else:
        renderer = Renderer(pcbdraw.mdrenderer.MdRenderer)
        outputfile = "index.md"
    content = parse_content(renderer, content)
    content = generate_images(content, args["board"], args["libs"],
        args["params"], args["img_name"], args["output"])
    if args["type"] == "html":
        output = generate_html(template, content)
    else:
        output = generate_markdown(content)

    with open(os.path.join(args["output"], outputfile), "wb") as f:
        f.write(output)

PcbDraw

Utility to produce nice looking drawings of KiCAD boards

MIT
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis

Similar packages