aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter0_basics/lesson01_hello_world
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2024-01-18 19:23:44 +0000
committerLouis Pilfold <louis@lpil.uk>2024-01-18 19:23:44 +0000
commit1e15f4ab689ed57980099919030c8965fe1ccffa (patch)
treeddd49f3f8ac86b10f059d99d77ae2db9b30d2aa9 /src/content/chapter0_basics/lesson01_hello_world
parentf5fee0986d38d845f816cf3607b82558814842a6 (diff)
downloadtour-1e15f4ab689ed57980099919030c8965fe1ccffa.tar.gz
tour-1e15f4ab689ed57980099919030c8965fe1ccffa.zip
Rename lesson
Diffstat (limited to 'src/content/chapter0_basics/lesson01_hello_world')
-rw-r--r--src/content/chapter0_basics/lesson01_hello_world/code.gleam7
-rw-r--r--src/content/chapter0_basics/lesson01_hello_world/text.html17
2 files changed, 24 insertions, 0 deletions
diff --git a/src/content/chapter0_basics/lesson01_hello_world/code.gleam b/src/content/chapter0_basics/lesson01_hello_world/code.gleam
new file mode 100644
index 0000000..67cc6b4
--- /dev/null
+++ b/src/content/chapter0_basics/lesson01_hello_world/code.gleam
@@ -0,0 +1,7 @@
+// Import a Gleam module from the standard library
+import gleam/io
+
+pub fn main() {
+ // Print to the console
+ io.println("Hello, Joe!")
+}
diff --git a/src/content/chapter0_basics/lesson01_hello_world/text.html b/src/content/chapter0_basics/lesson01_hello_world/text.html
new file mode 100644
index 0000000..8e2033a
--- /dev/null
+++ b/src/content/chapter0_basics/lesson01_hello_world/text.html
@@ -0,0 +1,17 @@
+<p>
+ Here is a program that prints out the text "Hello, Joe!".
+</p>
+<p>
+ It does this by using the `println` function which has been imported from the
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/io.html"><code>gleam/io</code></a>
+ module, which is part of the Gleam standard library.
+</p>
+<p>
+ In a normal Gleam program this program would be run use the command
+ <code>gleam run</code> on the command line, but here in this tutorial the
+ program is automatically compiled and run as the code is edited.
+</p>
+<p>
+ Try changing the text being printed to <code>Hello, Mike!</code> and see what
+ happens.
+</p>