aboutsummaryrefslogtreecommitdiff
path: root/lessons
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2023-12-01 22:17:09 +0000
committerLouis Pilfold <louis@lpil.uk>2023-12-06 16:20:50 +0000
commite32d68d064c4663818dc5445541f2cd67d2e04dc (patch)
tree5270ebce540312e8d7ea76a78e656726245920e0 /lessons
downloadtour-e32d68d064c4663818dc5445541f2cd67d2e04dc.tar.gz
tour-e32d68d064c4663818dc5445541f2cd67d2e04dc.zip
Rename
Diffstat (limited to 'lessons')
-rw-r--r--lessons/README.md22
-rw-r--r--lessons/gleam.toml9
-rw-r--r--lessons/manifest.toml11
-rw-r--r--lessons/src/lesson000_hello_world/code.gleam5
-rw-r--r--lessons/src/lesson000_hello_world/text.html26
-rw-r--r--lessons/src/lesson001_basics/code.gleam5
-rw-r--r--lessons/src/lesson001_basics/text.html3
-rw-r--r--lessons/src/lesson002_another/code.gleam5
-rw-r--r--lessons/src/lesson002_another/text.html8
-rw-r--r--lessons/test/lessons_test.gleam12
10 files changed, 106 insertions, 0 deletions
diff --git a/lessons/README.md b/lessons/README.md
new file mode 100644
index 0000000..01cefea
--- /dev/null
+++ b/lessons/README.md
@@ -0,0 +1,22 @@
+# lessons
+
+[![Package Version](https://img.shields.io/hexpm/v/lessons)](https://hex.pm/packages/lessons)
+[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/lessons/)
+
+## Quick start
+
+```sh
+gleam run # Run the project
+gleam test # Run the tests
+gleam shell # Run an Erlang shell
+```
+
+## Installation
+
+If available on Hex this package can be added to your Gleam project:
+
+```sh
+gleam add lessons
+```
+
+and its documentation can be found at <https://hexdocs.pm/lessons>.
diff --git a/lessons/gleam.toml b/lessons/gleam.toml
new file mode 100644
index 0000000..6eb67c6
--- /dev/null
+++ b/lessons/gleam.toml
@@ -0,0 +1,9 @@
+name = "lessons"
+version = "1.0.0"
+target = "javascript"
+
+[dependencies]
+gleam_stdlib = "~> 0.32"
+
+[dev-dependencies]
+gleeunit = "~> 1.0"
diff --git a/lessons/manifest.toml b/lessons/manifest.toml
new file mode 100644
index 0000000..9491fa4
--- /dev/null
+++ b/lessons/manifest.toml
@@ -0,0 +1,11 @@
+# This file was generated by Gleam
+# You typically do not need to edit this file
+
+packages = [
+ { name = "gleam_stdlib", version = "0.33.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "539E37A2AA5EBE8E75F4B74755E4CC604BD957C3000AC8D705A2024886A2738B" },
+ { name = "gleeunit", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "D3682ED8C5F9CAE1C928F2506DE91625588CC752495988CBE0F5653A42A6F334" },
+]
+
+[requirements]
+gleam_stdlib = { version = "~> 0.32" }
+gleeunit = { version = "~> 1.0" }
diff --git a/lessons/src/lesson000_hello_world/code.gleam b/lessons/src/lesson000_hello_world/code.gleam
new file mode 100644
index 0000000..30530b2
--- /dev/null
+++ b/lessons/src/lesson000_hello_world/code.gleam
@@ -0,0 +1,5 @@
+import gleam/io
+
+pub fn main() {
+ io.println("Hello, Joe!")
+}
diff --git a/lessons/src/lesson000_hello_world/text.html b/lessons/src/lesson000_hello_world/text.html
new file mode 100644
index 0000000..46e3fc2
--- /dev/null
+++ b/lessons/src/lesson000_hello_world/text.html
@@ -0,0 +1,26 @@
+<h2>Hello, friend 💫</h2>
+<p>
+ Welcome to Try Gleam! An interactive tour of the Gleam programming language.
+</p>
+<p>
+ It covers all aspects of the Gleam language, and assuming you have some
+ prior programming experience should teach you everything you need to write
+ real programs in Gleam.
+</p>
+<p>
+ The tour is interactive! The code shown is editable and will be compiled and
+ evaluated as you type. Anything you print using <code>io.println</code> or
+ <code>io.debug</code> will be shown in the lower right, along with any compile
+ errors and warnings. To evaluate Gleam code the tour compiles Gleam to
+ JavaScript and runs it, all entirely within your browser window.
+</p>
+<p>
+ If at any point you get stuck or have a question do not hesitate to ask in
+ <a href="https://discord.gg/Fm8Pwmy">the Gleam Discord server</a>. We're here
+ to help, and if you find something confusing then it's likely others will too,
+ and we want to know about it so we can improve the tour.
+</p>
+<p>
+ OK, let's go. Click "Next" to get started, or click "Index" to jump to a
+ specific topic.
+</p>
diff --git a/lessons/src/lesson001_basics/code.gleam b/lessons/src/lesson001_basics/code.gleam
new file mode 100644
index 0000000..440dc98
--- /dev/null
+++ b/lessons/src/lesson001_basics/code.gleam
@@ -0,0 +1,5 @@
+import gleam/io
+
+pub fn main() {
+ io.println("Hello, Mike!")
+}
diff --git a/lessons/src/lesson001_basics/text.html b/lessons/src/lesson001_basics/text.html
new file mode 100644
index 0000000..53bd3d3
--- /dev/null
+++ b/lessons/src/lesson001_basics/text.html
@@ -0,0 +1,3 @@
+<p>
+ Hey look, cool stuff!
+</p>
diff --git a/lessons/src/lesson002_another/code.gleam b/lessons/src/lesson002_another/code.gleam
new file mode 100644
index 0000000..440dc98
--- /dev/null
+++ b/lessons/src/lesson002_another/code.gleam
@@ -0,0 +1,5 @@
+import gleam/io
+
+pub fn main() {
+ io.println("Hello, Mike!")
+}
diff --git a/lessons/src/lesson002_another/text.html b/lessons/src/lesson002_another/text.html
new file mode 100644
index 0000000..850d151
--- /dev/null
+++ b/lessons/src/lesson002_another/text.html
@@ -0,0 +1,8 @@
+<p>
+ Lorem ipsum dolor sit amet consectetur, adipisicing elit. Magnam ab fuga,
+ placeat hic possimus harum tempore voluptatem, id nulla nihil laboriosam
+ suscipit quis obcaecati beatae blanditiis sint. Suscipit, voluptas officia.
+</p>
+<p>
+ Very exciting.
+</p>
diff --git a/lessons/test/lessons_test.gleam b/lessons/test/lessons_test.gleam
new file mode 100644
index 0000000..3831e7a
--- /dev/null
+++ b/lessons/test/lessons_test.gleam
@@ -0,0 +1,12 @@
+import gleeunit
+import gleeunit/should
+
+pub fn main() {
+ gleeunit.main()
+}
+
+// gleeunit test functions end in `_test`
+pub fn hello_world_test() {
+ 1
+ |> should.equal(1)
+}