Module: Inky
- Defined in:
- lib/inky.rb
Overview
Inky — Transform email templates into email-safe HTML.
Powered by Rust via Fiddle FFI.
Defined Under Namespace
Modules: Native
Constant Summary collapse
- VERSION =
"2.0.0"
Class Method Summary collapse
-
.migrate(html) ⇒ String
Migrate v1 Inky syntax to v2.
-
.migrate_with_details(html) ⇒ Hash
Migrate v1 syntax and return detailed results.
-
.transform(html, columns: 12) ⇒ String
Transform Inky HTML into email-safe table markup.
-
.transform_inline(html) ⇒ String
Transform Inky HTML and inline CSS from <style> blocks.
-
.validate(html) ⇒ Array<Hash>
Validate an Inky template and return diagnostics.
-
.version ⇒ String
Get the Inky engine version.
Class Method Details
.migrate(html) ⇒ String
Migrate v1 Inky syntax to v2.
83 84 85 |
# File 'lib/inky.rb', line 83 def self.migrate(html) Native.inky_migrate(html).to_s end |
.migrate_with_details(html) ⇒ Hash
Migrate v1 syntax and return detailed results.
91 92 93 94 |
# File 'lib/inky.rb', line 91 def self.migrate_with_details(html) json = Native.inky_migrate_with_details(html).to_s JSON.parse(json, symbolize_names: true) end |
.transform(html, columns: 12) ⇒ String
Transform Inky HTML into email-safe table markup.
63 64 65 66 67 68 69 |
# File 'lib/inky.rb', line 63 def self.transform(html, columns: 12) if columns != 12 Native.inky_transform_with_columns(html, columns).to_s else Native.inky_transform(html).to_s end end |
.transform_inline(html) ⇒ String
Transform Inky HTML and inline CSS from <style> blocks.
75 76 77 |
# File 'lib/inky.rb', line 75 def self.transform_inline(html) Native.inky_transform_inline(html).to_s end |
.validate(html) ⇒ Array<Hash>
Validate an Inky template and return diagnostics.
100 101 102 103 |
# File 'lib/inky.rb', line 100 def self.validate(html) json = Native.inky_validate(html).to_s JSON.parse(json, symbolize_names: true) end |
.version ⇒ String
Get the Inky engine version.
108 109 110 |
# File 'lib/inky.rb', line 108 def self.version Native.inky_version().to_s end |