diff options
author | Dimitrii Dulgher <d1alogw0w@gmail.com> | 2024-04-13 00:04:06 +0300 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2024-04-15 13:08:02 +0100 |
commit | a1c22e954299de5c823ec47cd2f633355764e3b2 (patch) | |
tree | 6db2d8e2d349d3078bb30190fae2271797cbc18a /src/content/chapter0_basics | |
parent | 421cbe75fa1bfbd4bc271bf233ede15836de760d (diff) | |
download | tour-a1c22e954299de5c823ec47cd2f633355764e3b2.tar.gz tour-a1c22e954299de5c823ec47cd2f633355764e3b2.zip |
Add hrefs to code keywords
Diffstat (limited to 'src/content/chapter0_basics')
10 files changed, 70 insertions, 30 deletions
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 @@ <p> Gleam code is organized into units called <em>modules</em>. A module is a bunch of definitions (of types, functions, etc.) that seem to belong together. - For example, the <code>gleam/io</code> module contains a variety of functions - for printing, like <code>println</code>. + For example, the + <a href="https://hexdocs.pm/gleam_stdlib/gleam/io.html" target="_blank"> + <code>gleam/io</code> + </a> + module contains a variety of functions for printing, like + <a href="https://hexdocs.pm/gleam_stdlib/gleam/io.html#println" target="_blank"> + <code>println</code> + </a>. </p> <p> All gleam code is in <i>some</i> module or other, whose name comes from the - name of the file it's in. For example, <code>gleam/io</code> is in a file - called <code>io.gleam</code> in a directory called <code>gleam</code>. + name of the file it's in. For example, + <a href="https://hexdocs.pm/gleam_stdlib/gleam/io.html" target="_blank"> + <code>gleam/io</code> + </a> + is in a file called <code>io.gleam</code> in a directory called <code>gleam</code>. </p> <p> For code in one module to access code in another module, we import it using the <code>import</code> keyword, and the name used to refer to it is the last - part of the module name. For example, the <code>gleam/io</code> module is - referred to as <code>io</code> once imported. + part of the module name. For example, the + <a href="https://hexdocs.pm/gleam_stdlib/gleam/io.html" target="_blank"> + <code>gleam/io</code> + </a> + module is referred to as <code>io</code> once imported. </p> <p> The <code>as</code> keyword can be used to refer to a module by a different - name. See how the <code>gleam/string</code> module is referred to as - <code>text</code> here. + name. See how the + <a href="https://hexdocs.pm/gleam_stdlib/gleam/string.html" target="_blank"> + <code>gleam/string</code> + </a> + module is referred to as <code>text</code> here. </p> 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 <em>qualified</em> fashion, meaning the name used to refer the module goes before function name with a dot between them. For example, - <code>io.println("Hello!")</code>. + <a href="https://hexdocs.pm/gleam_stdlib/gleam/io.html#println" target="_blank"> + <code>io.println("Hello!")</code> + </a>. </p> <p> 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. </p> <p> - Uncomment the line <code>io.println(4)</code> and see how a compile time error - is reported as the <code>io.println</code> function only works with strings, - not ints. + Uncomment the line + <a href="https://hexdocs.pm/gleam_stdlib/gleam/io.html#println" target="_blank"> + <code>io.println(4)</code> + </a> + and see how a compile time error + is reported as the + <a href="https://hexdocs.pm/gleam_stdlib/gleam/io.html#println" target="_blank"> + <code>io.println</code> + </a> + function only works with strings, not ints. </p> <p> - To fix the code change the code to call the <code>io.debug</code> + To fix the code change the code to call the + <a href="https://hexdocs.pm/gleam_stdlib/gleam/io.html#debug" target="_blank"> + <code>io.debug</code> + </a> function instead, as it will print a value of any type. </p> <p> 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, </p> <p> - The - <a href="https://hexdocs.pm/gleam_stdlib/gleam/int.html" - ><code>gleam/int</code></a - > + The + <a href="https://hexdocs.pm/gleam_stdlib/gleam/int.html" target="_blank"> + <code>gleam/int</code> + </a> standard library module contains functions for working with ints. </p> 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. </p> <p> - The - <a href="https://hexdocs.pm/gleam_stdlib/gleam/float.html" - ><code>gleam/float</code></a - > + The + <a href="https://hexdocs.pm/gleam_stdlib/gleam/float.html" target="_blank"> + <code>gleam/float</code> + </a> standard library module contains functions for working with floats. </p> 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 @@ <li><code>\u{xxxxxx}</code> - unicode codepoint</li> </ul> <p> - The <a href="https://hexdocs.pm/gleam_stdlib/gleam/string.html"><code>gleam/string</code></a> + The + <a href="https://hexdocs.pm/gleam_stdlib/gleam/string.html" target="_blank"> + <code>gleam/string</code> + </a> standard library module contains functions for working with strings. </p> 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. </p> <p> - The <a href="https://hexdocs.pm/gleam_stdlib/gleam/bool.html"><code>gleam/bool</code></a> + The + <a href="https://hexdocs.pm/gleam_stdlib/gleam/bool.html" target="_blank"> + <code>gleam/bool</code> + </a> standard library module contains functions for working with bools. </p> 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 @@ </p> <p> Like functions types can be referred to in a <em>qualified</em> way by putting - the imported module name and a dot before the type name. For example, - <code>bytes_builder.BytesBuilder</code> + the imported module name and a dot before the type name. For example, + <a href="https://hexdocs.pm/gleam_stdlib/gleam/bytes_builder.html#BytesBuilder" target="_blank"> + <code>bytes_builder.BytesBuilder</code> + </a> </p> <p> Types can also be imported in an <em>unqualified</em> 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. </p> <p> - Try uncommenting <code>io.debug(degrees)</code> to see the compile error from - trying to use a variable that is not in scope. + Try uncommenting + <a href="https://hexdocs.pm/gleam_stdlib/gleam/io.html#debug" target="_blank"> + <code>io.debug(degrees)</code> + </a> + to see the compile error from trying to use a variable that is not in scope. </p> <p> 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. </p> <p> - <code>List</code> is a generic type, having a type parameter - for the type of values it contains. A list of ints has the type - <code>List(Int)</code>, and a list of strings has the type + <a href="https://hexdocs.pm/gleam_stdlib/gleam/list.html" target="_blank"> + <code>List</code> + </a> + is a generic type, having a type parameter for the type of values it contains. + A list of ints has the type <code>List(Int)</code>, and a list of strings has the type <code>List(String)</code>. </p> <p> |