summaryrefslogtreecommitdiff
path: root/htmlua-parser/src/serve.rs
diff options
context:
space:
mode:
authorGrace Yoder <70408179+gyoder@users.noreply.github.com>2025-07-07 12:46:48 -0600
committerGitHub <noreply@github.com>2025-07-07 12:46:48 -0600
commit23885aba3f680e0ff764c4e94306125636532234 (patch)
treee8eedd8f47c8ed2a20a34b3017f9d992eefef403 /htmlua-parser/src/serve.rs
parent6c3f257942d2b1d88aa471f52d5b0241492730ae (diff)
parent262a2e23d89d35f78d8972f5b560c7e5ee7225ee (diff)
Merge pull request #8 from trypsynth/syntect
Add basic syntax highlighting with the syntect crate. Closes #5
Diffstat (limited to 'htmlua-parser/src/serve.rs')
-rw-r--r--htmlua-parser/src/serve.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/htmlua-parser/src/serve.rs b/htmlua-parser/src/serve.rs
index 981cdf6..06de0ea 100644
--- a/htmlua-parser/src/serve.rs
+++ b/htmlua-parser/src/serve.rs
@@ -1,6 +1,6 @@
use crate::helpers::read_doc_from_file;
-use super::render::{execute_lua, expand_template, process_markdown};
+use super::render::{execute_lua, expand_template, process_markdown, process_syntax_highlighting};
use anyhow::Result;
use std::path::{Path, PathBuf}
;
@@ -16,6 +16,7 @@ pub fn serve_content(request_uri: &str) -> Result<String> {
let full_doc = expand_template(doc, &components, None)?;
let markdown_doc = process_markdown(full_doc)?;
- let executed_doc = execute_lua(markdown_doc)?;
+ let highlighted_doc = process_syntax_highlighting(markdown_doc)?;
+ let executed_doc = execute_lua(highlighted_doc)?;
Ok(executed_doc.to_string())
}