Skip to content

Commit

Permalink
Include titles on each page
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Jan 18, 2024
1 parent d11c5ee commit 74bfc1b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/tour.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const erlang_the_movie = [
"

const home_html = "
<h2>Welcome the Gleam language tour! 💫</h2>
<p>
This tour covers all aspects of the Gleam language, and assuming you have some
prior programming experience should teach you everything you need to write
Expand All @@ -74,7 +73,6 @@ const home_html = "
"

const what_next_html = "
<h2>What next? 💫</h2>
<p>
Congratulations on completing the tour! Here's some ideas for what to do next:
</p>
Expand Down Expand Up @@ -210,7 +208,7 @@ fn write_content(chapters: List(Chapter)) -> snag.Result(Nil) {
// Home page
use _ <- result.try(
write_lesson(Lesson(
name: "Welcome!",
name: "Welcome the Gleam language tour! 💫",
text: home_html,
code: hello_joe,
path: path_home,
Expand All @@ -222,7 +220,7 @@ fn write_content(chapters: List(Chapter)) -> snag.Result(Nil) {
// "What next" final page
use _ <- result.try(
write_lesson(Lesson(
name: "What next?",
name: "What next?",
text: what_next_html,
code: hello_mike,
path: path_what_next,
Expand All @@ -234,7 +232,7 @@ fn write_content(chapters: List(Chapter)) -> snag.Result(Nil) {
// Lesson contents page
use _ <- result.try(
write_lesson(Lesson(
name: "Contents",
name: "Table of Contents",
text: string.join(list.map(chapters, contents_list_html), "\n"),
code: hello_joe,
path: page_contents,
Expand Down Expand Up @@ -545,6 +543,7 @@ fn lesson_html(page: Lesson) -> String {
]),
h("article", [#("id", "playground")], [
h("section", [#("id", "left")], [
h("h2", [], [text(page.name)]),
htmb.dangerous_unescaped_fragment(string_builder.from_string(
page.text,
)),
Expand Down

0 comments on commit 74bfc1b

Please sign in to comment.