Crates.io | kicad-text-injector |
lib.rs | kicad-text-injector |
version | 0.3.1 |
source | src |
created_at | 2021-08-08 17:24:38.335057 |
updated_at | 2024-06-01 12:22:27.731232 |
description | A tiny CLI tool that replaces variables of the style `${KEY}` within KiCad PCB (pcbnew) files. |
homepage | https://github.com/hoijui/kicad-text-injector |
repository | https://github.com/hoijui/kicad-text-injector |
max_upload_size | |
id | 433254 |
size | 151,760 |
This tool allows you to post-process your KiCad PCB files,
by replacing variables of the type ${NAME}
in your text elements.
You may put placeholder text onto your PCB -
for example ${PROJECT_REPO_URL}
-
on any layer, and this tool then fills in the actual value,
for example https://github.com/myorg/myproj
.
This is most useful for filling in project-specific meta-data into the final output,
and thus this tool is primarily targeting CI jobs,
though it can also be run locally.
You need to install Rust(lang) and Cargo.
Then you can run:
scripts/build
As for now, you have two choices:
$ kicad-text-injector --help
Given a KiCad PCB file (*.kicad_pcb) as input, replaces variables of the type `${KEY}` within text
fields with their respective value.
USAGE:
kicad-text-injector [FLAGS] [OPTIONS] --input <input> --output <output>
FLAGS:
-e, --env use environment variables for substitution in the text
-f, --fail-on-missing-values fail if no value is available for a variable key found in the
input text
-h, --help Prints help information
-v, --verbose more verbose output (useful for debugging)
-V, --version Prints version information
OPTIONS:
-i, --input <input> the input file to use; '-' for stdin [default: -]
-o, --output <output> the output file to use; '-' for stdout [default: -]
-D, --variable <variable>... a variable key-value pair to be used for substitution in the
text
We very warmly recommend you to use the KiBot tool for the actual generation of the final output from the post-processed KiCad sources. It can generate much more then just Gerbers and 2D renders of the PCBs.
Also see the KiCad image/QRCode injector.
This project was funded by the European Regional Development Fund (ERDF) in the context of the INTERFACER Project, from July 2021 until March 2023.