bidi2pdf 0.1.24 โ 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.agents/plugins/marketplace.json +21 -0
- data/CHANGELOG.md +25 -2
- data/README.md +27 -2
- data/lib/bidi2pdf/version.rb +1 -1
- data/lib/bidi2pdf.rb +4 -1
- data/sig/bidi2pdf/version.rbs +1 -1
- data/site/index.html +135 -0
- data/site/llms.txt +22 -0
- data/site/sitemap.xml +5 -0
- metadata +5 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f000e35aacf91ebfd7691be7ce8e989ab8d384dd96075e9ef705692f5f68bc3b
|
|
4
|
+
data.tar.gz: ef370866fad4eacca3d74a23f4ea7b83caf157f498cae29c26fcdb19757ada9e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a6025a10a1ebab333371dbf80e8d733e57052a08da043574e9b661551f02259c163afc7b0fe79580faafe5e4a1ad8bb03ab1655074eea77d77f02fd80b6c10f
|
|
7
|
+
data.tar.gz: efa593482aba4d15785007ac2612afafbe61f04c8dc6555b6052e7cb04d775661b2d0b2d286fe64a401fe22cc7050697b734aae1a2c97f0b4c88d28856134a6f
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bidi2pdf",
|
|
3
|
+
"interface": {
|
|
4
|
+
"displayName": "bidi2pdf"
|
|
5
|
+
},
|
|
6
|
+
"plugins": [
|
|
7
|
+
{
|
|
8
|
+
"name": "bidi2pdf",
|
|
9
|
+
"source": {
|
|
10
|
+
"source": "local",
|
|
11
|
+
"path": "./claude-plugin"
|
|
12
|
+
},
|
|
13
|
+
"policy": {
|
|
14
|
+
"installation": "AVAILABLE",
|
|
15
|
+
"authentication": "ON_USE",
|
|
16
|
+
"products": ["CODEX"]
|
|
17
|
+
},
|
|
18
|
+
"category": "Developer Tools"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
data/CHANGELOG.md
CHANGED
|
@@ -8,10 +8,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
-
[unreleased]: https://github.com/dieter-medium/bidi2pdf/compare/v0.1.
|
|
11
|
+
[unreleased]: https://github.com/dieter-medium/bidi2pdf/compare/v0.1.25..HEAD
|
|
12
12
|
|
|
13
13
|
<!-- generated by git-cliff end -->
|
|
14
14
|
|
|
15
|
+
## [0.1.25] - 2026-10-27
|
|
16
|
+
|
|
17
|
+
### ๐ Fixed
|
|
18
|
+
- Keep the websocket-native hint off stdout
|
|
19
|
+
- Load the version constant with the library
|
|
20
|
+
- Trim plugin ground rules and preflight
|
|
21
|
+
- Keep plugin agents on bidi2pdf's own path
|
|
22
|
+
- Follow the gem's 0.1.25.pre in the Codex manifest
|
|
23
|
+
- Set SKILL_DIR before the screenshot script runs
|
|
24
|
+
- Check landing page options per command
|
|
25
|
+
|
|
26
|
+
### ๐ Changed
|
|
27
|
+
- Merge pull request #181 from dieter-medium/fix/require-version
|
|
28
|
+
- Merge pull request #180 from dieter-medium/fix/plugin-ground-rules
|
|
29
|
+
- Merge pull request #179 from dieter-medium/feat/codex-plugin
|
|
30
|
+
- Merge pull request #178 from dieter-medium/feat/agent-landing-page
|
|
31
|
+
- Merge pull request #177 from dieter-medium/chore/plugin-icon
|
|
32
|
+
|
|
33
|
+
### ๐ Added
|
|
34
|
+
- Offer the plugin's skills to Codex
|
|
35
|
+
- Publish a landing page and llms.txt for agents
|
|
36
|
+
|
|
15
37
|
## [0.1.24] - 2026-10-27
|
|
16
38
|
|
|
17
39
|
### ๐ Fixed
|
|
@@ -611,7 +633,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
611
633
|
|
|
612
634
|
### ๐ Released
|
|
613
635
|
|
|
614
|
-
- [unreleased](https://github.com/dieter-medium/bidi2pdf/compare/v0.1.
|
|
636
|
+
- [unreleased](https://github.com/dieter-medium/bidi2pdf/compare/v0.1.25..HEAD)
|
|
637
|
+
- [0.1.25](https://github.com/dieter-medium/bidi2pdf/compare/v0.1.24..v0.1.25)
|
|
615
638
|
- [0.1.24](https://github.com/dieter-medium/bidi2pdf/compare/v0.1.23..v0.1.24)
|
|
616
639
|
- [0.1.23](https://github.com/dieter-medium/bidi2pdf/compare/v0.1.22..v0.1.23)
|
|
617
640
|
- [0.1.22](https://github.com/dieter-medium/bidi2pdf/compare/v0.1.21..v0.1.22)
|
data/README.md
CHANGED
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
**BiDirectional (BiDi)** protocol. Whether you're automating reports, archiving websites, or shipping documentation,
|
|
12
12
|
Bidi2pdf gives you **precision, flexibility, and full control**.
|
|
13
13
|
|
|
14
|
+
**For agents and automation:** the use cases on one page - [dieter-medium.github.io/bidi2pdf](https://dieter-medium.github.io/bidi2pdf/),
|
|
15
|
+
and as plain text for language models: [llms.txt](https://dieter-medium.github.io/bidi2pdf/llms.txt). Both are
|
|
16
|
+
published from `site/` by `.github/workflows/pages.yml`.
|
|
17
|
+
|
|
14
18
|
---
|
|
15
19
|
|
|
16
20
|
## ๐ Table of Contents
|
|
@@ -202,7 +206,8 @@ still emits exactly this shape, with `ok: false` and a structured `error` (`code
|
|
|
202
206
|
### stdin/stdout, manifests, and progress streaming
|
|
203
207
|
|
|
204
208
|
```bash
|
|
205
|
-
# Render HTML piped on stdin, PDF bytes piped out on stdout - no
|
|
209
|
+
# Render HTML piped on stdin, PDF bytes piped out on stdout - no input or output file of your own
|
|
210
|
+
# (the PDF goes straight to stdout; the HTML is kept in a temporary file while Chrome loads it, then deleted)
|
|
206
211
|
cat page.html | bidi2pdf render --stdin --output - > page.pdf
|
|
207
212
|
|
|
208
213
|
# A render manifest: enough to reproduce and diagnose the render later
|
|
@@ -283,13 +288,17 @@ agent uses bidi2pdf the way it is meant to be used instead of guessing options:
|
|
|
283
288
|
|
|
284
289
|
| Skill | For |
|
|
285
290
|
|---|---|
|
|
286
|
-
| `render-pdf` | a URL or HTML file to PDF with the CLI: order of commands, waits, screen/dark/mobile view, reading the JSON result and exit codes |
|
|
291
|
+
| `render-pdf` | a URL or HTML file to PDF with the CLI: a preflight that suggests how to get Ruby and a browser, order of commands, waits, screen/dark/mobile view, reading the JSON result and exit codes |
|
|
287
292
|
| `pdf-recipe` | a recipe for pages that need steps before printing, validated without a browser |
|
|
288
293
|
| `diagnose-pdf` | a blank, unstyled or wrongly paged PDF: a checklist around `bidi2pdf diagnose` |
|
|
289
294
|
| `remote-chrome` | a shared chromedriver container: settings, sizing, session cleanup, untrusted HTML |
|
|
290
295
|
| `page-screenshots` | review screenshots per page at phone and desktop width, light and dark (with a script) |
|
|
291
296
|
| `pdf-specs` | RSpec specs with the gem's PDF matchers and Chrome container helpers |
|
|
292
297
|
|
|
298
|
+
Every skill starts with short ground rules: bidi2pdf is the only renderer (a failure is reported,
|
|
299
|
+
not worked around with another PDF engine), nothing is installed without the user's go-ahead, and
|
|
300
|
+
bidi2pdf's own JSON result comes before other PDF tools. `render-pdf`'s preflight has the setup details.
|
|
301
|
+
|
|
293
302
|
#### Installing the skills
|
|
294
303
|
|
|
295
304
|
The plugin is not in a central store: this repository is its own Claude Code marketplace
|
|
@@ -361,6 +370,22 @@ shapes; a spec (`spec/unit/claude_plugin_spec.rb`) checks every command, option,
|
|
|
361
370
|
method they name against the gem, so they cannot drift from it. The plugin is not part of the gem
|
|
362
371
|
itself.
|
|
363
372
|
|
|
373
|
+
#### In Codex
|
|
374
|
+
|
|
375
|
+
The same six skills install in OpenAI's Codex. Codex reads the plugin folder through its portable manifest
|
|
376
|
+
(`claude-plugin/plugin.json`, Agent Plugins 1.0.0, listing under `extensions.com.openai`) and the repository's
|
|
377
|
+
own marketplace, `.agents/plugins/marketplace.json`:
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
codex plugin marketplace add dieter-medium/bidi2pdf # follows the default branch
|
|
381
|
+
codex plugin marketplace add dieter-medium/bidi2pdf@v<version> # pinned to a release tag (or a commit SHA)
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
Then install **bidi2pdf** from that marketplace in Codex's plugin browser (`/plugins` in the CLI, or the
|
|
385
|
+
Plugins Directory in the desktop app) and start a new session. The marketplace entry offers the plugin for Codex
|
|
386
|
+
only (`"products": ["CODEX"]`, as in OpenAI's own marketplace): the skills run `bidi2pdf` in a shell, which
|
|
387
|
+
ChatGPT does not have. `codex plugin marketplace upgrade bidi2pdf` fetches a newer state of the marketplace.
|
|
388
|
+
|
|
364
389
|
---
|
|
365
390
|
|
|
366
391
|
## ๐ง Programmatic API
|
data/lib/bidi2pdf/version.rb
CHANGED
data/lib/bidi2pdf.rb
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
require "concurrent-ruby"
|
|
4
4
|
require "logger"
|
|
5
5
|
|
|
6
|
+
require_relative "bidi2pdf/version"
|
|
6
7
|
require_relative "bidi2pdf/process_tree"
|
|
7
8
|
require_relative "bidi2pdf/launcher"
|
|
8
9
|
require_relative "bidi2pdf/bidi/session"
|
|
@@ -193,7 +194,9 @@ module Bidi2pdf # rubocop:disable Metrics/ModuleLength
|
|
|
193
194
|
rescue LoadError => e
|
|
194
195
|
raise unless e.message =~ /websocket-native/
|
|
195
196
|
|
|
196
|
-
|
|
197
|
+
# Debug, not warn: this runs while the library loads, before the CLI moves logs off stdout, and a
|
|
198
|
+
# missing optional speed-up is no problem to report on every run.
|
|
199
|
+
logger.debug "websocket-native not available; installing it may enhance performance."
|
|
197
200
|
end
|
|
198
201
|
end
|
|
199
202
|
|
data/sig/bidi2pdf/version.rbs
CHANGED
data/site/index.html
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>bidi2pdf โ HTML to PDF with Chrome's BiDi protocol, for scripts, CI and AI agents</title>
|
|
7
|
+
<meta name="description" content="bidi2pdf is an open-source Ruby gem and CLI that converts web pages and HTML to PDF with headless Chrome over WebDriver BiDi โ for Ruby and Rails apps, CI pipelines and AI agents: JSON results, stable exit codes, page diagnosis and declarative recipes.">
|
|
8
|
+
<link rel="canonical" href="https://dieter-medium.github.io/bidi2pdf/">
|
|
9
|
+
<link rel="alternate" type="text/plain" href="llms.txt" title="llms.txt">
|
|
10
|
+
<link rel="icon" type="image/png" href="icon.png">
|
|
11
|
+
<meta property="og:type" content="website">
|
|
12
|
+
<meta property="og:title" content="bidi2pdf โ HTML to PDF for scripts, CI and AI agents">
|
|
13
|
+
<meta property="og:description" content="Render URLs and HTML to PDF with headless Chrome over WebDriver BiDi: JSON output, exit codes, JSON Schemas, diagnosis and recipes.">
|
|
14
|
+
<meta property="og:url" content="https://dieter-medium.github.io/bidi2pdf/">
|
|
15
|
+
<meta property="og:image" content="https://dieter-medium.github.io/bidi2pdf/icon.png">
|
|
16
|
+
<script type="application/ld+json">
|
|
17
|
+
{
|
|
18
|
+
"@context": "https://schema.org",
|
|
19
|
+
"@type": "SoftwareSourceCode",
|
|
20
|
+
"name": "bidi2pdf",
|
|
21
|
+
"description": "A Ruby gem and CLI that renders URLs and HTML to PDF and screenshots with headless Chrome over WebDriver BiDi, with structured JSON output for scripts, CI and AI agents.",
|
|
22
|
+
"codeRepository": "https://github.com/dieter-medium/bidi2pdf",
|
|
23
|
+
"programmingLanguage": "Ruby",
|
|
24
|
+
"runtimePlatform": "Ruby 3.4 or later, Chrome or Chromium",
|
|
25
|
+
"license": "https://opensource.org/licenses/MIT",
|
|
26
|
+
"url": "https://dieter-medium.github.io/bidi2pdf/",
|
|
27
|
+
"keywords": ["HTML to PDF", "PDF generation", "headless Chrome", "WebDriver BiDi", "CLI", "Ruby", "Rails", "AI agents", "Claude Code"]
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
<style>
|
|
31
|
+
:root { color-scheme: light dark; --bg: #fffce6; --fg: #1b1b18; --muted: #55534a; --accent: #b23a26; --panel: #fff8d6; --line: #e7dfb5; }
|
|
32
|
+
@media (prefers-color-scheme: dark) {
|
|
33
|
+
:root { --bg: #16150f; --fg: #f3f0dc; --muted: #c4c0a8; --accent: #f08a73; --panel: #22201a; --line: #3a372c; }
|
|
34
|
+
}
|
|
35
|
+
* { box-sizing: border-box; }
|
|
36
|
+
body { margin: 0; background: var(--bg); color: var(--fg); font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
37
|
+
main { max-width: 46rem; margin: 0 auto; padding: 2.5rem 1rem 4rem; }
|
|
38
|
+
header { display: flex; align-items: center; gap: 1rem; }
|
|
39
|
+
header img { width: 4rem; height: 4rem; border-radius: 0.75rem; }
|
|
40
|
+
h1 { font-size: 2rem; line-height: 1.2; margin: 0; }
|
|
41
|
+
.lead { font-size: 1.15rem; color: var(--muted); }
|
|
42
|
+
h2 { font-size: 1.35rem; margin: 2.5rem 0 0.75rem; }
|
|
43
|
+
a { color: var(--accent); }
|
|
44
|
+
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
|
|
45
|
+
ul { padding-left: 1.25rem; }
|
|
46
|
+
li { margin: 0.4rem 0; }
|
|
47
|
+
pre { background: var(--panel); border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.9rem 1rem; overflow-x: auto; font-size: 0.9rem; line-height: 1.5; }
|
|
48
|
+
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
|
|
49
|
+
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
|
|
50
|
+
th, td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
51
|
+
footer { margin-top: 3rem; color: var(--muted); font-size: 0.95rem; }
|
|
52
|
+
@media (max-width: 30rem) {
|
|
53
|
+
header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
|
|
54
|
+
h1 { font-size: 1.6rem; }
|
|
55
|
+
}
|
|
56
|
+
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
|
|
57
|
+
</style>
|
|
58
|
+
</head>
|
|
59
|
+
<body>
|
|
60
|
+
<main>
|
|
61
|
+
<header>
|
|
62
|
+
<img src="icon.png" alt="" width="64" height="64">
|
|
63
|
+
<h1>HTML to PDF in Ruby, with headless Chrome and WebDriver BiDi</h1>
|
|
64
|
+
</header>
|
|
65
|
+
<p class="lead"><strong>bidi2pdf</strong> is an open-source Ruby gem and command-line tool that turns web pages and HTML into PDFs. It is built for developers, CI pipelines and AI coding agents that need PDF generation they can script: structured JSON results, predictable exit codes and rendering by a real browser.</p>
|
|
66
|
+
|
|
67
|
+
<h2 id="use-cases">What it does</h2>
|
|
68
|
+
<ul>
|
|
69
|
+
<li><strong>A web page or HTML file to PDF</strong> from the command line, with waits for page load or network idle, cookies, headers and basic auth.</li>
|
|
70
|
+
<li><strong>HTML in, PDF out</strong>: <code>--stdin</code> and <code>--output -</code> pipe without an input or output file of your own. The PDF goes straight to stdout; the piped HTML is kept in a temporary file while Chrome loads it, then deleted.</li>
|
|
71
|
+
<li><strong>Automation and agents</strong>: with <code>--json</code>, stdout carries exactly one JSON document per call; failures come back in the same shape with a structured error and a stable exit code; the JSON Schema of every shape is built in.</li>
|
|
72
|
+
<li><strong>Why does the PDF not look like the page?</strong> <code>bidi2pdf diagnose</code> reports console errors, failed requests, font loading, print rules and Paged.js โ without producing a PDF.</li>
|
|
73
|
+
<li><strong>Pages that need steps before printing</strong>: declarative recipes, validated without launching a browser.</li>
|
|
74
|
+
<li><strong>Screen, dark and mobile views</strong> of a page as PDF (<code>--media</code>, <code>--color_scheme</code>), and screenshots through the Ruby API, for review.</li>
|
|
75
|
+
<li><strong>A shared remote Chrome</strong> for several processes โ Puma workers, job workers โ with pre-warmed sessions and a sweeper for leaked ones.</li>
|
|
76
|
+
<li><strong>Ruby and Rails</strong>: a programmatic API and DSL, <a href="https://github.com/dieter-medium/bidi2pdf-rails">bidi2pdf-rails</a> for <code>render pdf:</code> in controllers, and RSpec matchers for PDF specs.</li>
|
|
77
|
+
</ul>
|
|
78
|
+
|
|
79
|
+
<h2 id="quick-start">Quick start</h2>
|
|
80
|
+
<pre tabindex="0"><code>gem install bidi2pdf
|
|
81
|
+
bidi2pdf render --url https://example.com --output example.pdf</code></pre>
|
|
82
|
+
<p>Requires Ruby 3.4 or later and Chrome or Chromium โ or use the published Docker image.</p>
|
|
83
|
+
|
|
84
|
+
<h2 id="tasks">Common tasks</h2>
|
|
85
|
+
<ul>
|
|
86
|
+
<li><strong>Generate PDFs in Ruby or Rails</strong> โ reports, invoices and other HTML templates, rendered by headless Chrome: <a href="https://github.com/dieter-medium/bidi2pdf-rails">bidi2pdf-rails</a> gives controllers <code>render pdf:</code>; plain Ruby uses the gem's API.</li>
|
|
87
|
+
<li><strong>Convert HTML to PDF in CI</strong> โ one command, then read <code>ok</code> and the exit code instead of parsing logs:
|
|
88
|
+
<pre tabindex="0"><code>bidi2pdf render --html-file report.html --output report.pdf --json</code></pre></li>
|
|
89
|
+
<li><strong>Debug a PDF that looks wrong</strong> โ missing fonts, failed requests, print CSS, JavaScript errors, without producing a PDF:
|
|
90
|
+
<pre tabindex="0"><code>bidi2pdf diagnose --url https://example.com/invoice --json</code></pre></li>
|
|
91
|
+
</ul>
|
|
92
|
+
|
|
93
|
+
<h2 id="when">When to use bidi2pdf</h2>
|
|
94
|
+
<p>It fits when the PDF should look like the page does in a browser โ modern CSS, web fonts, content a script renders, Paged.js print layouts โ because Chrome itself renders it; when PDFs are made unattended, in CI, background jobs or by an agent, and a failure has to say what went wrong; and when the code around it is Ruby or Rails, or several processes share one remote Chrome.</p>
|
|
95
|
+
<p>Something else fits better when the PDF is drawn in code rather than from HTML โ a PDF library does that without a browser โ or where neither Chrome nor Docker can run.</p>
|
|
96
|
+
|
|
97
|
+
<h2 id="agents">For agents and CI</h2>
|
|
98
|
+
<pre tabindex="0"><code># check compatibility - no browser launched
|
|
99
|
+
bidi2pdf version --json
|
|
100
|
+
|
|
101
|
+
# discover the shape of every result
|
|
102
|
+
bidi2pdf schema render
|
|
103
|
+
|
|
104
|
+
# validate a recipe without a browser, then run it
|
|
105
|
+
bidi2pdf run recipe.yml --validate
|
|
106
|
+
bidi2pdf run recipe.yml --json
|
|
107
|
+
|
|
108
|
+
# render with a machine-readable result
|
|
109
|
+
bidi2pdf render --url https://example.com --output example.pdf --json</code></pre>
|
|
110
|
+
<table>
|
|
111
|
+
<caption class="visually-hidden">Exit codes</caption>
|
|
112
|
+
<thead><tr><th scope="col">Exit code</th><th scope="col">Meaning</th></tr></thead>
|
|
113
|
+
<tbody>
|
|
114
|
+
<tr><td><code>0</code></td><td>success</td></tr>
|
|
115
|
+
<tr><td><code>2</code></td><td>CLI, configuration or recipe-validation error</td></tr>
|
|
116
|
+
<tr><td><code>3</code></td><td>browser or navigation error</td></tr>
|
|
117
|
+
<tr><td><code>4</code></td><td>page not as expected (a recipe action or assertion, or a diagnose selector, failed)</td></tr>
|
|
118
|
+
<tr><td><code>6</code></td><td>output or PDF generation failure</td></tr>
|
|
119
|
+
<tr><td><code>70</code></td><td>unexpected internal error</td></tr>
|
|
120
|
+
</tbody>
|
|
121
|
+
</table>
|
|
122
|
+
<p>Details: <a href="https://github.com/dieter-medium/bidi2pdf#structured-render-output">structured output</a>, <a href="https://github.com/dieter-medium/bidi2pdf#stdinstdout-manifests-and-progress-streaming">stdin/stdout and progress events</a>, <a href="https://github.com/dieter-medium/bidi2pdf#diagnosing-a-page-before-trusting-its-pdf">diagnose</a>, <a href="https://github.com/dieter-medium/bidi2pdf#declarative-recipes">recipes</a>. A plain-text summary for language models: <a href="llms.txt">llms.txt</a>.</p>
|
|
123
|
+
|
|
124
|
+
<h2 id="claude-code">Claude Code plugin</h2>
|
|
125
|
+
<p>Six skills teach an agent to use bidi2pdf as intended: rendering, recipes, diagnosing a wrong PDF, a shared remote Chrome, review screenshots and PDF specs.</p>
|
|
126
|
+
<pre tabindex="0"><code>/plugin marketplace add dieter-medium/bidi2pdf
|
|
127
|
+
/plugin install bidi2pdf@bidi2pdf</code></pre>
|
|
128
|
+
<p><a href="https://github.com/dieter-medium/bidi2pdf#claude-code-skills">About the skills</a></p>
|
|
129
|
+
|
|
130
|
+
<footer>
|
|
131
|
+
<p><a href="https://github.com/dieter-medium/bidi2pdf">Source on GitHub</a> ยท <a href="https://rubygems.org/gems/bidi2pdf">RubyGems</a> ยท <a href="https://github.com/dieter-medium/bidi2pdf/blob/main/CHANGELOG.md">Changelog</a> ยท MIT License</p>
|
|
132
|
+
</footer>
|
|
133
|
+
</main>
|
|
134
|
+
</body>
|
|
135
|
+
</html>
|
data/site/llms.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# bidi2pdf
|
|
2
|
+
|
|
3
|
+
> bidi2pdf is a Ruby gem and CLI that renders a URL or HTML to PDF with headless Chrome over WebDriver BiDi. It is built to be driven by scripts, CI and AI agents: with `--json` every call writes exactly one JSON document to stdout, failures come back in the same shape with a structured error and a stable exit code, and the JSON Schema of every result is built into the CLI.
|
|
4
|
+
|
|
5
|
+
Use it to: render a web page or HTML file to PDF (`bidi2pdf render --url https://example.com --output example.pdf`); pipe HTML in and PDF out (`--stdin`, `--output -`); find out why a PDF does not look like the page (`bidi2pdf diagnose`); print pages that need steps first with declarative recipes, validated without a browser (`bidi2pdf run recipe.yml --validate`); print screen, dark or mobile views (`--media`, `--color_scheme`); share one remote Chrome between processes with pre-warmed sessions; render from Ruby, Rails (bidi2pdf-rails) and RSpec.
|
|
6
|
+
|
|
7
|
+
Start with `bidi2pdf version --json` (no browser launched), then `bidi2pdf schema render`, `bidi2pdf schema diagnose`, `bidi2pdf schema run` or `bidi2pdf schema recipe` for the shape of a result or a recipe. Exit codes: 0 success, 2 CLI/configuration/recipe-validation error, 3 browser or navigation error, 4 page not as expected, 6 output or PDF generation failure, 70 unexpected internal error. Requires Ruby 3.4 or later and Chrome or Chromium; a Docker image is published.
|
|
8
|
+
|
|
9
|
+
## Docs
|
|
10
|
+
|
|
11
|
+
- [README](https://github.com/dieter-medium/bidi2pdf#readme): installation, CLI, library API, Docker, configuration
|
|
12
|
+
- [Structured render output](https://github.com/dieter-medium/bidi2pdf#structured-render-output): the JSON result and exit codes
|
|
13
|
+
- [stdin/stdout, manifests and progress streaming](https://github.com/dieter-medium/bidi2pdf#stdinstdout-manifests-and-progress-streaming): piping, render manifests, NDJSON progress events
|
|
14
|
+
- [Diagnosing a page](https://github.com/dieter-medium/bidi2pdf#diagnosing-a-page-before-trusting-its-pdf): console errors, failed requests, fonts, print rules, Paged.js
|
|
15
|
+
- [Declarative recipes](https://github.com/dieter-medium/bidi2pdf#declarative-recipes): waits and PDF assertions as a YAML contract
|
|
16
|
+
- [Claude Code skills](https://github.com/dieter-medium/bidi2pdf#claude-code-skills): the plugin with six skills and how to install it
|
|
17
|
+
|
|
18
|
+
## Optional
|
|
19
|
+
|
|
20
|
+
- [Rails integration](https://github.com/dieter-medium/bidi2pdf-rails): `render pdf:` in controllers
|
|
21
|
+
- [Changelog](https://github.com/dieter-medium/bidi2pdf/blob/main/CHANGELOG.md)
|
|
22
|
+
- [RubyGems](https://rubygems.org/gems/bidi2pdf)
|
data/site/sitemap.xml
ADDED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bidi2pdf
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.25
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dieter S.
|
|
@@ -391,6 +391,7 @@ executables:
|
|
|
391
391
|
extensions: []
|
|
392
392
|
extra_rdoc_files: []
|
|
393
393
|
files:
|
|
394
|
+
- ".agents/plugins/marketplace.json"
|
|
394
395
|
- ".devcontainer/Dockerfile"
|
|
395
396
|
- ".devcontainer/devcontainer.json"
|
|
396
397
|
- ".devcontainer/docker-compose.yml"
|
|
@@ -632,6 +633,9 @@ files:
|
|
|
632
633
|
- sig/bidi2pdf/verbose_logger.rbs
|
|
633
634
|
- sig/bidi2pdf/version.rbs
|
|
634
635
|
- sig/vendor/thor.rbs
|
|
636
|
+
- site/index.html
|
|
637
|
+
- site/llms.txt
|
|
638
|
+
- site/sitemap.xml
|
|
635
639
|
- tasks/changelog.rake
|
|
636
640
|
- tasks/coverage.rake
|
|
637
641
|
- tasks/generate_rbs.rake
|