html-to-markdown 2.5.4-x86_64-darwin-22 → 2.5.6-x86_64-darwin-22
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/README.md +8 -1
- data/lib/bin/html-to-markdown +0 -0
- data/lib/html_to_markdown/version.rb +1 -1
- data/lib/html_to_markdown_rb.bundle +0 -0
- metadata +80 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ab94465a7dde25c34da90facb580a8eb14bd9cc33d7a8cc17e1eea454da21f3
|
|
4
|
+
data.tar.gz: 8562d138796a15625758b6e089e2e3f659d2b6b3e8ca31f4880941c80d54e8fd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 269daa3ef3784f72d55aff0c16d6470f9ec8c2184d3168849028897cc19e803d3763904b5b961475e0092a2d09725fc7537da1e97675273144bd011d57eddd37
|
|
7
|
+
data.tar.gz: 16c0c6b9c216957ca1df84fb528cba545aaba083e65ebe6d72dd9e453ab995ac2d95f84f1e2813ca579f8ac652d288a874bb84ba36d0869f6e916c62d33a5e6a
|
data/README.md
CHANGED
|
@@ -17,6 +17,13 @@ Blazing-fast HTML → Markdown conversion for Ruby, powered by the same Rust eng
|
|
|
17
17
|
- 🧰 **Bundled CLI proxy**: Call the Rust CLI straight from Ruby or shell scripts.
|
|
18
18
|
- 🛠️ **First-class Rails support**: Works with `Gem.win_platform?` builds, supports Trusted Publishing, and compiles on install if no native gem matches.
|
|
19
19
|
|
|
20
|
+
## Documentation & Support
|
|
21
|
+
|
|
22
|
+
- [GitHub repository](https://github.com/Goldziher/html-to-markdown)
|
|
23
|
+
- [Issue tracker](https://github.com/Goldziher/html-to-markdown/issues)
|
|
24
|
+
- [Changelog](https://github.com/Goldziher/html-to-markdown/blob/main/CHANGELOG.md)
|
|
25
|
+
- [Live demo (WASM)](https://goldziher.github.io/html-to-markdown/)
|
|
26
|
+
|
|
20
27
|
## Installation
|
|
21
28
|
|
|
22
29
|
```bash
|
|
@@ -156,7 +163,7 @@ You can also call the CLI binary directly for scripting:
|
|
|
156
163
|
|
|
157
164
|
```ruby
|
|
158
165
|
HtmlToMarkdown::CLIProxy.call(['--version'])
|
|
159
|
-
# => "html-to-markdown 2.5.
|
|
166
|
+
# => "html-to-markdown 2.5.6"
|
|
160
167
|
```
|
|
161
168
|
|
|
162
169
|
Rebuild the CLI locally if you see `CLI binary not built` during tests:
|
data/lib/bin/html-to-markdown
CHANGED
|
Binary file
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: html-to-markdown
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.5.
|
|
4
|
+
version: 2.5.6
|
|
5
5
|
platform: x86_64-darwin-22
|
|
6
6
|
authors:
|
|
7
7
|
- Na'aman Hirschfeld
|
|
@@ -10,15 +10,89 @@ bindir: exe
|
|
|
10
10
|
cert_chain: []
|
|
11
11
|
date: 2025-10-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
|
-
description:
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
description: "# html-to-markdown-rb\n\nBlazing-fast HTML → Markdown conversion for
|
|
14
|
+
Ruby, powered by the same Rust engine used by our Python, Node.js, and WebAssembly
|
|
15
|
+
packages. Ship identical Markdown across every runtime while enjoying native extension
|
|
16
|
+
performance.\n\n[](https://crates.io/crates/html-to-markdown-rs)\n[](https://www.npmjs.com/package/html-to-markdown-node)\n[](https://pypi.org/project/html-to-markdown/)\n[](https://rubygems.org/gems/html-to-markdown)\n[](https://github.com/Goldziher/html-to-markdown/blob/main/LICENSE)\n\n##
|
|
21
|
+
Features\n\n- ⚡ **Rust-fast**: Ruby bindings around a highly optimised Rust core
|
|
22
|
+
(60‑80× faster than BeautifulSoup-based converters).\n- \U0001F501 **Identical output**:
|
|
23
|
+
Shares logic with the Python wheels, npm bindings, WASM package, and CLI — consistent
|
|
24
|
+
Markdown everywhere.\n- ⚙️ **Rich configuration**: Control heading styles, list
|
|
25
|
+
indentation, whitespace handling, HTML preprocessing, and more.\n- \U0001F5BC️ **Inline
|
|
26
|
+
image extraction**: Pull out embedded images (PNG/JPEG/SVG/data URIs) alongside
|
|
27
|
+
Markdown.\n- \U0001F9F0 **Bundled CLI proxy**: Call the Rust CLI straight from Ruby
|
|
28
|
+
or shell scripts.\n- \U0001F6E0️ **First-class Rails support**: Works with `Gem.win_platform?`
|
|
29
|
+
builds, supports Trusted Publishing, and compiles on install if no native gem matches.\n\n##
|
|
30
|
+
Documentation & Support\n\n- [GitHub repository](https://github.com/Goldziher/html-to-markdown)\n-
|
|
31
|
+
[Issue tracker](https://github.com/Goldziher/html-to-markdown/issues)\n- [Changelog](https://github.com/Goldziher/html-to-markdown/blob/main/CHANGELOG.md)\n-
|
|
32
|
+
[Live demo (WASM)](https://goldziher.github.io/html-to-markdown/)\n\n## Installation\n\n```bash\nbundle
|
|
33
|
+
add html-to-markdown\n# or\ngem install html-to-markdown\n```\n\nAdd the gem to
|
|
34
|
+
your project and Bundler will compile the native Rust extension on first install.\n\n###
|
|
35
|
+
Requirements\n\n- Ruby **3.2+** (Magnus relies on the fiber scheduler APIs added
|
|
36
|
+
in 3.2)\n- Rust toolchain **1.85+** with Cargo available on your `$PATH`\n- Ruby
|
|
37
|
+
development headers (`ruby-dev`, `ruby-devel`, or the platform equivalent)\n\n**Windows**:
|
|
38
|
+
install [RubyInstaller with MSYS2](https://rubyinstaller.org/) (UCRT64). Run once:\n\n```powershell\nridk
|
|
39
|
+
exec pacman -S --needed --noconfirm base-devel mingw-w64-ucrt-x86_64-toolchain\n```\n\nThis
|
|
40
|
+
provides the standard headers (including `strings.h`) required for the bindgen step.\n\n##
|
|
41
|
+
Performance Snapshot\n\nApple M4 • Real Wikipedia documents • `HtmlToMarkdown.convert`
|
|
42
|
+
(Ruby)\n\n| Document | Size | Latency | Throughput | Docs/sec |\n| -------------------
|
|
43
|
+
| ----- | ------- | ---------- | -------- |\n| Lists (Timeline) | 129KB | 0.69ms
|
|
44
|
+
\ | 187 MB/s | 1,450 |\n| Tables (Countries) | 360KB | 2.19ms | 164 MB/s
|
|
45
|
+
\ | 456 |\n| Mixed (Python wiki) | 656KB | 4.88ms | 134 MB/s | 205 |\n\n>
|
|
46
|
+
Same core, same benchmarks: the Ruby extension stays within single-digit % of the
|
|
47
|
+
Rust CLI and mirrors the Python/Node numbers.\n\n## Quick Start\n\n```ruby\nrequire
|
|
48
|
+
'html_to_markdown'\n\nhtml = <<~HTML\n <h1>Welcome</h1>\n <p>This is <strong>Rust-fast</strong>
|
|
49
|
+
conversion!</p>\n <ul>\n <li>Native extension</li>\n <li>Identical output
|
|
50
|
+
across languages</li>\n </ul>\nHTML\n\nmarkdown = HtmlToMarkdown.convert(html)\nputs
|
|
51
|
+
markdown\n# # Welcome\n#\n# This is **Rust-fast** conversion!\n#\n# - Native extension\n#
|
|
52
|
+
- Identical output across languages\n```\n\n## API\n\n### Conversion Options\n\nPass
|
|
53
|
+
a Ruby hash (string or symbol keys) to tweak rendering. Every option maps one-for-one
|
|
54
|
+
with the Rust/Python/Node APIs.\n\n```ruby\nrequire 'html_to_markdown'\n\nmarkdown
|
|
55
|
+
= HtmlToMarkdown.convert(\n '<pre><code class=\"language-ruby\">puts \"hi\"</code></pre>',\n
|
|
56
|
+
\ heading_style: :atx,\n code_block_style: :fenced,\n bullets: '*+-',\n list_indent_type:
|
|
57
|
+
:spaces,\n list_indent_width: 2,\n whitespace_mode: :normalized,\n highlight_style:
|
|
58
|
+
:double_equal\n)\n\nputs markdown\n```\n\n### HTML Preprocessing\n\nClean up scraped
|
|
59
|
+
HTML (navigation, forms, malformed markup) before conversion:\n\n```ruby\nrequire
|
|
60
|
+
'html_to_markdown'\n\nmarkdown = HtmlToMarkdown.convert(\n html,\n preprocessing:
|
|
61
|
+
{\n enabled: true,\n preset: :aggressive, # :minimal, :standard, :aggressive\n
|
|
62
|
+
\ remove_navigation: true,\n remove_forms: true\n }\n)\n```\n\n### Inline
|
|
63
|
+
Images\n\nExtract inline binary data (data URIs, SVG) together with the converted
|
|
64
|
+
Markdown.\n\n```ruby\nrequire 'html_to_markdown'\n\nresult = HtmlToMarkdown.convert_with_inline_images(\n
|
|
65
|
+
\ '<img src=\"data:image/png;base64,iVBORw0...\" alt=\"Pixel\">',\n image_config:
|
|
66
|
+
{\n max_decoded_size_bytes: 1 * 1024 * 1024,\n infer_dimensions: true,\n filename_prefix:
|
|
67
|
+
'img_',\n capture_svg: true\n }\n)\n\nputs result.markdown\nresult.inline_images.each
|
|
68
|
+
do |img|\n puts \"#{img.filename} -> #{img.format} (#{img.data.bytesize} bytes)\"\nend\n```\n\n##
|
|
69
|
+
CLI\n\nThe gem bundles a small proxy for the Rust CLI binary. Use it when you need
|
|
70
|
+
parity with the standalone `html-to-markdown` executable.\n\n```ruby\nrequire 'html_to_markdown/cli'\n\nHtmlToMarkdown::CLI.run(%w[--heading-style
|
|
71
|
+
atx input.html], stdout: $stdout)\n# => writes converted Markdown to STDOUT\n```\n\nYou
|
|
72
|
+
can also call the CLI binary directly for scripting:\n\n```ruby\nHtmlToMarkdown::CLIProxy.call(['--version'])\n#
|
|
73
|
+
=> \"html-to-markdown 2.5.6\"\n```\n\nRebuild the CLI locally if you see `CLI binary
|
|
74
|
+
not built` during tests:\n\n```bash\nbundle exec rake compile # builds
|
|
75
|
+
the extension\nbundle exec ruby scripts/prepare_ruby_gem.rb # copies the CLI into
|
|
76
|
+
lib/bin/\n```\n\n## Error Handling\n\nConversion errors raise `HtmlToMarkdown::Error`
|
|
77
|
+
(wrapping the Rust error context). CLI invocations use specialised subclasses:\n\n-
|
|
78
|
+
`HtmlToMarkdown::CLIProxy::MissingBinaryError`\n- `HtmlToMarkdown::CLIProxy::CLIExecutionError`\n\nRescue
|
|
79
|
+
them to provide clearer feedback in your application.\n\n## Consistent Across Languages\n\nThe
|
|
80
|
+
Ruby gem shares the exact Rust core with:\n\n- [Python wheels](https://pypi.org/project/html-to-markdown/)\n-
|
|
81
|
+
[Node.js / Bun bindings](https://www.npmjs.com/package/html-to-markdown-node)\n-
|
|
82
|
+
[WebAssembly package](https://www.npmjs.com/package/html-to-markdown-wasm)\n- The
|
|
83
|
+
Rust crate and CLI\n\nUse whichever runtime fits your stack while keeping formatting
|
|
84
|
+
behaviour identical.\n\n## Development\n\n```bash\nbundle exec rake compile #
|
|
85
|
+
build the native extension\nbundle exec rspec # run test suite\n```\n\nThe
|
|
86
|
+
extension uses [Magnus](https://github.com/matsadler/magnus) plus `rb-sys` for bindgen.
|
|
87
|
+
When editing the Rust code under `src/`, rerun `rake compile`.\n\n## License\n\nMIT
|
|
88
|
+
© Na'aman Hirschfeld\n"
|
|
16
89
|
email:
|
|
17
90
|
- nhirschfeld@gmail.com
|
|
18
91
|
executables:
|
|
19
92
|
- html-to-markdown
|
|
20
93
|
extensions: []
|
|
21
|
-
extra_rdoc_files:
|
|
94
|
+
extra_rdoc_files:
|
|
95
|
+
- README.md
|
|
22
96
|
files:
|
|
23
97
|
- README.md
|
|
24
98
|
- exe/html-to-markdown
|
|
@@ -40,7 +114,7 @@ metadata:
|
|
|
40
114
|
source_code_uri: https://github.com/Goldziher/html-to-markdown
|
|
41
115
|
bug_tracker_uri: https://github.com/Goldziher/html-to-markdown/issues
|
|
42
116
|
changelog_uri: https://github.com/Goldziher/html-to-markdown/releases
|
|
43
|
-
documentation_uri: https://github.com/Goldziher/html-to-markdown/blob/main/README.md
|
|
117
|
+
documentation_uri: https://github.com/Goldziher/html-to-markdown/blob/main/crates/html-to-markdown-rb/README.md
|
|
44
118
|
post_install_message:
|
|
45
119
|
rdoc_options: []
|
|
46
120
|
require_paths:
|