diff --git a/gleam.toml b/gleam.toml index 103fdaa..d8d7314 100644 --- a/gleam.toml +++ b/gleam.toml @@ -14,7 +14,7 @@ gleam = ">= 0.33.0" gleam_stdlib = "~> 0.34" lustre = "~> 4.0" simplifile = "~> 1.5" -jot = "0.4.0" +jot = "0.5.0" tom = "~> 0.3" [dev-dependencies] diff --git a/manifest.toml b/manifest.toml index 0dfa774..2db3208 100644 --- a/manifest.toml +++ b/manifest.toml @@ -4,21 +4,21 @@ packages = [ { name = "filepath", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "EFB6FF65C98B2A16378ABC3EE2B14124168C0CE5201553DE652E2644DCFDB594" }, { name = "gleam_erlang", version = "0.25.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "054D571A7092D2A9727B3E5D183B7507DAB0DA41556EC9133606F09C15497373" }, - { name = "gleam_json", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "thoas"], otp_app = "gleam_json", source = "hex", outer_checksum = "8B197DD5D578EA6AC2C0D4BDC634C71A5BCA8E7DB5F47091C263ECB411A60DF3" }, + { name = "gleam_json", version = "1.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib", "thoas"], otp_app = "gleam_json", source = "hex", outer_checksum = "9063D14D25406326C0255BDA0021541E797D8A7A12573D849462CAFED459F6EB" }, { name = "gleam_otp", version = "0.10.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "0B04FE915ACECE539B317F9652CAADBBC0F000184D586AAAF2D94C100945D72B" }, { name = "gleam_stdlib", version = "0.37.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "5398BD6C2ABA17338F676F42F404B9B7BABE1C8DC7380031ACB05BBE1BCF3742" }, { name = "gleeunit", version = "1.1.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "72CDC3D3F719478F26C4E2C5FED3E657AC81EC14A47D2D2DEBB8693CA3220C3B" }, - { name = "jot", version = "0.4.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "jot", source = "hex", outer_checksum = "B20A745707EE60B857249D4533656A52964EA024E844005C4AD8135ED432D66C" }, - { name = "lustre", version = "4.1.8", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib"], otp_app = "lustre", source = "hex", outer_checksum = "55C3D26AEE6BF6B859927616B1F5BC25841926E4EA6A2A72ECC90D6769560F04" }, + { name = "jot", version = "0.5.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "jot", source = "hex", outer_checksum = "F9B974EEB4D687C29A86A41F0384D72EEADCA1D3CF3AF28FEE3135874AE1E93B" }, + { name = "lustre", version = "4.2.4", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib"], otp_app = "lustre", source = "hex", outer_checksum = "09B94E1380CBC400DCD594B36A845E5CB2E143DF89E95460B2CA59E44499CAC9" }, { name = "simplifile", version = "1.7.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "1D5DFA3A2F9319EC85825F6ED88B8E449F381B0D55A62F5E61424E748E7DDEB0" }, - { name = "thoas", version = "0.4.1", build_tools = ["rebar3"], requirements = [], otp_app = "thoas", source = "hex", outer_checksum = "4918D50026C073C4AB1388437132C77A6F6F7C8AC43C60C13758CC0ADCE2134E" }, + { name = "thoas", version = "1.2.1", build_tools = ["rebar3"], requirements = [], otp_app = "thoas", source = "hex", outer_checksum = "E38697EDFFD6E91BD12CEA41B155115282630075C2A727E7A6B2947F5408B86A" }, { name = "tom", version = "0.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "tom", source = "hex", outer_checksum = "0831C73E45405A2153091226BF98FB485ED16376988602CC01A5FD086B82D577" }, ] [requirements] gleam_stdlib = { version = "~> 0.34" } gleeunit = { version = "~> 1.0" } -jot = { version = "0.4.0" } +jot = { version = "0.5.0" } lustre = { version = "~> 4.0" } simplifile = { version = "~> 1.5" } tom = { version = "~> 0.3" } diff --git a/src/lustre/ssg/djot.gleam b/src/lustre/ssg/djot.gleam index 318f072..6261603 100644 --- a/src/lustre/ssg/djot.gleam +++ b/src/lustre/ssg/djot.gleam @@ -41,6 +41,7 @@ pub type Renderer(view) { paragraph: fn(Dict(String, String), List(view)) -> view, strong: fn(List(view)) -> view, text: fn(String) -> view, + code: fn(String) -> view, ) } @@ -95,6 +96,7 @@ pub fn default_renderer() -> Renderer(Element(msg)) { paragraph: fn(attrs, content) { html.p(to_attributes(attrs), content) }, strong: fn(content) { html.strong([], content) }, text: fn(text) { element.text(text) }, + code: fn(content) { html.code([], [element.text(content)]) }, ) } @@ -251,6 +253,10 @@ fn render_inline( jot.Strong(content) -> { renderer.strong(list.map(content, render_inline(_, references, renderer))) } + + jot.Code(content) -> { + renderer.code(content) + } } }