mirror of
https://github.com/mfontanini/presenterm.git
synced 2025-05-05 23:42:59 +00:00
fix: make css into another file
This commit is contained in:
parent
262b2af3e7
commit
8f40a8295b
@ -240,26 +240,37 @@ let originalHeight = {height};
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let html = format!(
|
let style = match self.output_format {
|
||||||
r#"
|
OutputFormat::Pdf => String::new(),
|
||||||
<html>
|
OutputFormat::Html => format!(
|
||||||
|
"
|
||||||
<head>
|
<head>
|
||||||
<style>
|
<style>
|
||||||
{css}
|
{css}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
"
|
||||||
|
),
|
||||||
|
};
|
||||||
|
let html = format!(
|
||||||
|
r"
|
||||||
|
<html>
|
||||||
|
{style}
|
||||||
<body>
|
<body>
|
||||||
{html_body}
|
{html_body}
|
||||||
{html_script}
|
{html_script}
|
||||||
</body>
|
</body>
|
||||||
</html>"#
|
</html>"
|
||||||
);
|
);
|
||||||
|
|
||||||
let html_path = self.content_manager.persist_file("index.html", html.as_bytes())?;
|
let html_path = self.content_manager.persist_file("index.html", html.as_bytes())?;
|
||||||
|
let css_path = self.content_manager.persist_file("styles.css", css.as_bytes())?;
|
||||||
|
|
||||||
match self.output_format {
|
match self.output_format {
|
||||||
OutputFormat::Pdf => {
|
OutputFormat::Pdf => {
|
||||||
ThirdPartyTools::weasyprint(&[
|
ThirdPartyTools::weasyprint(&[
|
||||||
|
"-s",
|
||||||
|
css_path.to_string_lossy().as_ref(),
|
||||||
"--presentational-hints",
|
"--presentational-hints",
|
||||||
"-e",
|
"-e",
|
||||||
"utf8",
|
"utf8",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user