generated from nhcarrigan/template
81 lines
2.0 KiB
Markdown
81 lines
2.0 KiB
Markdown
# Deepgram QR Code Generator
|
|
|
|
CLI tool for generating branded Deepgram QR codes from the command line. Uses the same
|
|
[`qr-code-styling`](https://github.com/kozakdenys/qr-code-styling) library as the original
|
|
browser tool — output is identical.
|
|
|
|
Each generated QR code includes:
|
|
- Large circular dots (the `qr-code-styling` "dots" style)
|
|
- Extra-rounded corner squares
|
|
- Deepgram logo centred in the QR matrix
|
|
- White padding border
|
|
- "POWERED BY DEEPGRAM" branding strip at the bottom
|
|
|
|
## Prerequisites
|
|
|
|
- **Node.js** 18+ and **pnpm**
|
|
- System libraries required by the `canvas` package (Cairo, Pango, etc.):
|
|
|
|
```bash
|
|
# Ubuntu / Debian
|
|
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
|
|
|
|
# macOS (Homebrew)
|
|
brew install pkg-config cairo pango libpng jpeg giflib librsvg pixman
|
|
```
|
|
|
|
See the [`canvas` installation docs](https://github.com/Automattic/node-canvas#compiling) for
|
|
other platforms.
|
|
|
|
## Setup
|
|
|
|
```bash
|
|
pnpm install
|
|
```
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
pnpm generate -- <url> [<url> ...]
|
|
```
|
|
|
|
### Examples
|
|
|
|
Generate a single QR code:
|
|
|
|
```bash
|
|
pnpm generate -- https://dpgr.am/ucb-ai-careers
|
|
```
|
|
|
|
Generate multiple QR codes in one go:
|
|
|
|
```bash
|
|
pnpm generate -- https://dpgr.am/ucb-ai-careers https://dpgr.am/ucb-ai-intern
|
|
```
|
|
|
|
URLs without a scheme are accepted — `https://` is prepended automatically:
|
|
|
|
```bash
|
|
pnpm generate -- dpgr.am/ucb-ai-careers
|
|
```
|
|
|
|
## Output
|
|
|
|
Generated files are saved to the `output/` directory (created automatically). Each file is named
|
|
after the URL slug:
|
|
|
|
```
|
|
output/dpgr-am-ucb-ai-careers.png
|
|
output/dpgr-am-ucb-ai-intern.png
|
|
```
|
|
|
|
The `output/` directory is gitignored — generated files are not committed to the repo.
|
|
|
|
## Dependencies
|
|
|
|
| Package | Version | Purpose |
|
|
|---|---|---|
|
|
| `qr-code-styling` | 1.6.0 | QR code generation (dots, corner styles, layout) |
|
|
| `canvas` | 3.2.3 | Node.js canvas for logo overlay and branding composite |
|
|
| `@xmldom/xmldom` | 0.9.10 | Lightweight DOM polyfill required by qr-code-styling |
|