Skip to content

Commit

Permalink
🔀 Update dependencies to support jot 1.0.1 (#22)
Browse files Browse the repository at this point in the history
* update dependencies and add new linebreak render

* bump version

* update docstring
  • Loading branch information
ollema authored Aug 21, 2024
1 parent 88079be commit 925c54f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
12 changes: 6 additions & 6 deletions gleam.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "lustre_ssg"
version = "0.8.0"
version = "0.8.1"
description = "A simple static site generator for Lustre projects."

licences = ["MIT"]
Expand All @@ -11,11 +11,11 @@ links = [
gleam = ">= 0.33.0"

[dependencies]
gleam_stdlib = "~> 0.34"
jot = "1.0.0"
lustre = "~> 4.0"
simplifile = "~> 1.5"
tom = "~> 0.3"
gleam_stdlib = ">= 0.34.0"
jot = "1.0.1"
lustre = ">= 4.3.5 and < 5.0.0"
simplifile = ">= 1.7.0 and < 2.0.0"
tom = ">= 1.0.0 and < 2.0.0"

[dev-dependencies]
gleeunit = "~> 1.0"
25 changes: 13 additions & 12 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +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 = "2.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "CB10B0E7BF44282FB25162F1A24C1A025F6B93E777CCF238C4017E4EEF2CDE97" },
{ 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.38.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "663CF11861179AF415A625307447775C09404E752FF99A24E2057C835319F1BE" },
{ name = "gleeunit", version = "1.1.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "72CDC3D3F719478F26C4E2C5FED3E657AC81EC14A47D2D2DEBB8693CA3220C3B" },
{ name = "jot", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "jot", source = "hex", outer_checksum = "A929403A34DC43422BA50D9BE0B61447DE4F0AD62215BB8C640445370C02EC8B" },
{ name = "lustre", version = "4.2.6", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib"], otp_app = "lustre", source = "hex", outer_checksum = "9ABD71D63F4B8F362CB824DED2C4CA64895DEFACD8F22B0FF055BF15241B1AE2" },
{ 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.11.2", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "517FFB679E44AD71D059F3EF6A17BA6EFC8CB94FA174D52E22FB6768CF684D78" },
{ name = "gleam_stdlib", version = "0.40.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "86606B75A600BBD05E539EB59FABC6E307EEEA7B1E5865AFB6D980A93BCB2181" },
{ name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" },
{ name = "jot", version = "1.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "jot", source = "hex", outer_checksum = "A0A52BD8D079AB0ABF80BE11DC63B85CF5791125991A029FAD7D17820D9419D8" },
{ name = "lustre", version = "4.3.5", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib"], otp_app = "lustre", source = "hex", outer_checksum = "BED65BD6A23439FB155A5BE166ED3C6BC20DED844FA9BB21840860951BC8E153" },
{ name = "simplifile", version = "1.7.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "1D5DFA3A2F9319EC85825F6ED88B8E449F381B0D55A62F5E61424E748E7DDEB0" },
{ name = "tom", version = "0.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "tom", source = "hex", outer_checksum = "0831C73E45405A2153091226BF98FB485ED16376988602CC01A5FD086B82D577" },
{ name = "thoas", version = "1.2.1", build_tools = ["rebar3"], requirements = [], otp_app = "thoas", source = "hex", outer_checksum = "E38697EDFFD6E91BD12CEA41B155115282630075C2A727E7A6B2947F5408B86A" },
{ name = "tom", version = "1.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "tom", source = "hex", outer_checksum = "9EECB60150E834A07238BD5C7DF1FF07F7D4C5862BB8A773923D1981C7875FB0" },
]

[requirements]
gleam_stdlib = { version = "~> 0.34" }
gleam_stdlib = { version = ">= 0.34.0" }
gleeunit = { version = "~> 1.0" }
jot = { version = "1.0.0" }
lustre = { version = "~> 4.0" }
simplifile = { version = "~> 1.5" }
tom = { version = "~> 0.3" }
jot = { version = "1.0.1" }
lustre = { version = ">= 4.3.5 and < 5.0.0" }
simplifile = { version = ">= 1.7.0 and < 2.0.0" }
tom = { version = ">= 1.0.0 and < 2.0.0" }
9 changes: 8 additions & 1 deletion src/lustre/ssg/djot.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import tom.{type Toml}
/// document. For that, take a look at the [`render_with_metadata`](#render_with_metadata)
/// function.
///
/// This renderer is compatible with **v1.0.0** of the [jot](https://hexdocs.pm/jot/jot.html)
/// This renderer is compatible with **v1.0.1** of the [jot](https://hexdocs.pm/jot/jot.html)
/// package.
///
pub type Renderer(view) {
Expand All @@ -43,6 +43,7 @@ pub type Renderer(view) {
text: fn(String) -> view,
code: fn(String) -> view,
image: fn(jot.Destination, String) -> view,
linebreak: fn() -> view,
)
}

Expand Down Expand Up @@ -105,6 +106,7 @@ pub fn default_renderer() -> Renderer(Element(msg)) {
jot.Url(url) -> html.img([attribute.src(url), attribute.alt(alt)])
}
},
linebreak: fn() { html.br([]) },
)
}

Expand Down Expand Up @@ -269,6 +271,10 @@ fn render_inline(
jot.Image(alt, destination) -> {
renderer.image(destination, text_content(alt))
}

jot.Linebreak -> {
renderer.linebreak()
}
}
}

Expand All @@ -292,5 +298,6 @@ fn text_content(segments: List(jot.Inline)) -> String {
jot.Strong(content) -> text <> text_content(content)
jot.Code(content) -> text <> content
jot.Image(_, _) -> text
jot.Linebreak -> text
}
}

0 comments on commit 925c54f

Please sign in to comment.