ironpress 1.5.3 → 1.5.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfcd5dc3040d841312793e77a4119d49c14db383e9dcc7970182159c1989e206
4
- data.tar.gz: e25587f9d4d4569b59cdff1da629d342bee5fc3b5e2c16832a0c5bea2809289c
3
+ metadata.gz: '06696b437bb27adfde76adbd80dc188f172812023a436b5feca2ade84a84f0a5'
4
+ data.tar.gz: 939d4e115c740e813f039bbfe8d90cc845477d4ad411dcc44ed68a436b654f3d
5
5
  SHA512:
6
- metadata.gz: 1b608a05c7b569eb4282776226568d01a314f36f61d530a3db3c367622d83a11e16c1d3b915c653a9b9915bd13f99ec9fc6c0f51d88366e8b06a7bed07c6db2f
7
- data.tar.gz: c9b9d71b037da3b8df4086e076b968075e34a10f03d56dbbc0263a6d9cdd473e3012b73320e548ea99599678c762385bececfae69d2969440cfff21425e5f99e
6
+ metadata.gz: 5351e3994374da27eb84f5980a648ec59d70dae33f7f565820b5c0a73838704c1f8c424479c49242ff4920a9b7acb15cfdd3aa037ff8fc2163b530c3aa934a21
7
+ data.tar.gz: 781112a486eefcb602499c757865950921fb581e278d113ba9c3c95f0395708acad813682117f82508d7f5d931f21aa98d51782778ad37d401a57bd6b6b5584b
data/README.md CHANGED
@@ -1,58 +1,86 @@
1
- # Ironpress for Ruby
1
+ # ironpress for Ruby
2
2
 
3
- Generate PDF bytes from HTML or Markdown without launching a browser.
3
+ Generate PDF output from HTML or Markdown with a native Rust renderer. No
4
+ browser process or system PDF dependency is required.
4
5
 
