Skip to content

Commit f8845d9

Browse files
committed
docs: Fix syntax in examples
1 parent 9c90567 commit f8845d9

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn main() -> Result<(), css_inline::InlineError> {
8080
load_remote_stylesheets: false,
8181
..Default::default()
8282
};
83-
let inliner = css_inline::CSSInliner(options);
83+
let inliner = css_inline::CSSInliner::new(options);
8484
let inlined = inliner.inline(HTML);
8585
// Do something with inlined HTML, e.g. send an email
8686
Ok(())

src/lib.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,22 @@
6262
//! `css-inline` can be configured by using `InlineOptions` and `CSSInliner`:
6363
//!
6464
//! ```rust
65-
//! use css_inline;
65+
//! const HTML: &str = r#"<html>
66+
//! <head>
67+
//! <title>Test</title>
68+
//! <style>h1 { color:blue; }</style>
69+
//! </head>
70+
//! <body>
71+
//! <h1>Big Text</h1>
72+
//! </body>
73+
//! </html>"#;
6674
//!
6775
//! fn main() -> Result<(), css_inline::InlineError> {
6876
//! let options = css_inline::InlineOptions {
6977
//! load_remote_stylesheets: false,
7078
//! ..Default::default()
7179
//! };
72-
//! let inliner = css_inline::CSSInliner(options);
80+
//! let inliner = css_inline::CSSInliner::new(options);
7381
//! let inlined = inliner.inline(HTML);
7482
//! // Do something with inlined HTML, e.g. send an email
7583
//! Ok(())

0 commit comments

Comments
 (0)