From a1c22e954299de5c823ec47cd2f633355764e3b2 Mon Sep 17 00:00:00 2001 From: Dimitrii Dulgher Date: Sat, 13 Apr 2024 00:04:06 +0300 Subject: Add hrefs to code keywords --- .../chapter0_basics/lesson02_modules/en.html | 31 ++++++++++++++++------ .../lesson03_unqualified_imports/en.html | 4 ++- .../chapter0_basics/lesson04_type_checking/en.html | 18 ++++++++++--- src/content/chapter0_basics/lesson05_ints/en.html | 8 +++--- .../chapter0_basics/lesson06_floats/en.html | 8 +++--- .../chapter0_basics/lesson09_strings/en.html | 5 +++- src/content/chapter0_basics/lesson10_bools/en.html | 5 +++- .../chapter0_basics/lesson14_type_imports/en.html | 6 +++-- .../chapter0_basics/lesson16_blocks/en.html | 7 +++-- src/content/chapter0_basics/lesson17_lists/en.html | 8 +++--- 10 files changed, 70 insertions(+), 30 deletions(-) (limited to 'src/content/chapter0_basics') diff --git a/src/content/chapter0_basics/lesson02_modules/en.html b/src/content/chapter0_basics/lesson02_modules/en.html index d26977d..7f34d0b 100644 --- a/src/content/chapter0_basics/lesson02_modules/en.html +++ b/src/content/chapter0_basics/lesson02_modules/en.html @@ -1,22 +1,37 @@

Gleam code is organized into units called modules. A module is a bunch of definitions (of types, functions, etc.) that seem to belong together. - For example, the gleam/io module contains a variety of functions - for printing, like println. + For example, the + + gleam/io + + module contains a variety of functions for printing, like + + println + .

All gleam code is in some module or other, whose name comes from the - name of the file it's in. For example, gleam/io is in a file - called io.gleam in a directory called gleam. + name of the file it's in. For example, + + gleam/io + + is in a file called io.gleam in a directory called gleam.

For code in one module to access code in another module, we import it using the import keyword, and the name used to refer to it is the last - part of the module name. For example, the gleam/io module is - referred to as io once imported. + part of the module name. For example, the + + gleam/io + + module is referred to as io once imported.

The as keyword can be used to refer to a module by a different - name. See how the gleam/string module is referred to as - text here. + name. See how the + + gleam/string + + module is referred to as text here.

diff --git a/src/content/chapter0_basics/lesson03_unqualified_imports/en.html b/src/content/chapter0_basics/lesson03_unqualified_imports/en.html index ca83f2f..35ea10f 100644 --- a/src/content/chapter0_basics/lesson03_unqualified_imports/en.html +++ b/src/content/chapter0_basics/lesson03_unqualified_imports/en.html @@ -2,7 +2,9 @@ Normally functions from other modules are used in a qualified fashion, meaning the name used to refer the module goes before function name with a dot between them. For example, - io.println("Hello!"). + + io.println("Hello!") + .

It is also possible to specify a list of functions to import from a module in diff --git a/src/content/chapter0_basics/lesson04_type_checking/en.html b/src/content/chapter0_basics/lesson04_type_checking/en.html index a9316c4..0cffcbe 100644 --- a/src/content/chapter0_basics/lesson04_type_checking/en.html +++ b/src/content/chapter0_basics/lesson04_type_checking/en.html @@ -3,12 +3,22 @@ code, catching mistakes and showing you where to make changes.

- Uncomment the line io.println(4) and see how a compile time error - is reported as the io.println function only works with strings, - not ints. + Uncomment the line + + io.println(4) + + and see how a compile time error + is reported as the + + io.println + + function only works with strings, not ints.

- To fix the code change the code to call the io.debug + To fix the code change the code to call the + + io.debug + function instead, as it will print a value of any type.

