You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+29
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,7 @@ into:
38
38
- Inlines CSS from `style` and `link` tags
39
39
- Removes `style` and `link` tags
40
40
- Resolves external stylesheets (including local files)
41
+
- Optionally caches external stylesheets
41
42
- Works on Linux, Windows, and macOS
42
43
- Supports HTML5 & CSS3
43
44
- Bindings for [Python](https://github.com/Stranger6667/css-inline/tree/master/bindings/python), [Ruby](https://github.com/Stranger6667/css-inline/tree/master/bindings/ruby), [JavaScript](https://github.com/Stranger6667/css-inline/tree/master/bindings/javascript), [C](https://github.com/Stranger6667/css-inline/tree/master/bindings/c), and a [WebAssembly](https://github.com/Stranger6667/css-inline/tree/master/bindings/javascript/wasm) module to run in browsers.
-`keep_link_tags`. Specifies whether to keep "link" tags after inlining. Default: `false`
100
101
-`base_url`. The base URL used to resolve relative URLs. If you'd like to load stylesheets from your filesystem, use the `file://` scheme. Default: `None`
101
102
-`load_remote_stylesheets`. Specifies whether remote stylesheets should be loaded. Default: `true`
103
+
-`cache`. Specifies cache for external stylesheets. Default: `None`
102
104
-`extra_css`. Extra CSS to be inlined. Default: `None`
103
105
-`preallocate_node_capacity`. **Advanced**. Preallocates capacity for HTML nodes during parsing. This can improve performance when you have an estimate of the number of nodes in your HTML document. Default: `32`
Copy file name to clipboardexpand all lines: bindings/c/README.md
+17
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,7 @@ into:
36
36
- Inlines CSS from `style` and `link` tags
37
37
- Removes `style` and `link` tags
38
38
- Resolves external stylesheets (including local files)
39
+
- Optionally caches external stylesheets
39
40
- Works on Linux, Windows, and macOS
40
41
- Supports HTML5 & CSS3
41
42
@@ -112,6 +113,7 @@ Possible configurations:
112
113
-`keep_link_tags`. Specifies whether to keep "link" tags after inlining. Default: `false`
113
114
-`base_url`. The base URL used to resolve relative URLs. If you'd like to load stylesheets from your filesystem, use the `file://` scheme. Default: `NULL`
114
115
-`load_remote_stylesheets`. Specifies whether remote stylesheets should be loaded. Default: `true`
116
+
-`cache`. Specifies caching options for external stylesheets. Default: `NULL`
115
117
-`extra_css`. Extra CSS to be inlined. Default: `NULL`
116
118
-`preallocate_node_capacity`. **Advanced**. Preallocates capacity for HTML nodes during parsing. This can improve performance when you have an estimate of the number of nodes in your HTML document. Default: `32`
117
119
@@ -156,6 +158,21 @@ This is useful if you want to keep `@media` queries for responsive emails in sep
156
158
157
159
Such tags will be kept in the resulting HTML even if the `keep_style_tags` option is set to `false`.
158
160
161
+
You can also cache external stylesheets to avoid excessive network requests:
Copy file name to clipboardexpand all lines: bindings/javascript/README.md
+26-1
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ into:
37
37
- Inlines CSS from `style` and `link` tags
38
38
- Removes `style` and `link` tags
39
39
- Resolves external stylesheets (including local files)
40
+
- Optionally caches external stylesheets
40
41
- Works on Linux, Windows, and macOS
41
42
- Supports HTML5 & CSS3
42
43
- Tested on Node.js 18 & 20.
@@ -82,6 +83,7 @@ var inlined = inline(
82
83
-`keepLinkTags`. Specifies whether to keep "link" tags after inlining. Default: `false`
83
84
-`baseUrl`. The base URL used to resolve relative URLs. If you'd like to load stylesheets from your filesystem, use the `file://` scheme. Default: `null`
84
85
-`loadRemoteStylesheets`. Specifies whether remote stylesheets should be loaded. Default: `true`
86
+
-`cache`. Specifies caching options for external stylesheets (for example, `{size: 5}`). Default: `null`
85
87
-`extraCss`. Extra CSS to be inlined. Default: `null`
86
88
-`preallocateNodeCapacity`. **Advanced**. Preallocates capacity for HTML nodes during parsing. This can improve performance when you have an estimate of the number of nodes in your HTML document. Default: `32`
87
89
@@ -125,6 +127,29 @@ This is useful if you want to keep `@media` queries for responsive emails in sep
125
127
126
128
Such tags will be kept in the resulting HTML even if the `keep_style_tags` option is set to `false`.
127
129
130
+
You can also cache external stylesheets to avoid excessive network requests:
0 commit comments