Add helper to put content into <html></html> tags
This commit is contained in:
parent
06996ee903
commit
64a2c30a75
1 changed files with 13 additions and 0 deletions
|
@ -79,6 +79,19 @@ pub mod markdown {
|
||||||
.unwrap_or("UTF8Error"))
|
.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)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue