Add helper to put content into <html></html> tags

This commit is contained in:
Matthias Beyer 2016-01-05 15:19:19 +01:00
parent 06996ee903
commit 64a2c30a75

View file

@ -79,6 +79,19 @@ pub mod markdown {
.unwrap_or("UTF8Error"))
}
pub fn to_html_page(self) -> String {
let header = "
<html>
<head>
<meta http-equiv='content-type' content='text/html; charset=utf-8'>
</head>
<body>
";
let content = self.to_html();
let footer = "</body></html>";
format!("{}{}{}", header, content, footer)
}
}
}