diff --git a/src/content/chapter0_basics/lesson05_ints/en.html b/src/content/chapter0_basics/lesson05_ints/en.html index 252496a..41793d5 100644 --- a/src/content/chapter0_basics/lesson05_ints/en.html +++ b/src/content/chapter0_basics/lesson05_ints/en.html @@ -9,9 +9,9 @@ JavaScript's 64 bit floating point numbers,

- The - gleam/int + The + + gleam/int + standard library module contains functions for working with ints.

diff --git a/src/content/chapter0_basics/lesson06_floats/en.html b/src/content/chapter0_basics/lesson06_floats/en.html index 7175628..2b2c5b7 100644 --- a/src/content/chapter0_basics/lesson06_floats/en.html +++ b/src/content/chapter0_basics/lesson06_floats/en.html @@ -24,9 +24,9 @@ Division by zero will not overflow, but is instead defined to be zero.

- The - gleam/float + The + + gleam/float + standard library module contains functions for working with floats.

diff --git a/src/content/chapter0_basics/lesson09_strings/en.html b/src/content/chapter0_basics/lesson09_strings/en.html index e5400ca..8e4b6f7 100644 --- a/src/content/chapter0_basics/lesson09_strings/en.html +++ b/src/content/chapter0_basics/lesson09_strings/en.html @@ -18,6 +18,9 @@
  • \u{xxxxxx} - unicode codepoint
  • - The gleam/string + The + + gleam/string + standard library module contains functions for working with strings.

    diff --git a/src/content/chapter0_basics/lesson10_bools/en.html b/src/content/chapter0_basics/lesson10_bools/en.html index 36daf09..3cbf0d4 100644 --- a/src/content/chapter0_basics/lesson10_bools/en.html +++ b/src/content/chapter0_basics/lesson10_bools/en.html @@ -12,6 +12,9 @@ side of the operator will not be evaluated.

    - The gleam/bool + The + + gleam/bool + standard library module contains functions for working with bools.

    diff --git a/src/content/chapter0_basics/lesson14_type_imports/en.html b/src/content/chapter0_basics/lesson14_type_imports/en.html index 37595e5..6c6fdba 100644 --- a/src/content/chapter0_basics/lesson14_type_imports/en.html +++ b/src/content/chapter0_basics/lesson14_type_imports/en.html @@ -4,8 +4,10 @@

    Like functions types can be referred to in a qualified way by putting - the imported module name and a dot before the type name. For example, - bytes_builder.BytesBuilder + the imported module name and a dot before the type name. For example, + + bytes_builder.BytesBuilder +

    Types can also be imported in an unqualified way by listing them in diff --git a/src/content/chapter0_basics/lesson16_blocks/en.html b/src/content/chapter0_basics/lesson16_blocks/en.html index bc82e39..b19c586 100644 --- a/src/content/chapter0_basics/lesson16_blocks/en.html +++ b/src/content/chapter0_basics/lesson16_blocks/en.html @@ -7,8 +7,11 @@ Any variables assigned within the block can only be used within the block.

    - Try uncommenting io.debug(degrees) to see the compile error from - trying to use a variable that is not in scope. + Try uncommenting + + io.debug(degrees) + + to see the compile error from trying to use a variable that is not in scope.

    Blocks can also be used to change the order of evaluation of binary operators diff --git a/src/content/chapter0_basics/lesson17_lists/en.html b/src/content/chapter0_basics/lesson17_lists/en.html index c29758a..84f88f3 100644 --- a/src/content/chapter0_basics/lesson17_lists/en.html +++ b/src/content/chapter0_basics/lesson17_lists/en.html @@ -2,9 +2,11 @@ Lists are ordered collections of values.

    - List is a generic type, having a type parameter - for the type of values it contains. A list of ints has the type - List(Int), and a list of strings has the type + + List + + is a generic type, having a type parameter for the type of values it contains. + A list of ints has the type List(Int), and a list of strings has the type List(String).

    -- cgit v1.2.3