5
- ## Installation
6
+ [Read the complete Ruby getting-started guide](https://gastongouron.github.io/ironpress/get-started/ruby/).
6
7
 
7
- ```ruby
8
- gem "ironpress"
8
+ ## Requirements
9
+
10
+ - Ruby 3.0 or later
11
+ - Linux, macOS, or Windows
12
+
13
+ Releases include supported native gems plus a source gem.
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ bundle add ironpress
9
19
  ```
10
20
 
11
- Ironpress supports Ruby 3.0 and later. Releases include a source gem and native
12
- gems for Linux, macOS, and Windows.
21
+ Or install the gem globally:
13
22
 
14
- ## Usage
23
+ ```bash
24
+ gem install ironpress
25
+ ```
26
+
27
+ ## Create your first PDF
15
28
 
16
29
  ```ruby
17
30
  require "ironpress"
18
31
 
19
- pdf = Ironpress.html_to_pdf("<h1>Hello</h1>")
32
+ pdf = Ironpress.html_to_pdf("<h1>Hello from Ruby</h1>")
20
33
  File.binwrite("output.pdf", pdf)
21
34
  ```
22
35
 
23
- Configuration methods return the converter, so policies can be composed in an
24
- idiomatic chain:
36
+ The result is a binary Ruby `String`. Write it with `File.binwrite`, return it
37
+ from a web response, or store it in your application.
38
+
39
+ ## Render Markdown
40
+
41
+ ```ruby
42
+ pdf = Ironpress.markdown_to_pdf("# Release notes\n\nEverything shipped.")
43
+ ```
44
+
45
+ ## Configure and reuse a converter
25
46
 
26
47
  ```ruby
27
48
  converter = Ironpress::HtmlConverter.new
28
49
  .page_size("Letter")
29
- .margin_sides(36, 54, 36, 54)
50
+ .margin_sides(36, 48, 36, 48)
30
51
  .header("Quarterly report")
31
52
  .footer("Page {page} of {pages}")
32
- .sanitize(true)
33
53
 
34
54
  pdf = converter.convert("<h1>Results</h1>")
55
+ markdown_pdf = converter.convert_markdown("# Results")
35
56
  ```
36
57
 
37
- The converter supports page geometry, PDF and image quality, sanitization,
38
- headers and footers, custom TTF fonts, and optional CJK or emoji packs. Native
39
- Ruby also supports constrained local resources through `base_path` and
40
- `resource_root`, plus direct file output.
58
+ Configuration methods return the converter, so policies compose in an idiomatic
59
+ chain. Use `convert_to_file` or `convert_markdown_to_file` for direct output.
41
60
 
42
- See the [binding capability matrix](../README.md) for the contract shared with
43
- Rust, Python, and WebAssembly.
61
+ ## Local resources and fonts
44
62
 
45
- ## Font packs
46
-
47
- Ironpress never downloads fallback fonts while rendering. Download the artifact
48
- your application needs, verify it as part of deployment, then install its bytes:
63
+ Local URLs are denied until a canonical boundary is configured:
49
64
 
50
65
  ```ruby
51
- converter = Ironpress::HtmlConverter.new.add_font_pack(
52
- "cjk-jp",
53
- File.binread("ironpress-font-cjk-jp.ttf")
54
- )
55
- pdf = converter.convert("<p lang='ja'>日本語</p>")
66
+ converter = Ironpress::HtmlConverter.new
67
+ .base_path("templates")
68
+ .resource_root(".")
69
+ .add_font("Inter", File.binread("assets/Inter.ttf"))
56
70
  ```
57
71
 
58
- Valid pack names are `cjk-jp`, `cjk-kr`, `cjk-sc`, `cjk-tc`, and `emoji`.
72
+ Optional fallback packs enter through `add_font_pack`. Valid names are
73
+ `cjk-jp`, `cjk-kr`, `cjk-sc`, `cjk-tc`, and `emoji`. Rendering never downloads
74
+ a font pack.
75
+
76
+ ## Limits and errors
77
+
78
+ - Invalid named settings raise `ArgumentError`.
79
+ - Conversion failures raise `RuntimeError`.
80
+ - HTML sanitization is enabled by default.
81
+ - The binding has no async or streaming conversion API.
82
+ - Remote HTTP document resources are not available.
83
+ - JavaScript and browser DOM execution are not supported.
84
+
85
+ See the [binding capability matrix](../README.md) for the contract shared with
86
+ Rust, Python, browser WebAssembly, and Node.js.
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "ironpress-ruby"
3
- version = "1.5.3"
3
+ version = "1.5.4"
4
4
  edition = "2024"
5
5
  publish = false
6
6
  description = "Ruby bindings for the Ironpress HTML-to-PDF engine"
@@ -12,6 +12,6 @@ name = "ironpress_ruby"
12
12
  crate-type = ["cdylib"]
13
13
 
14
14
  [dependencies]
15
- ironpress-core = { version = "=1.5.3", package = "ironpress" }
15
+ ironpress-core = { version = "=1.5.4", package = "ironpress" }
16
16
  magnus = "0.7"
17
17
  rb-sys = { version = "0.9", default-features = false, features = ["stable-api-compiled-fallback"] }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ironpress
4
- VERSION = "1.5.3"
4
+ VERSION = "1.5.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ironpress
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.3
4
+ version: 1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Gaston Gouron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-20 00:00:00.000000000 Z
11
+ date: 2026-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb_sys
@@ -42,7 +42,9 @@ files:
42
42
  homepage: https://github.com/gastongouron/ironpress
43
43
  licenses:
44
44
  - MIT
45
- metadata: {}
45
+ metadata:
46
+ documentation_uri: https://gastongouron.github.io/ironpress/get-started/ruby/
47
+ source_code_uri: https://github.com/gastongouron/ironpress
46
48
  post_install_message:
47
49
  rdoc_options: []
48
50
  require_paths: