brewdoc-linux-x64-glibc 0.3.1 → 0.3.2
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.
- package/README.md +82 -336
- package/binary/_internal/base_library.zip +0 -0
- package/binary/_internal/brewdoc-0.3.2.dist-info/METADATA +157 -0
- package/binary/_internal/{brewdoc-0.3.1.dist-info → brewdoc-0.3.2.dist-info}/RECORD +11 -11
- package/binary/_internal/{brewdoc-0.3.1.dist-info → brewdoc-0.3.2.dist-info}/direct_url.json +1 -1
- package/binary/_internal/brewdoc-0.3.2.dist-info/uv_cache.json +1 -0
- package/binary/brewdoc +0 -0
- package/binary/licenses/installed-manifest.json +1 -1
- package/binary/version.json +2 -2
- package/native-manifest.json +40 -40
- package/native-verification.json +3 -3
- package/package.json +2 -2
- package/binary/_internal/brewdoc-0.3.1.dist-info/METADATA +0 -411
- package/binary/_internal/brewdoc-0.3.1.dist-info/uv_cache.json +0 -1
- /package/binary/_internal/{brewdoc-0.3.1.dist-info → brewdoc-0.3.2.dist-info}/INSTALLER +0 -0
- /package/binary/_internal/{brewdoc-0.3.1.dist-info → brewdoc-0.3.2.dist-info}/REQUESTED +0 -0
- /package/binary/_internal/{brewdoc-0.3.1.dist-info → brewdoc-0.3.2.dist-info}/WHEEL +0 -0
- /package/binary/_internal/{brewdoc-0.3.1.dist-info → brewdoc-0.3.2.dist-info}/entry_points.txt +0 -0
- /package/binary/_internal/{brewdoc-0.3.1.dist-info → brewdoc-0.3.2.dist-info}/licenses/LICENSE +0 -0
- /package/binary/licenses/installed/brewdoc/{brewdoc-0.3.1.dist-info → brewdoc-0.3.2.dist-info}/licenses/LICENSE +0 -0
package/README.md
CHANGED
|
@@ -3,381 +3,127 @@
|
|
|
3
3
|
[](https://pypi.org/project/brewdoc/)
|
|
4
4
|
[](https://github.com/kochetkov-ma/brewdoc/actions/workflows/ci.yml)
|
|
5
5
|
[](https://github.com/kochetkov-ma/brewdoc/releases/latest)
|
|
6
|
-
[](LICENSE)
|
|
6
|
+
[](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/LICENSE)
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
HTML in, one Markdown file plus a JSON receipt out. No models or OCR. Local conversion
|
|
10
|
-
is offline and deterministic (same file, same bytes). Explicit `--url` acquires a page.
|
|
11
|
-
The receipt says what was rendered,
|
|
12
|
-
what was dropped and what the route structurally cannot carry.
|
|
8
|
+
Fast, deterministic document-to-Markdown conversion for agent systems. Easy to install. No model weights, OCR or external services.
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
contains its complete installation guide. Python releases 0.2.0 and 0.3.0 are public.
|
|
18
|
-
These commands select 0.3.1 and apply when that version is published; its
|
|
19
|
-
[release guide](https://github.com/kochetkov-ma/brewdoc/releases/tag/v0.3.1)
|
|
20
|
-
records accepted channels. Badges show published versions and main CI, not universal OS support.
|
|
10
|
+
Local conversion runs offline after installation, with no runtime component downloads.
|
|
11
|
+
Supported documents become one Markdown file and a JSON receipt describing omissions.
|
|
12
|
+
See [supported formats and limits](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/FORMATS.md).
|
|
21
13
|
|
|
22
|
-
|
|
23
|
-
|---|---|
|
|
24
|
-
| pip | `python -m pip install "brewdoc==0.3.1"` in a dedicated virtual environment |
|
|
25
|
-
| uvx, temporary | `uvx --python 3.12 --from "brewdoc==0.3.1" brewdoc file.pdf --out file.md` |
|
|
26
|
-
| uv tool, installed | `uv tool install --python 3.12 "brewdoc==0.3.1"` |
|
|
27
|
-
| pipx, installed | `pipx install --python 3.12 "brewdoc==0.3.1"` |
|
|
28
|
-
| Container recipe (pip) | `RUN pip install brewdoc==0.3.1` |
|
|
14
|
+
## Install
|
|
29
15
|
|
|
30
|
-
|
|
31
|
-
Linux/macOS:
|
|
16
|
+
These examples select 0.3.2. Use a channel listed as available in [that release](https://github.com/kochetkov-ma/brewdoc/releases/tag/v0.3.2). Choose one method:
|
|
32
17
|
|
|
33
18
|
```sh
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
.venv/bin/brewdoc --self-check
|
|
38
|
-
.venv/bin/brewdoc file.pdf --out file.md
|
|
19
|
+
python -m pip install "brewdoc==0.3.2"
|
|
20
|
+
uv tool install --python 3.12 "brewdoc==0.3.2"
|
|
21
|
+
pipx install --python 3.12 "brewdoc==0.3.2"
|
|
39
22
|
```
|
|
40
23
|
|
|
41
|
-
|
|
24
|
+
Use a virtual environment for pip. Python 3.12+ is required; HTML/URL need CPython 3.12-3.14.
|
|
25
|
+
[INSTALL.md](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/INSTALL.md) covers prerequisites, Windows, uvx, PATH, update and removal.
|
|
26
|
+
[Latest release](https://github.com/kochetkov-ma/brewdoc/releases/latest) lists actual assets and channel availability.
|
|
42
27
|
|
|
43
|
-
|
|
44
|
-
py -3.12 -m venv .venv
|
|
45
|
-
.\.venv\Scripts\python.exe -m pip install "brewdoc==0.3.1"
|
|
46
|
-
.\.venv\Scripts\python.exe -c "from importlib.metadata import version; print(version('brewdoc'))"
|
|
47
|
-
.\.venv\Scripts\brewdoc.exe --self-check
|
|
48
|
-
.\.venv\Scripts\brewdoc.exe file.pdf --out file.md
|
|
49
|
-
```
|
|
28
|
+
### Standalone downloads
|
|
50
29
|
|
|
51
|
-
|
|
52
|
-
or `pipx ensurepath`, open a new terminal, then run `brewdoc --self-check` and
|
|
53
|
-
`brewdoc file.pdf --out file.md`. `uv tool list` or `pipx list` shows the managed version.
|
|
54
|
-
Check PATH selection with `command -v brewdoc` on Unix or `Get-Command brewdoc` in PowerShell.
|
|
55
|
-
|
|
56
|
-
For an exact published version X.Y.Z, update with the environment's Python and
|
|
57
|
-
`-m pip install --upgrade "brewdoc==X.Y.Z"`,
|
|
58
|
-
`uv tool install --force --python 3.12 "brewdoc==X.Y.Z"` or
|
|
59
|
-
`pipx install --force --python 3.12 "brewdoc==X.Y.Z"`. Replace X.Y.Z before running.
|
|
60
|
-
Remove with the same Python's `-m pip uninstall brewdoc`, `uv tool uninstall brewdoc`
|
|
61
|
-
or `pipx uninstall brewdoc`. pip leaves dependencies; remove the dedicated virtual
|
|
62
|
-
environment when no longer needed. uvx uses temporary cached environments, adds no
|
|
63
|
-
persistent PATH command and needs no tool uninstall. Choose another exact version to update.
|
|
64
|
-
|
|
65
|
-
### Standalone and npm
|
|
66
|
-
|
|
67
|
-
The links and commands below work when the named release is published and its
|
|
68
|
-
native/public consumer checks pass. Check the
|
|
69
|
-
[release guide](https://github.com/kochetkov-ma/brewdoc/releases/tag/v0.3.1)
|
|
70
|
-
for that version's accepted channels and targets. Download badges select assets;
|
|
71
|
-
they do not establish runtime acceptance. The npm badge shows the registry version.
|
|
72
|
-
Existing 0.2.0/0.3.0 releases contain Python wheel/sdist archives only.
|
|
30
|
+
Use downloads listed as available in the release. Python and dependencies are bundled. Verify [SHA256SUMS](https://github.com/kochetkov-ma/brewdoc/releases/download/v0.3.2/SHA256SUMS) and keep the entire extracted directory.
|
|
73
31
|
|
|
74
|
-
[](https://github.com/kochetkov-ma/brewdoc/releases/download/v0.3.1/brewdoc-0.3.1-macos-arm64.tar.gz)
|
|
78
|
-
|
|
79
|
-
| Native target | Version-specific download | Verification target | JavaScript |
|
|
80
|
-
|---|---|---|---|
|
|
81
|
-
| Linux x86_64, glibc | [Linux archive](https://github.com/kochetkov-ma/brewdoc/releases/download/v0.3.1/brewdoc-0.3.1-linux-x64.tar.gz) | Ubuntu 22.04, glibc 2.35 | Bundled; requires target acceptance |
|
|
82
|
-
| Windows x86_64 | [Windows archive](https://github.com/kochetkov-ma/brewdoc/releases/download/v0.3.1/brewdoc-0.3.1-windows-x64.zip) | Windows Server 2025 | Refused before requests |
|
|
83
|
-
| macOS ARM64 | [macOS archive](https://github.com/kochetkov-ma/brewdoc/releases/download/v0.3.1/brewdoc-0.3.1-macos-arm64.tar.gz) | macOS 15, Apple Silicon | Bundled; requires target acceptance |
|
|
84
|
-
|
|
85
|
-
Download [SHA256SUMS](https://github.com/kochetkov-ma/brewdoc/releases/download/v0.3.1/SHA256SUMS)
|
|
86
|
-
beside the archive. Compare its SHA-256 before extraction with `sha256sum ARCHIVE`
|
|
87
|
-
on Linux, `shasum -a 256 ARCHIVE` on macOS or `Get-FileHash ARCHIVE -Algorithm SHA256`
|
|
88
|
-
in PowerShell. Keep the complete brewdoc directory, including _internal and licenses.
|
|
89
|
-
Read brewdoc/version.json for version/source/target, then run
|
|
90
|
-
`./brewdoc/brewdoc --self-check` or `.\brewdoc\brewdoc.exe --self-check` and use that
|
|
91
|
-
executable with `file.pdf --out file.md`. Add its absolute directory to your shell
|
|
92
|
-
profile or Windows user PATH for persistent use. Update by verifying and extracting
|
|
93
|
-
a fresh complete release directory, self-checking it, then repointing PATH. Remove
|
|
94
|
-
the dedicated directory and PATH entry to uninstall. Full download/extraction commands
|
|
95
|
-
are in the generated guide attached to the published release.
|
|
96
|
-
|
|
97
|
-
Verification targets do not establish older OS support. Linux musl/ARM64 and macOS
|
|
98
|
-
Intel are outside this initial binary set. Windows is unsigned; macOS uses an ad hoc
|
|
99
|
-
build signature without Developer ID/notarization. Linux uses checksums without a
|
|
100
|
-
detached publisher signature. OS policy may prevent launch.
|
|
101
|
-
|
|
102
|
-
npm requires Node 24.21.0/npm 12.2.0 for the tested flow; Python is bundled on admitted
|
|
103
|
-
targets. Once this exact npm release is publicly verified:
|
|
104
|
-
|
|
105
|
-
```sh
|
|
106
|
-
npm install --global brewdoc@0.3.1
|
|
107
|
-
npm list --global brewdoc --depth=0
|
|
108
|
-
brewdoc --self-check
|
|
109
|
-
brewdoc file.pdf --out file.md
|
|
110
|
-
```
|
|
32
|
+
[](https://github.com/kochetkov-ma/brewdoc/releases/download/v0.3.2/brewdoc-0.3.2-linux-x64.tar.gz)
|
|
33
|
+
[](https://github.com/kochetkov-ma/brewdoc/releases/download/v0.3.2/brewdoc-0.3.2-windows-x64.zip)
|
|
34
|
+
[](https://github.com/kochetkov-ma/brewdoc/releases/download/v0.3.2/brewdoc-0.3.2-macos-arm64.tar.gz)
|
|
111
35
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Update with `npm install --global brewdoc@X.Y.Z` for an exact published version;
|
|
120
|
-
remove with `npm uninstall --global brewdoc`. npx installs no persistent global tool;
|
|
121
|
-
choose another exact version to update. Keep optional platform packages enabled.
|
|
122
|
-
Missing packages or unsupported platforms refuse. The launcher adds no runtime downloads.
|
|
36
|
+
| Native target | Verification environment | JavaScript |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| Linux x64/glibc | Ubuntu 22.04, glibc 2.35 | Bundled |
|
|
39
|
+
| Windows x64 | Windows Server 2025 | Refused before requests |
|
|
40
|
+
| macOS ARM64 | macOS 15, Apple Silicon | Bundled |
|
|
123
41
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
42
|
+
Older OSes, Linux musl/ARM64 and macOS Intel are outside this binary set.
|
|
43
|
+
Windows is unsigned; macOS has an ad hoc signature without Developer ID/notarization.
|
|
44
|
+
Linux archives have checksums, without a detached publisher signature. [Download and launch](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/INSTALL.md#standalone).
|
|
127
45
|
|
|
128
|
-
|
|
129
|
-
selectolax==0.4.13; python_version < '3.15' and platform_python_implementation == 'CPython'
|
|
130
|
-
```
|
|
46
|
+
### npm
|
|
131
47
|
|
|
132
|
-
|
|
133
|
-
CPython, a missing or broken parser is an environment failure and `--self-check` exits 1.
|
|
134
|
-
On an unsupported HTML runtime, self-check verifies HTML refusal and checks all other formats.
|
|
48
|
+
[](https://www.npmjs.com/package/brewdoc)
|
|
135
49
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
with `uv sync --locked --extra render-js`. Run it with
|
|
140
|
-
`uv run --locked --extra render-js brewdoc --url URL --render-js`.
|
|
141
|
-
Python and standalone invocations need no Node or browser engine. npm/npx use Node
|
|
142
|
-
as a launcher; no invocation downloads runtime components.
|
|
50
|
+
npm targets Linux x64/glibc and macOS ARM64. Windows uses the GitHub native download or Python package.
|
|
51
|
+
Use npm/npx only when listed as available in [the release](https://github.com/kochetkov-ma/brewdoc/releases/tag/v0.3.2).
|
|
52
|
+
[INSTALL.md](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/INSTALL.md#npm-and-npx) contains exact-version installation, update and removal instructions.
|
|
143
53
|
|
|
144
54
|
## Usage
|
|
145
55
|
|
|
146
|
-
```
|
|
56
|
+
```sh
|
|
147
57
|
brewdoc file.pdf --out file.md
|
|
148
|
-
brewdoc slides.pptx --out slides.md
|
|
149
58
|
brewdoc book.epub --out book.md
|
|
150
|
-
brewdoc
|
|
151
|
-
brewdoc --url https://example.com/article --out article.md
|
|
152
|
-
brewdoc --url https://example.com/article --render-js --timeout 30 --out article.md
|
|
153
|
-
brewdoc file.xlsx # no --out: receipt line, then the Markdown, on stdout
|
|
154
|
-
brewdoc file.xlsx --sheet Calc --sheet Inputs
|
|
59
|
+
brewdoc file.xlsx --sheet Calc --sheet Inputs --out book.md
|
|
155
60
|
brewdoc file.xlsm --artifact formula/sheet/000002=formulas.json
|
|
156
61
|
brewdoc file.xlsm --artifact vba/project/000001=vbaProject.bin
|
|
157
|
-
brewdoc --self-check
|
|
62
|
+
brewdoc --self-check
|
|
158
63
|
```
|
|
159
64
|
|
|
160
|
-
`--sheet`
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
output
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
Local files and default static URL capture do not execute JavaScript.
|
|
176
|
-
|
|
177
|
-
`--render-js` explicitly executes the selected page's scripts locally in a separate
|
|
178
|
-
process with bounded APIs and resources. No filesystem or shell APIs are exposed,
|
|
179
|
-
and captures do not reuse browser state. This is not a general operating-system
|
|
180
|
-
security sandbox. It supports DOM mutations, bounded jobs/timers and guarded GET
|
|
181
|
-
requests. Async XHR also supports the public Algolia search endpoint used by
|
|
182
|
-
hn.algolia.com, with its original string body and no cookies or user credentials.
|
|
183
|
-
Other POST requests remain unsupported; search redirects are refused without replay.
|
|
184
|
-
Supported module loading uses the native engine. Temporary `localStorage`
|
|
185
|
-
starts empty for each capture; accessing it marks the result partial.
|
|
186
|
-
Each capture starts with a writable `innerWidth` of 1024 CSS pixels.
|
|
187
|
-
Width changes stay within that capture.
|
|
188
|
-
It does not provide browser layout, iframe execution,
|
|
189
|
-
workers, WebSockets, media or browser-wide compatibility. Native JS requires a
|
|
190
|
-
verified QuickJS public ABI on macOS ARM64 or 64-bit glibc Linux (x86_64/aarch64).
|
|
191
|
-
Windows, macOS Intel, musl Linux and 32-bit systems refuse JS. Missing components or unsupported
|
|
192
|
-
runtimes refuse before fetching.
|
|
193
|
-
See [URL acquisition limits](FORMATS.md#url-acquisition).
|
|
194
|
-
|
|
195
|
-
URL receipts use `brewdoc.receipt/2` with redacted acquisition provenance and the
|
|
196
|
-
frozen snapshot identity. Timing-only expiry preserves available valid content
|
|
197
|
-
with `acquisition.capture_status=partial` and a diagnostic.
|
|
198
|
-
The receipt distinguishes the current DOM from an explicitly marked fallback to
|
|
199
|
-
the already acquired original HTML, where JS completion is unknown. No HTML is
|
|
200
|
-
returned from an incomplete response. Hard network, security, heap, native fault,
|
|
201
|
-
tamper or resource failures exit 1 and preserve an existing output file.
|
|
202
|
-
Exit 0 confirms conversion, not script completion or article fidelity.
|
|
203
|
-
Live acquisition can change; conversion of the same frozen snapshot remains
|
|
204
|
-
deterministic. No 90% coverage or
|
|
205
|
-
global JavaScript compatibility is claimed.
|
|
206
|
-
|
|
207
|
-
Combining `--url` with a local path or `--self-check`, or using `--render-js` without
|
|
208
|
-
`--url`, exits 2 before acquisition. Invalid timeout values and an explicit
|
|
209
|
-
`--timeout` without `--url` also exit 2. URL requests with `--sheet` or `--artifact`
|
|
210
|
-
exit 1 with an HTML refusal receipt before HTTP.
|
|
211
|
-
|
|
212
|
-
Every successful document uses `brewdoc.markdown/2`. A quoted source title is followed by Metadata,
|
|
213
|
-
Artifacts, Known omissions, Contents, then anchored content units. PDF keys are `page/000001`,
|
|
214
|
-
workbook keys are `sheet/000001`, DOCX keys are `chapter/000001`, PPTX keys are `slide/000001`,
|
|
215
|
-
EPUB keys follow declared spine ordinals as `chapter/000001`, and HTML has one `chapter/000001`.
|
|
216
|
-
Metadata contains deterministic source identity, selection, content hashes, conversion tallies, and
|
|
217
|
-
artifact capabilities. It excludes paths, timestamps, permissions, host data, and unsupported author
|
|
218
|
-
metadata. EPUB adds source-declared publication titles, creators, languages and identifiers.
|
|
219
|
-
|
|
220
|
-
For a conversion request, one JSON receipt line goes to stdout first (wrapped here, `unit_keys` omitted):
|
|
221
|
-
|
|
222
|
-
```json
|
|
223
|
-
{"artifacts": [], "broken_ligature_words": 0, "columns_split": 1,
|
|
224
|
-
"dropped": {"cid_survivors": 0, "control_chars": 0, "ligatures": 0, "nbsp": 0,
|
|
225
|
-
"non_ascii_replaced": 0, "page_numbers": 3, "pua_glyphs": 0,
|
|
226
|
-
"running_heads": 0, "soft_hyphens": 0},
|
|
227
|
-
"file_ok": true, "markdown_schema": "brewdoc.markdown/2",
|
|
228
|
-
"not_carried": ["images, figures and the text drawn inside them",
|
|
229
|
-
"a table that spans a page break",
|
|
230
|
-
"text rotated out of the horizontal reading order"],
|
|
231
|
-
"out": "file.md",
|
|
232
|
-
"reason": "pdf rendered: 7 pages, 1 tables, 26 text regions, 1 column splits",
|
|
233
|
-
"receipt_schema": "brewdoc.receipt/1",
|
|
234
|
-
"route": "pdf", "source": "nist-sp800-145.pdf", "tables": 1,
|
|
235
|
-
"text_regions": 26, "unit_kind": "page", "units": 7}
|
|
236
|
-
```
|
|
65
|
+
`--sheet` and `--artifact` are repeatable and workbook-only. Sheet names are exact and case-sensitive;
|
|
66
|
+
caller order retains full-workbook ordinals. Artifact keys come from the Markdown artifact table.
|
|
67
|
+
Requests and output collisions are validated before writes. Paths resolve against the caller's directory;
|
|
68
|
+
`--out` creates parents. Refusal preserves existing output. Self-check is offline and has its own output.
|
|
69
|
+
|
|
70
|
+
## Markdown and receipts
|
|
71
|
+
|
|
72
|
+
Successful output uses `brewdoc.markdown/2`: quoted source title, Metadata, Artifacts,
|
|
73
|
+
Known omissions, Contents, then anchored units. PDF uses `page/000001`, workbooks `sheet/000001`,
|
|
74
|
+
PPTX `slide/000001`, and DOCX/EPUB/HTML `chapter/000001`. Empty declared units remain navigable.
|
|
75
|
+
Metadata holds source/selection/content hashes, conversion tallies and artifact capabilities;
|
|
76
|
+
it excludes paths, timestamps, permissions and host data. EPUB retains declared publication metadata.
|
|
77
|
+
|
|
78
|
+
Conversion prints one JSON receipt line first. With `--out`, Markdown goes to the file;
|
|
79
|
+
without it, Markdown follows on stdout. Local receipts use `brewdoc.receipt/1`; URL receipts use `brewdoc.receipt/2`.
|
|
237
80
|
|
|
238
|
-
|
|
|
81
|
+
| Receipt fields | Meaning |
|
|
239
82
|
|---|---|
|
|
240
|
-
| `file_ok`, `reason` |
|
|
241
|
-
| `
|
|
242
|
-
| `source` |
|
|
243
|
-
| `
|
|
244
|
-
| `
|
|
245
|
-
| `
|
|
246
|
-
| `
|
|
247
|
-
| `
|
|
248
|
-
| `
|
|
249
|
-
| `
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
## Formats
|
|
258
|
-
|
|
259
|
-
| in | reader | notes |
|
|
260
|
-
|---|---|---|
|
|
261
|
-
| `.pdf` | pdfplumber | needs a text layer; route chosen per region, never per page |
|
|
262
|
-
| `.docx` | stdlib zip + XML | paragraphs and tables |
|
|
263
|
-
| `.pptx` | stdlib zip + XML | slides in declared order; text, tables, notes and picture metadata |
|
|
264
|
-
| `.epub` | stdlib zip + XML | EPUB 2/3 static XHTML in declared spine order; Unicode metadata and navigation |
|
|
265
|
-
| `.xlsx` `.xlsm` `.xls` `.xlsb` `.ods` | python-calamine | selected sheets keep full-source ordinals; numbers as stored (`85.0`), dates as ISO days |
|
|
266
|
-
| `.html` | selectolax Lexbor | full static body or fragment, complete tables and source-declared controls; CPython 3.12-3.14 |
|
|
267
|
-
|
|
268
|
-
`.xlsx` and `.xlsm` expose original OOXML formulas as one deterministic JSON artifact per
|
|
269
|
-
formula-bearing selected sheet. Markdown still contains cached values. `.xlsm` and `.xlsb` can expose
|
|
270
|
-
one complete related `vbaProject.bin` as opaque bytes. brewdoc does not execute macros, decompile VBA,
|
|
271
|
-
report source-module counts, evaluate formulas, or infer dependency graphs.
|
|
272
|
-
|
|
273
|
-
HTML reads local strict UTF-8, with an optional BOM. It preserves meaningful Unicode, navigation,
|
|
274
|
-
main content, sidebars and footers in recovered DOM order. It never fetches links or resources,
|
|
275
|
-
executes scripts, submits forms or infers interactive values. Links use a restricted scheme policy;
|
|
276
|
-
form actions remain inert metadata. Inline code outside tables becomes a literal fenced block;
|
|
277
|
-
surrounding emphasis and links remain balanced. Safe links in literal code and around code/images
|
|
278
|
-
retain destination records without changing the source literals. Table-cell code uses labelled
|
|
279
|
-
escaped text. Quotes and list items containing standalone child blocks use explicit nesting
|
|
280
|
-
boundaries in place of visual Markdown
|
|
281
|
-
containers. Plain list paragraphs retain their item marker and continuation indentation.
|
|
282
|
-
See [HTML scope and limits](FORMATS.md#static-html).
|
|
283
|
-
|
|
284
|
-
EPUB reads one package with static XHTML in EPUB 2 or 3. Each declared spine item becomes
|
|
285
|
-
a chapter, including empty and non-linear items, front matter and back matter. Publication
|
|
286
|
-
navigation retains source hierarchy and links to generated chapter and fragment anchors.
|
|
287
|
-
Declared metadata and meaningful Unicode are preserved. Images remain inert alt/title/target
|
|
288
|
-
records; no pixels or external resources are read. EPUB adds no parser dependency.
|
|
289
|
-
Malformed required content, unsafe archives, unavailable navigation targets, encrypted reading
|
|
290
|
-
text, declared fixed layout and unsupported required media without an XHTML fallback refuse
|
|
291
|
-
the whole book before output writes. Multiple rootfiles are outside this supported profile.
|
|
292
|
-
See [EPUB scope and limits](FORMATS.md#epub).
|
|
293
|
-
|
|
294
|
-
The public Python API exposes EPUB, HTML and presentation rendering and generic workbook artifact access:
|
|
83
|
+
| `file_ok`, `reason` | Conversion success or named refusal |
|
|
84
|
+
| `receipt_schema` | Local brewdoc.receipt/1 or URL brewdoc.receipt/2 |
|
|
85
|
+
| `route`, `source`, `unit_kind`, `units` | Reader, local filename/redacted URL, content kind/count |
|
|
86
|
+
| `tables`, `text_regions`, `columns_split` | Conversion tallies |
|
|
87
|
+
| `dropped`, `broken_ligature_words` | Counted normalization; malformed font words are folded, not guessed |
|
|
88
|
+
| `not_carried` | Structural omissions; read before concluding a fact is absent |
|
|
89
|
+
| `out` | Markdown path, or null for stdout |
|
|
90
|
+
| `markdown_schema`, `unit_keys`, `artifacts` | Success-only schema, ordered source keys and available/requested artifacts |
|
|
91
|
+
| `selected_sheets` | Caller-ordered names, only when selected |
|
|
92
|
+
| `acquisition` | URL provenance, frozen snapshot and capture status |
|
|
93
|
+
|
|
94
|
+
Exit 0 means conversion, 1 refusal and 2 invalid usage. Success does not prove content fidelity or complete JavaScript.
|
|
95
|
+
PDF/DOCX/PPTX/workbooks emit ASCII; HTML/EPUB emit UTF-8 without BOM, with LF newlines. JSON keeps ASCII escaping.
|
|
96
|
+
The same local file or frozen snapshot produces identical bytes; live pages can change.
|
|
97
|
+
|
|
98
|
+
## Python API
|
|
295
99
|
|
|
296
100
|
```python
|
|
297
101
|
import brewdoc
|
|
298
102
|
|
|
299
|
-
markdown, tally = brewdoc.render_epub("book.epub")
|
|
300
103
|
code, receipt, markdown = brewdoc.run("book.epub", out="book.md")
|
|
301
104
|
markdown, tally = brewdoc.render_html("page.html")
|
|
302
|
-
code, receipt, markdown = brewdoc.run("page.html", out="page.md")
|
|
303
|
-
markdown, tally = brewdoc.render_presentation("slides.pptx")
|
|
304
105
|
refs = brewdoc.list_book_artifacts("book.xlsm", sheets=("Calc",))
|
|
305
106
|
payload = brewdoc.read_book_artifact("book.xlsm", refs[0].key, sheets=("Calc",))
|
|
306
|
-
code, receipt, markdown = brewdoc.run(
|
|
307
|
-
"book.xlsm", out="book.md", sheets=("Calc",),
|
|
308
|
-
artifact_outputs={refs[0].key: "formulas.json"},
|
|
309
|
-
)
|
|
310
107
|
```
|
|
311
108
|
|
|
312
|
-
`
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
directly, so brewdoc does not convert them to Markdown.
|
|
316
|
-
|
|
317
|
-
Planned formats, excluded ones, deferred ones and the never-list: `FORMATS.md`.
|
|
318
|
-
A planned format is refused by name today. The adapter contract and the ordered checklist for
|
|
319
|
-
adding one are in [`docs/architecture.md`](docs/architecture.md).
|
|
109
|
+
`run` accepts `sheets` and an `artifact_outputs` key-to-path mapping. Renderers include
|
|
110
|
+
`render_pdf`, `render_doc`, `render_presentation`, `render_epub`, `render_html` and `render_book`.
|
|
111
|
+
`read_formulas` provides typed formulas; `self_check` verifies installed routes. Local APIs never acquire URLs.
|
|
320
112
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
| region looks like | rendered as |
|
|
324
|
-
|---|---|
|
|
325
|
-
| ruled on all sides | Markdown table from the drawn ruling |
|
|
326
|
-
| ruling unfinished (cells never closed) | source baselines recovered as logical rows on the inferred structural grid |
|
|
327
|
-
| ruled across only (head and foot rules) | column grid from the rule segment ends |
|
|
328
|
-
| unruled, tabular band | layout-preserved text |
|
|
329
|
-
| unruled, captioned `Table N` | the band is bounded first (caption to next blank band), then read as a table |
|
|
330
|
-
| two-column prose | split at the gutter (relative density on the character x-histogram), left then right |
|
|
331
|
-
| plain prose | lines |
|
|
113
|
+
## Explicit URL acquisition
|
|
332
114
|
|
|
333
|
-
|
|
115
|
+
`--url` deliberately acquires a public HTTP(S) page before local conversion.
|
|
334
116
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
| PPTX pictures | represented by deterministic name, size, alt text, caption, source and byte-count placeholders; pixels are never emitted |
|
|
340
|
-
| EPUB layout, scripts, media and graphics | CSS, pagination, font rendering, scripts, active media, image pixels and unsupported SVG/MathML semantics are omitted |
|
|
341
|
-
| PPTX charts, SmartArt, audio, video and embedded objects | not carried; listed in `not_carried` |
|
|
342
|
-
| a table spanning a page break | columns recovered, wrapped rows stay separate rows |
|
|
343
|
-
| text rotated out of horizontal reading order | not carried |
|
|
344
|
-
| sub/superscripts | folded back into their line (`NH4H2PO4`, not `NHHPO` over `4 2 4`) |
|
|
345
|
-
| broken font CMaps (ligatures mapped to wrong code points) | counted (`broken_ligature_words`), folded to ASCII, never guessed back |
|
|
346
|
-
| formula calculation | cached values in Markdown; passive source formulas only for `.xlsx` and `.xlsm` |
|
|
347
|
-
| readable VBA source | unavailable; `.xlsm` and `.xlsb` preserve a related project only as opaque bytes |
|
|
348
|
-
|
|
349
|
-
## Determinism
|
|
350
|
-
|
|
351
|
-
No timestamps or unordered iteration. Two renders of one file have the same sha256;
|
|
352
|
-
`--self-check` pins it. PDF, DOCX, PPTX and workbook output remains ASCII. HTML and EPUB Markdown use
|
|
353
|
-
UTF-8 without BOM and LF newlines, with the same bytes in the API, file output and CLI stdout.
|
|
354
|
-
Receipt JSON keeps ASCII escaping.
|
|
355
|
-
|
|
356
|
-
## Size and speed
|
|
357
|
-
|
|
358
|
-
These measurements cover the existing PDF/workbook baseline before the HTML parser addition.
|
|
359
|
-
They do not measure HTML or EPUB conversion or the new installed footprint.
|
|
360
|
-
|
|
361
|
-
| measure | value |
|
|
362
|
-
|---|---|
|
|
363
|
-
| installed footprint | ~45 MB (pdfplumber, pypdfium2, Pillow, cryptography, python-calamine) |
|
|
364
|
-
| import | 0.08 s |
|
|
365
|
-
| 130-page PDF | ~5.5 s |
|
|
366
|
-
| 14-sheet xlsx | ~0.9 s |
|
|
367
|
-
|
|
368
|
-
## Benchmarks
|
|
369
|
-
|
|
370
|
-
Browse the [corpus catalog](benchmarks/CATALOG.md), follow the
|
|
371
|
-
[measurement method](benchmarks/METHODOLOGY.md), and inspect the
|
|
372
|
-
[full-run results](benchmarks/results/README.md). Completed runs include actual
|
|
373
|
-
outputs and known failures; capture completion does not mean content quality passed.
|
|
374
|
-
|
|
375
|
-
## Releasing
|
|
376
|
-
|
|
377
|
-
Tag-triggered, see `RELEASING.md`.
|
|
378
|
-
Coding agents can start with the compact [llms.txt](llms.txt) guide. It does not imply
|
|
379
|
-
automatic discovery by any client.
|
|
117
|
+
```sh
|
|
118
|
+
brewdoc --url https://example.com/article --out article.md
|
|
119
|
+
brewdoc --url https://example.com/article --render-js --timeout 30 --out article.md
|
|
120
|
+
```
|
|
380
121
|
|
|
381
|
-
|
|
122
|
+
`--timeout` is one positive finite waiting budget, default 30 seconds; cleanup/conversion can add time.
|
|
123
|
+
Public destinations, DNS, redirects, TLS, requests and bytes are validated. Ordinary requests use GET;
|
|
124
|
+
JS admits only the narrow credential-free HN Algolia XHR POST exception. Local HTML never fetches or runs scripts.
|
|
125
|
+
Optional JS needs installed/bundled prerequisites, refuses unsupported runtimes before HTTP and downloads no engine.
|
|
126
|
+
Timing-only expiry can preserve valid partial content; hard failures refuse output. [Full URL/JS limits](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/FORMATS.md#url-acquisition).
|
|
382
127
|
|
|
383
|
-
|
|
128
|
+
[Format contracts](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/FORMATS.md) | [Corpus](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/benchmarks/CATALOG.md) | [Measurements](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/benchmarks/METHODOLOGY.md) | [Results](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/benchmarks/results/README.md)
|
|
129
|
+
[Releasing](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/RELEASING.md) | [Agent entry point](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/llms.txt) | [MIT license](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/LICENSE)
|
|
Binary file
|