[][src]Struct css_inline::CSSInliner

pub struct CSSInliner<'a> { /* fields omitted */ }

Customizable CSS inliner.

Implementations

impl<'a> CSSInliner<'a>[src]

pub fn new(options: InlineOptions<'a>) -> Self[src]

Create a new CSSInliner instance with given options.

pub fn options() -> InlineOptions<'a>[src]

Return a default InlineOptions that can fully configure the CSS inliner.

Examples

Get default InlineOptions, then change base url

use url::Url;
use css_inline::CSSInliner;
let url = Url::parse("https://api.example.com")?;
let inliner = CSSInliner::options()
    .base_url(Some(url))
    .build();

pub fn compact() -> Self[src]

Inliner, that will produce "compact" HTML. For example, "style" tags will be removed.

pub fn inline(&self, html: &str) -> Result<String, InlineError>[src]

Inline CSS styles from