refactor
This commit is contained in:
parent
474d30c24d
commit
a0df7388d8
2
rustfmt.toml
Normal file
2
rustfmt.toml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
tab_spaces = 4
|
||||||
|
hard_tabs = true
|
130
src/html/mod.rs
130
src/html/mod.rs
|
@ -1,18 +1,17 @@
|
||||||
|
mod head;
|
||||||
mod home;
|
mod home;
|
||||||
mod isodate;
|
mod isodate;
|
||||||
mod list;
|
mod list;
|
||||||
mod misc;
|
mod misc;
|
||||||
mod post;
|
pub mod post;
|
||||||
mod slideshow;
|
pub mod slideshow;
|
||||||
mod special;
|
pub mod wiki;
|
||||||
mod wiki;
|
|
||||||
mod head;
|
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use camino::{Utf8Path, Utf8PathBuf};
|
use camino::{Utf8Path, Utf8PathBuf};
|
||||||
use chrono::{DateTime, Datelike, Utc};
|
use chrono::{DateTime, Datelike, Utc};
|
||||||
use hauchiwa::{Bibliography, Content, Link, LinkDate, Linkable, Outline, Sack};
|
use hauchiwa::{Bibliography, Link, LinkDate, Linkable, Outline, Sack};
|
||||||
use hayagriva::Library;
|
use hayagriva::Library;
|
||||||
use hypertext::{html_elements, maud, maud_move, GlobalAttributes, Raw, Renderable};
|
use hypertext::{html_elements, maud, maud_move, GlobalAttributes, Raw, Renderable};
|
||||||
|
|
||||||
|
@ -119,7 +118,7 @@ where
|
||||||
's: 'html,
|
's: 'html,
|
||||||
'p: 'html,
|
'p: 'html,
|
||||||
{
|
{
|
||||||
let head = head::render_head(sack, title, &[], js)?;
|
let head = head::render_head(sack, title, &[], js)?;
|
||||||
|
|
||||||
Ok(maud_move!(
|
Ok(maud_move!(
|
||||||
(Raw("<!DOCTYPE html>"))
|
(Raw("<!DOCTYPE html>"))
|
||||||
|
@ -133,7 +132,6 @@ where
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fn full<'s, 'p, 'html>(
|
fn full<'s, 'p, 'html>(
|
||||||
sack: &'s Sack,
|
sack: &'s Sack,
|
||||||
main: impl Renderable + 'p,
|
main: impl Renderable + 'p,
|
||||||
|
@ -143,10 +141,7 @@ where
|
||||||
's: 'html,
|
's: 'html,
|
||||||
'p: 'html,
|
'p: 'html,
|
||||||
{
|
{
|
||||||
let main = maud_move!(
|
let main = maud_move!((navbar())(main));
|
||||||
(navbar())
|
|
||||||
(main)
|
|
||||||
);
|
|
||||||
|
|
||||||
bare(sack, main, title, None)
|
bare(sack, main, title, None)
|
||||||
}
|
}
|
||||||
|
@ -161,11 +156,7 @@ where
|
||||||
's: 'html,
|
's: 'html,
|
||||||
'p: 'html,
|
'p: 'html,
|
||||||
{
|
{
|
||||||
let main = maud_move!(
|
let main = maud_move!((navbar())(main)(footer(sack)));
|
||||||
(navbar())
|
|
||||||
(main)
|
|
||||||
(footer(sack))
|
|
||||||
);
|
|
||||||
|
|
||||||
bare(sack, main, title, js)
|
bare(sack, main, title, js)
|
||||||
}
|
}
|
||||||
|
@ -214,14 +205,13 @@ pub(crate) fn search<'s, 'html>(sack: &'s Sack) -> String {
|
||||||
main #app {}
|
main #app {}
|
||||||
),
|
),
|
||||||
String::from("Search"),
|
String::from("Search"),
|
||||||
Some(&["search".into()])
|
Some(&["search".into()]),
|
||||||
)
|
)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.render()
|
.render()
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Represents a simple post.
|
/// Represents a simple post.
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
pub(crate) struct Flox {
|
pub(crate) struct Flox {
|
||||||
|
@ -231,36 +221,34 @@ pub(crate) struct Flox {
|
||||||
pub(crate) desc: Option<String>,
|
pub(crate) desc: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Content for Flox {
|
pub fn parse_content(
|
||||||
fn parse_content(
|
content: &str,
|
||||||
content: &str,
|
sack: &Sack,
|
||||||
sack: &Sack,
|
path: &Utf8Path,
|
||||||
path: &Utf8Path,
|
library: Option<&Library>,
|
||||||
library: Option<&Library>,
|
) -> (String, Outline, Bibliography) {
|
||||||
) -> (String, Outline, Bibliography) {
|
crate::text::md::parse(content, sack, path, library)
|
||||||
crate::text::md::parse(content, sack, path, library)
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn as_html(
|
pub fn as_html(
|
||||||
&self,
|
meta: &Flox,
|
||||||
parsed: &str,
|
parsed: &str,
|
||||||
sack: &Sack,
|
sack: &Sack,
|
||||||
outline: Outline,
|
outline: Outline,
|
||||||
bibliography: Bibliography,
|
bibliography: Bibliography,
|
||||||
) -> String {
|
) -> String {
|
||||||
flox(&self.title, parsed, sack, outline, bibliography)
|
flox(&meta.title, parsed, sack, outline, bibliography)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_link(&self, path: Utf8PathBuf) -> Option<Linkable> {
|
pub fn as_link(meta: &Flox, path: Utf8PathBuf) -> Option<Linkable> {
|
||||||
Some(Linkable::Date(LinkDate {
|
Some(Linkable::Date(LinkDate {
|
||||||
link: Link {
|
link: Link {
|
||||||
path,
|
path,
|
||||||
name: self.title.to_owned(),
|
name: meta.title.to_owned(),
|
||||||
desc: self.desc.to_owned(),
|
desc: meta.desc.to_owned(),
|
||||||
},
|
},
|
||||||
date: self.date.to_owned(),
|
date: meta.date.to_owned(),
|
||||||
}))
|
}))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn flox<'p, 's, 'html>(
|
pub(crate) fn flox<'p, 's, 'html>(
|
||||||
|
@ -274,28 +262,28 @@ pub(crate) fn flox<'p, 's, 'html>(
|
||||||
sack,
|
sack,
|
||||||
maud_move!(
|
maud_move!(
|
||||||
main {
|
main {
|
||||||
div .flox-playground {
|
div .flox-playground {
|
||||||
div .cell {
|
div .cell {
|
||||||
header {
|
header {
|
||||||
h2 { "Flox" }
|
h2 { "Flox" }
|
||||||
}
|
}
|
||||||
div .editor {
|
div .editor {
|
||||||
div #editor {}
|
div #editor {}
|
||||||
button #run .run { "Run!" }
|
button #run .run { "Run!" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
div .cell {
|
div .cell {
|
||||||
h2 { "Output" }
|
h2 { "Output" }
|
||||||
pre #output {}
|
pre #output {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(article(title, parsed, sack, outline, bibliography))
|
(article(title, parsed, sack, outline, bibliography))
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
String::from("Flox"),
|
String::from("Flox"),
|
||||||
Some(&["editor".into()])
|
Some(&["editor".into()]),
|
||||||
)
|
)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.render()
|
.render()
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,53 +1,51 @@
|
||||||
use camino::{Utf8Path, Utf8PathBuf};
|
use camino::{Utf8Path, Utf8PathBuf};
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use hauchiwa::{Bibliography, Content, Link, LinkDate, Linkable, Outline, Sack};
|
use hauchiwa::{Bibliography, Link, LinkDate, Linkable, Outline, Sack};
|
||||||
use hayagriva::Library;
|
use hayagriva::Library;
|
||||||
use hypertext::{html_elements, maud_move, GlobalAttributes, Raw, Renderable};
|
use hypertext::{html_elements, maud_move, GlobalAttributes, Raw, Renderable};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
/// Represents a simple post.
|
/// Represents a simple post.
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
pub(crate) struct Post {
|
pub struct Post {
|
||||||
pub(crate) title: String,
|
pub title: String,
|
||||||
#[serde(with = "super::isodate")]
|
#[serde(with = "super::isodate")]
|
||||||
pub(crate) date: DateTime<Utc>,
|
pub date: DateTime<Utc>,
|
||||||
pub(crate) desc: Option<String>,
|
pub desc: Option<String>,
|
||||||
pub(crate) scripts: Option<Vec<String>>,
|
pub scripts: Option<Vec<String>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Content for Post {
|
pub fn parse_content(
|
||||||
fn parse_content(
|
content: &str,
|
||||||
content: &str,
|
sack: &Sack,
|
||||||
sack: &Sack,
|
path: &Utf8Path,
|
||||||
path: &Utf8Path,
|
library: Option<&Library>,
|
||||||
library: Option<&Library>,
|
) -> (String, Outline, Bibliography) {
|
||||||
) -> (String, Outline, Bibliography) {
|
crate::text::md::parse(content, sack, path, library)
|
||||||
crate::text::md::parse(content, sack, path, library)
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn as_html(
|
pub fn as_html(
|
||||||
&self,
|
meta: &Post,
|
||||||
parsed: &str,
|
parsed: &str,
|
||||||
sack: &Sack,
|
sack: &Sack,
|
||||||
outline: Outline,
|
outline: Outline,
|
||||||
bibliography: Bibliography,
|
bibliography: Bibliography,
|
||||||
) -> String {
|
) -> String {
|
||||||
post(self, parsed, sack, outline, bibliography)
|
post(meta, parsed, sack, outline, bibliography)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.render()
|
.render()
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_link(&self, path: Utf8PathBuf) -> Option<Linkable> {
|
pub fn as_link(meta: &Post, path: Utf8PathBuf) -> Option<Linkable> {
|
||||||
Some(Linkable::Date(LinkDate {
|
Some(Linkable::Date(LinkDate {
|
||||||
link: Link {
|
link: Link {
|
||||||
path,
|
path,
|
||||||
name: self.title.to_owned(),
|
name: meta.title.to_owned(),
|
||||||
desc: self.desc.to_owned(),
|
desc: meta.desc.to_owned(),
|
||||||
},
|
},
|
||||||
date: self.date.to_owned(),
|
date: meta.date.to_owned(),
|
||||||
}))
|
}))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn post<'s, 'p, 'html>(
|
pub fn post<'s, 'p, 'html>(
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use camino::{Utf8Path, Utf8PathBuf};
|
use camino::{Utf8Path, Utf8PathBuf};
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use hauchiwa::{Bibliography, Content, Link, LinkDate, Linkable, Outline, Sack};
|
use hauchiwa::{Bibliography, Link, LinkDate, Linkable, Outline, Sack};
|
||||||
use hayagriva::Library;
|
use hayagriva::Library;
|
||||||
use hypertext::{html_elements, maud, GlobalAttributes, Raw, Renderable};
|
use hypertext::{html_elements, maud, GlobalAttributes, Raw, Renderable};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
@ -16,73 +16,77 @@ const CSS: &str = r#"
|
||||||
/// Represents a slideshow
|
/// Represents a slideshow
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
pub(crate) struct Slideshow {
|
pub(crate) struct Slideshow {
|
||||||
pub title: String,
|
pub title: String,
|
||||||
#[serde(with = "super::isodate")]
|
#[serde(with = "super::isodate")]
|
||||||
pub date: DateTime<Utc>,
|
pub date: DateTime<Utc>,
|
||||||
pub desc: Option<String>,
|
pub desc: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Content for Slideshow {
|
pub fn parse_content(
|
||||||
fn parse_content(
|
content: &str,
|
||||||
content: &str,
|
sack: &Sack,
|
||||||
sack: &Sack,
|
path: &Utf8Path,
|
||||||
path: &Utf8Path,
|
library: Option<&Library>,
|
||||||
library: Option<&Library>,
|
) -> (String, Outline, Bibliography) {
|
||||||
) -> (String, Outline, Bibliography) {
|
let parsed = content
|
||||||
let parsed = content
|
.split("\n-----\n")
|
||||||
.split("\n-----\n")
|
.map(|chunk| {
|
||||||
.map(|chunk| {
|
chunk
|
||||||
chunk
|
.split("\n---\n")
|
||||||
.split("\n---\n")
|
.map(|slide| crate::text::md::parse(&slide, sack, path, library).0)
|
||||||
.map(|slide| crate::text::md::parse(&slide, sack, path, library).0)
|
.collect::<Vec<_>>()
|
||||||
.collect::<Vec<_>>()
|
})
|
||||||
})
|
.map(|stack| match stack.len() > 1 {
|
||||||
.map(|stack| match stack.len() > 1 {
|
true => format!(
|
||||||
true => format!(
|
"<section>{}</section>",
|
||||||
"<section>{}</section>",
|
stack
|
||||||
stack
|
.into_iter()
|
||||||
.into_iter()
|
.map(|slide| format!("<section>{slide}</section>"))
|
||||||
.map(|slide| format!("<section>{slide}</section>"))
|
.collect::<String>()
|
||||||
.collect::<String>()
|
),
|
||||||
),
|
false => format!("<section>{}</section>", stack[0]),
|
||||||
false => format!("<section>{}</section>", stack[0]),
|
})
|
||||||
})
|
.collect::<String>();
|
||||||
.collect::<String>();
|
(parsed, Outline(vec![]), Bibliography(None))
|
||||||
(parsed, Outline(vec![]), Bibliography(None))
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn as_html(&self, parsed: &str, sack: &Sack, _: Outline, _: Bibliography) -> String {
|
pub fn as_html(
|
||||||
show(self, sack, parsed)
|
slides: &Slideshow,
|
||||||
}
|
parsed: &str,
|
||||||
|
sack: &Sack,
|
||||||
|
_: Outline,
|
||||||
|
_: Bibliography,
|
||||||
|
) -> String {
|
||||||
|
show(slides, sack, parsed)
|
||||||
|
}
|
||||||
|
|
||||||
fn as_link(&self, path: Utf8PathBuf) -> Option<Linkable> {
|
pub fn as_link(slides: &Slideshow, path: Utf8PathBuf) -> Option<Linkable> {
|
||||||
Some(Linkable::Date(LinkDate {
|
Some(Linkable::Date(LinkDate {
|
||||||
link: Link {
|
link: Link {
|
||||||
path,
|
path,
|
||||||
name: self.title.to_owned(),
|
name: slides.title.to_owned(),
|
||||||
desc: self.desc.to_owned(),
|
desc: slides.desc.to_owned(),
|
||||||
},
|
},
|
||||||
date: self.date.to_owned(),
|
date: slides.date.to_owned(),
|
||||||
}))
|
}))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn show(fm: &Slideshow, sack: &Sack, slides: &str) -> String {
|
pub fn show(fm: &Slideshow, sack: &Sack, slides: &str) -> String {
|
||||||
crate::html::bare(
|
crate::html::bare(
|
||||||
sack,
|
sack,
|
||||||
maud!(
|
maud!(
|
||||||
div .reveal {
|
div .reveal {
|
||||||
div .slides {
|
div .slides {
|
||||||
(Raw(slides))
|
(Raw(slides))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
style { (Raw(CSS)) }
|
style { (Raw(CSS)) }
|
||||||
),
|
),
|
||||||
fm.title.clone(),
|
fm.title.clone(),
|
||||||
Some(&["reveal".into()])
|
Some(&["reveal".into()]),
|
||||||
)
|
)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.render()
|
.render()
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use camino::{Utf8Path, Utf8PathBuf};
|
use camino::{Utf8Path, Utf8PathBuf};
|
||||||
use hauchiwa::{Bibliography, Content, Link, Linkable, Outline, Sack};
|
use hauchiwa::{Bibliography, Link, Linkable, Outline, Sack};
|
||||||
use hayagriva::Library;
|
use hayagriva::Library;
|
||||||
use hypertext::{html_elements, maud_move, GlobalAttributes, Raw, Renderable};
|
use hypertext::{html_elements, maud_move, GlobalAttributes, Raw, Renderable};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
@ -10,33 +10,31 @@ pub struct Wiki {
|
||||||
pub title: String,
|
pub title: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Content for Wiki {
|
pub fn parse_content(
|
||||||
fn parse_content(
|
content: &str,
|
||||||
content: &str,
|
sack: &Sack,
|
||||||
sack: &Sack,
|
path: &Utf8Path,
|
||||||
path: &Utf8Path,
|
library: Option<&Library>,
|
||||||
library: Option<&Library>,
|
) -> (String, Outline, Bibliography) {
|
||||||
) -> (String, Outline, Bibliography) {
|
crate::text::md::parse(content, sack, path, library)
|
||||||
crate::text::md::parse(content, sack, path, library)
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn as_html(
|
pub fn as_html(
|
||||||
&self,
|
meta: &Wiki,
|
||||||
parsed: &str,
|
parsed: &str,
|
||||||
sack: &Sack,
|
sack: &Sack,
|
||||||
outline: Outline,
|
outline: Outline,
|
||||||
bibliography: Bibliography,
|
bibliography: Bibliography,
|
||||||
) -> String {
|
) -> String {
|
||||||
wiki(self, parsed, sack, outline, bibliography)
|
wiki(meta, parsed, sack, outline, bibliography)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_link(&self, path: Utf8PathBuf) -> Option<Linkable> {
|
pub fn as_link(meta: &Wiki, path: Utf8PathBuf) -> Option<Linkable> {
|
||||||
Some(Linkable::Link(Link {
|
Some(Linkable::Link(Link {
|
||||||
path,
|
path,
|
||||||
name: self.title.to_owned(),
|
name: meta.title.to_owned(),
|
||||||
desc: None,
|
desc: None,
|
||||||
}))
|
}))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn wiki(
|
fn wiki(
|
||||||
|
@ -82,7 +80,7 @@ fn wiki(
|
||||||
);
|
);
|
||||||
|
|
||||||
crate::html::page(sack, main, matter.title.to_owned(), None)
|
crate::html::page(sack, main, matter.title.to_owned(), None)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.render()
|
.render()
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
61
src/main.rs
61
src/main.rs
|
@ -3,7 +3,7 @@ mod text;
|
||||||
mod ts;
|
mod ts;
|
||||||
|
|
||||||
use clap::{Parser, ValueEnum};
|
use clap::{Parser, ValueEnum};
|
||||||
use hauchiwa::Website;
|
use hauchiwa::{Loader, Processor, Website};
|
||||||
use html::{Flox, Post, Slideshow, Wiki};
|
use html::{Flox, Post, Slideshow, Wiki};
|
||||||
use hypertext::Renderable;
|
use hypertext::Renderable;
|
||||||
|
|
||||||
|
@ -22,12 +22,48 @@ enum Mode {
|
||||||
fn main() {
|
fn main() {
|
||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
|
|
||||||
|
let processor_post = Processor {
|
||||||
|
read_content: crate::html::post::parse_content,
|
||||||
|
to_html: crate::html::post::as_html,
|
||||||
|
to_link: crate::html::post::as_link,
|
||||||
|
};
|
||||||
|
|
||||||
|
let processor_slideshow = Processor {
|
||||||
|
read_content: crate::html::slideshow::parse_content,
|
||||||
|
to_html: crate::html::slideshow::as_html,
|
||||||
|
to_link: crate::html::slideshow::as_link,
|
||||||
|
};
|
||||||
|
|
||||||
|
let processor_wiki = Processor {
|
||||||
|
read_content: crate::html::wiki::parse_content,
|
||||||
|
to_html: crate::html::wiki::as_html,
|
||||||
|
to_link: crate::html::wiki::as_link,
|
||||||
|
};
|
||||||
|
|
||||||
|
let processor_flox = Processor {
|
||||||
|
read_content: crate::html::parse_content,
|
||||||
|
to_html: crate::html::as_html,
|
||||||
|
to_link: crate::html::as_link,
|
||||||
|
};
|
||||||
|
|
||||||
let website = Website::design()
|
let website = Website::design()
|
||||||
.content::<Post>("content/about.md", ["md"].into())
|
.add_loaders(vec![
|
||||||
.content::<Post>("content/posts/**/*", ["md", "mdx"].into())
|
Loader::glob_with::<Post>("content", "about.md", ["md"].into(), processor_post.clone()),
|
||||||
.content::<Slideshow>("content/slides/**/*", ["md", "lhs"].into())
|
Loader::glob_with::<Post>(
|
||||||
.content::<Wiki>("content/wiki/**/*", ["md"].into())
|
"content",
|
||||||
.content::<Flox>("content/projects/flox.md", ["md"].into())
|
"posts/**/*",
|
||||||
|
["md", "mdx"].into(),
|
||||||
|
processor_post.clone(),
|
||||||
|
),
|
||||||
|
Loader::glob_with::<Slideshow>(
|
||||||
|
"content",
|
||||||
|
"slides/**/*",
|
||||||
|
["md", "lhs"].into(),
|
||||||
|
processor_slideshow,
|
||||||
|
),
|
||||||
|
Loader::glob_with::<Wiki>("content", "wiki/**/*", ["md"].into(), processor_wiki),
|
||||||
|
Loader::glob_with::<Flox>("content", "projects/flox.md", ["md"].into(), processor_flox),
|
||||||
|
])
|
||||||
.js("search", "./js/search/dist/search.js")
|
.js("search", "./js/search/dist/search.js")
|
||||||
.js("photos", "./js/vanilla/photos.js")
|
.js("photos", "./js/vanilla/photos.js")
|
||||||
.js("reveal", "./js/vanilla/reveal.js")
|
.js("reveal", "./js/vanilla/reveal.js")
|
||||||
|
@ -37,12 +73,15 @@ fn main() {
|
||||||
|sack| crate::html::map(sack).unwrap().render().to_owned().into(),
|
|sack| crate::html::map(sack).unwrap().render().to_owned().into(),
|
||||||
"map/index.html".into(),
|
"map/index.html".into(),
|
||||||
)
|
)
|
||||||
|
.add_virtual(|sack| crate::html::search(sack), "search/index.html".into())
|
||||||
.add_virtual(
|
.add_virtual(
|
||||||
|sack| crate::html::search(sack),
|
|sack| {
|
||||||
"search/index.html".into(),
|
crate::html::to_list(
|
||||||
)
|
sack,
|
||||||
.add_virtual(
|
sack.get_links("projects/**/*.html"),
|
||||||
|sack| crate::html::to_list(sack, sack.get_links("projects/**/*.html"), "Projects".into()),
|
"Projects".into(),
|
||||||
|
)
|
||||||
|
},
|
||||||
"projects/index.html".into(),
|
"projects/index.html".into(),
|
||||||
)
|
)
|
||||||
.add_virtual(
|
.add_virtual(
|
||||||
|
|
|
@ -1,43 +1,43 @@
|
||||||
.flox-playground {
|
.flox-playground {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
grid-template-rows: max(24rem, 0.5vh);
|
grid-template-rows: max(24rem, 0.5vh);
|
||||||
gap: 1em;
|
gap: 1em;
|
||||||
margin-block: 0.5em;
|
margin-block: 0.5em;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
|
|
||||||
.editor,
|
.editor,
|
||||||
#output {
|
#output {
|
||||||
height: calc(100% - 4em);
|
height: calc(100% - 4em);
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
border: 1px dashed black;
|
border: 1px dashed black;
|
||||||
border-radius: 0.5em;
|
border-radius: 0.5em;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor {
|
.editor {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
#run {
|
#run {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0.5em;
|
right: 0.5em;
|
||||||
bottom: 0.5em;
|
bottom: 0.5em;
|
||||||
padding: 0.25em 0.5em;
|
padding: 0.25em 0.5em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#output {
|
#output {
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.flox-eval {
|
.flox-eval {
|
||||||
border-radius: 0.5em;
|
border-radius: 0.5em;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
> .output {
|
> .output {
|
||||||
padding: 0.25em 0.5em;
|
padding: 0.25em 0.5em;
|
||||||
border-top: 1px solid black;
|
border-top: 1px solid black;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue