fix formatting
Some checks failed
test / test (push) Has been cancelled

This commit is contained in:
Isaac 2025-01-21 14:45:42 +11:00
parent 0f5ec5fd9c
commit e0e2691150
4 changed files with 17 additions and 15 deletions

View file

@ -1,12 +1,13 @@
import gleam/list
import gleam/order import gleam/order
import promptbox/parser import promptbox/parser
import gleam/list
import simplifile import simplifile
pub fn read_all_posts() { pub fn read_all_posts() {
let assert Ok(posts) = simplifile.read_directory("./priv/posts") let assert Ok(posts) = simplifile.read_directory("./priv/posts")
let posts = list.map(posts, fn(p) { let posts =
list.map(posts, fn(p) {
let assert Ok(content) = simplifile.read("./priv/posts/" <> p) let assert Ok(content) = simplifile.read("./priv/posts/" <> p)
parser.parse_post(content) parser.parse_post(content)
}) })

View file

@ -1,5 +1,5 @@
import promptbox/web
import promptbox/parser import promptbox/parser
import promptbox/web
pub fn generate_posts(posts: List(parser.Post)) { pub fn generate_posts(posts: List(parser.Post)) {
web.home(posts) web.home(posts)

View file

@ -37,6 +37,6 @@ fn prompt_element(post: parser.Post) {
html.div([attribute.class("grid lg:grid-cols-2 gap-6")], [ html.div([attribute.class("grid lg:grid-cols-2 gap-6")], [
html.div([attribute("dangerous-unescaped-html", post.post_p)], []), html.div([attribute("dangerous-unescaped-html", post.post_p)], []),
html.div([attribute("dangerous-unescaped-html", post.post_j)], []), html.div([attribute("dangerous-unescaped-html", post.post_j)], []),
]) ]),
]) ])
} }

View file

@ -1,11 +1,11 @@
import lustre/element
import promptbox/gen
import promptbox/files
import birl import birl
import gleam/io import gleam/io
import gleam/result import gleam/result
import gleeunit import gleeunit
import gleeunit/should import gleeunit/should
import lustre/element
import promptbox/files
import promptbox/gen
import promptbox/parser import promptbox/parser
import simplifile import simplifile
@ -15,7 +15,8 @@ pub fn main() {
// gleeunit test functions end in `_test` // gleeunit test functions end in `_test`
pub fn hello_world_test() { pub fn hello_world_test() {
let post = simplifile.read("./priv/posts/ebb_and_flow.md") let post =
simplifile.read("./priv/posts/ebb_and_flow.md")
|> result.unwrap("") |> result.unwrap("")
|> parser.parse_post |> parser.parse_post
|> io.debug |> io.debug