some cleanup
Build and Bundle Gleam App / build-and-bundle (push) Successful in 15s

This commit is contained in:
2026-07-09 20:30:16 +02:00
parent 1daef9645e
commit 5bcae0e0d6
3 changed files with 73 additions and 61 deletions
+16 -12
View File
@@ -1,23 +1,25 @@
import definition
import mode
import gleam/int
import gleam/result
import gleam/list
import gleam/dict
import gleam/int
import gleam/list
import gleam/result
import gleam/string
import mode
pub fn handler(line: String) -> definition.Line {
let result = parse(line)
let result = echo list.map(result, whatsthat)
let result = list.map(result, whatsthat)
definition.Line(result)
}
fn whatsthat(mod: String) -> definition.Inline {
let modes = dict.from_list([
#("!", #(mode.Marking, definition.Marking)),
#("@", #(mode.Truth, definition.Truth)),
#(">", #(mode.Quote, definition.Quote)),
#("#", #(mode.Hirachy, definition.Hirachy)),
])
let modes =
dict.from_list([
#("!", #(mode.Marking, definition.Marking)),
#("@", #(mode.Truth, definition.Truth)),
#(">", #(mode.Quote, definition.Quote)),
#("#", #(mode.Hirachy, definition.Hirachy)),
])
case string.pop_grapheme(mod) {
Ok(#(prefix, rest)) -> {
@@ -38,7 +40,9 @@ fn whatsthat(mod: String) -> definition.Inline {
Error(_) -> definition.Text(mod)
}
}fn parse(modificators: String) -> List(String) {
}
fn parse(modificators: String) -> List(String) {
modificators
// 1. Target the tags + their trailing space, wrapping them in "|"
|> string.replace(each: "#", with: " |#")