This commit is contained in:
+16
-12
@@ -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: " |#")
|
||||
|
||||
Reference in New Issue
Block a user