diff options
Diffstat (limited to 'code/src/html.rs')
-rw-r--r-- | code/src/html.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/code/src/html.rs b/code/src/html.rs index d310ad3..23ac6c8 100644 --- a/code/src/html.rs +++ b/code/src/html.rs @@ -1,7 +1,10 @@ use crate::{ - article_metadata, file_history, get_articles, markdown::{render::blocks_to_html, self}, ArticleMeta, + article_metadata, file_history, get_articles, + markdown::{self, render::blocks_to_html}, + ArticleMeta, }; use laby::{frag, html, iter, li, ul, Render}; +use pest::Parser; use std::fs::read_to_string; pub fn scaffold(title: String, body: impl Render) -> impl Render { @@ -25,6 +28,14 @@ pub fn scaffold(title: String, body: impl Render) -> impl Render { } pub fn article(path: String) -> impl Render { + // match parsers::markdown::Grammar::parse( + // parsers::markdown::Rule::file, + // &read_to_string(&path).unwrap(), + // ) { + // Ok(ast) => eprintln!("{ast:#?}"), + // Err(e) => panic!("{e}"), + // } + scaffold( article_metadata(path.clone().into()).title, frag!( |