Add a "DOCTYPE" constant

This commit is contained in:
Chris Wong 2016-11-22 21:58:06 +13:00
parent 585ed3851b
commit b76bda0e50

View file

@ -189,6 +189,30 @@ impl<'a> fmt::Write for Escaper<'a> {
}
}
/// The literal string `<!DOCTYPE html>`.
///
/// # Example
///
/// A minimal web page:
///
/// ```rust,ignore
/// use maud::DOCTYPE;
///
/// let markup = html! {
/// (DOCTYPE)
/// html {
/// head {
/// meta charset="utf-8" /
/// title "Test page"
/// }
/// body {
/// p "Hello, world!"
/// }
/// }
/// };
/// ```
pub const DOCTYPE: PreEscaped<&'static str> = PreEscaped("<!DOCTYPE html>");
#[cfg(feature = "iron")]
mod iron_support {
use std::io;