Skip to content

Commit

Permalink
Fix relative reference paths
Browse files Browse the repository at this point in the history
  • Loading branch information
marcauberer committed Mar 7, 2024
1 parent b5b73d2 commit b861e15
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion docs/docs/language/arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Arrays
---

You can use arrays in Spice for any [primitive](../primitive-types.md) or custom [struct](../structs.md) data type.
You can use arrays in Spice for any [primitive](primitive-types.md) or custom [struct](structs.md) data type.

## Usage

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/language/builtin-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Builtin data types
In extension to the [primitive data types](../primitive-types.md), Spice offers builtin data types.

## The `String` data type
In opposite to the [string primitive type](../primitive-types.md#the-string-data-type), the `String` builtin type is
In opposite to the [string primitive type](primitive-types.md#the-string-data-type), the `String` builtin type is
mutable and offers several ways to modify the contained value.

!!! tip "Tip"
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/language/casts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Type Casts
---

Sometimes it is useful to directly cast [a type](../primitive-types.md) to another one. Spice offers type casting for some
Sometimes it is useful to directly cast [a type](primitive-types.md) to another one. Spice offers type casting for some
type combinations. Additionally, the casting operator can always be applied when the source type matches the cast
destination type.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/language/constructors-destructors.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ f<int> main() {
}
```

The `ctor` method can also be called manually like calling [other methods](./methods.md).
The `ctor` method can also be called manually like calling [other methods](methods.md).

## Destructors
You have the option to create a destructor by providing a `dtor` method on a struct. It does not allow any arguments and has no
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/language/do-while-loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: Do-While Loops

Do-While loops are designed to do something until a certain condition evaluates to `false`, but at least execute the action once.
This means, that a do-while loop could also run infinitely when the condition never gets fulfilled. <br>
Like the [if statement](../if-statements.md), the condition of the `do-while` loop must evaluate to a
[boolean value](../primitive-types.md#the-bool-data-type), but can hold complex, nested expressions.
Like the [if statement](if-statements.md), the condition of the `do-while` loop must evaluate to a
[boolean value](primitive-types.md#the-bool-data-type), but can hold complex, nested expressions.

## Usage

Expand All @@ -29,5 +29,5 @@ do {
```

!!! tip "Usage of loop alternatives"
If you somehow know how many times you want to execute something, we recommend you to use a [for loop](../for-loops.md)
instead. If you want to iterate over a container of items, consider using the [foreach loop](../foreach-loops.md).
If you somehow know how many times you want to execute something, we recommend you to use a [for loop](for-loops.md)
instead. If you want to iterate over a container of items, consider using the [foreach loop](foreach-loops.md).
4 changes: 2 additions & 2 deletions docs/docs/language/for-loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ for int i = 1; i <= 10; i++ {

!!! tip "Usage of loop alternatives"
For loops should only be used when it is foreseeable how often a block of code will run. If this is not the case, it
is recommended to use the [while loop](../while-loops.md) or [do-while loop](../do-while-loops.md) instead. If you want to
iterate over a container of items, consider using the [foreach loop](../foreach-loop.md).
is recommended to use the [while loop](while-loops.md) or [do-while loop](do-while-loops.md) instead. If you want to
iterate over a container of items, consider using the [foreach loop](foreach-loop.md).
6 changes: 3 additions & 3 deletions docs/docs/language/foreach-loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Foreach Loops
---

Foreach loops can be used to iterate over containers, that offer iterator implementations like `Vector`, `ArrayList`,
etc. as well as [arrays](../arrays.md) of arbitrary elements and number ranges.
etc. as well as [arrays](arrays.md) of arbitrary elements and number ranges.

## Usage

Expand Down Expand Up @@ -38,5 +38,5 @@ foreach long idx, string word : welcomeMessage {

!!! tip "Usage of loop alternatives"
Foreach loops should only be used when you have a container data structure and want to iterate over its items.
If this is not the case, we recommend using the [for loop](../for-loops.md), [while loop](../while-loops.md) or
[do-while loop](../do-while-loops.md) instead.
If this is not the case, we recommend using the [for loop](for-loops.md), [while loop](while-loops.md) or
[do-while loop](do-while-loops.md) instead.
2 changes: 1 addition & 1 deletion docs/docs/language/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ int result1 = demoFunction("another input", 1.0);

!!! tip
If you only want to execute some actions and don't need to return a value to the caller, please consider to use
[procedures](../procedures.md) instead of functions.
[procedures](procedures.md) instead of functions.
4 changes: 2 additions & 2 deletions docs/docs/language/generics.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
title: Generics
---

Spice offers basic support for generics. [Structs](./structs.md) and [Interfaces](./interfaces.md) as well as [functions](./functions.md)
and [procedures](./procedures.md) can be marked as generic by attaching a template list with one or more generic types to it.
Spice offers basic support for generics. [Structs](structs.md) and [Interfaces](interfaces.md) as well as [functions](functions.md)
and [procedures](procedures.md) can be marked as generic by attaching a template list with one or more generic types to it.

Spice resolves the substantiations of generic types at compile time. This helps to keep the runtime performance up.
Generic function substantiations that are unused, are removed by the compiler automatically.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/language/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Hello World

In this example, we will code a simple "Hello World" program in Spice. What it does is to simply print "Hello World!" to the
console when it gets started. The guide assumes, that you already have Spice
[installed on your development system](../install/linux.md) and are ready to go.
[installed on your development system](install/linux.md) and are ready to go.

## Write your first program

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/language/if-statements.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: If Statements

If statements can be used to execute parts of the program only if a condition is `true`. The specialist term for this is "branching". <br>
The condition of `if` statements can consist of more complex expressions, but always have to evaluate to a
[bool data type](../primitive-types.md#the-bool-data-type).
[bool data type](primitive-types.md#the-bool-data-type).

## Usage

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/language/main-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ f<int> main() {
}
```

Like any other [function](../functions.md), the `main` function automatically declares the variable `result` of the same type as the
Like any other [function](functions.md), the `main` function automatically declares the variable `result` of the same type as the
function return type. You then have the option to use either the return statement (e.g.: `return 1;`) or assign a value to the
`result` variable. If you choose the second option, the value of this variable gets returned at the end of the function body.
Unlike normal functions, the `main` function has `0` as the initial value assigned to the `result` variable for reasons of
convenience and to not always have to write `return 0;` or `result = 0;` to exit the program with a positive exit code.

!!! info "Hello World program"
Now, as you know how to start a program in Spice, you may like to write your first Spice program. Visit the guide for the
[Hello World example](../hello-world.md) to get started!
[Hello World example](hello-world.md) to get started!

## Command Line Arguments
Spice programs can accept command line arguments similar you would write it in C:
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/language/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Methods
---

Methods in Spice basically are [functions](../functions.md) / [procedures](../procedures.md), assigned to a struct. Within methods,
Methods in Spice basically are [functions](functions.md) / [procedures](procedures.md), assigned to a struct. Within methods,
fields of the parent struct can be accessed like this: `this.fieldName`.

## Usage
Expand Down Expand Up @@ -34,5 +34,5 @@ Content: Hello World!
```

!!! tip
You can initialize or destroy structs by using [constructors](../constructors.md) and [destructors](,./destructors.md).
You can initialize or destroy structs by using [constructors](constructors.md) and [destructors](destructors.md).
Read more about those in the respective documentation section.
2 changes: 1 addition & 1 deletion docs/docs/language/operator-overloading.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Operator Overloading
---

Spice allows overloading operators for [custom struct types](../structs.md).
Spice allows overloading operators for [custom struct types](structs.md).
Currently, this works for the operators `+`, `-`, `*`, `/`, `==`, `!=`, `<<`, `>>`, `+=`, `-=`, `*=`, `/=`,
`++` (postfix) and `--` (postfix).
In the future, more operators will be supported for overloading.
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/language/primitive-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ variable2 = "Hello World!";

!!! info "Note"
This type of string is immutable. So if you want to mutate your string at runtime, you can use the
[builtin String data type](../builtin-types.md#the-string-data-type).
[builtin String data type](builtin-types.md#the-string-data-type).

!!! tip "Tip"
Use the `string` primitive type over the `String` builtin type as much as possible, due to its advantages in runtime
Expand All @@ -103,8 +103,8 @@ variable2 = false;
```

!!! info "Additional information"
Many language components like [if statements](../if-statements.md), [for loops](../for-loops.md),
[while loops](../while-loops.md), etc. use the `bool` data type as evaluation unit for conditions.
Many language components like [if statements](if-statements.md), [for loops](for-loops.md),
[while loops](while-loops.md), etc. use the `bool` data type as evaluation unit for conditions.
You can find more information about that in the respective sections.

## The `dyn` data type
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/language/procedures.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ demoProcedure(7, true);

!!! tip
If you want to calculate something and need to return a value to the caller, please consider to use
[functions](../functions.md) instead of procedures.
[functions](functions.md) instead of procedures.
2 changes: 1 addition & 1 deletion docs/docs/language/references.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: References
---
In addition to [pointers](../pointers.md), Spice supports references. Under the hood, this works with non-nullable pointers.
In addition to [pointers](pointers.md), Spice supports references. Under the hood, this works with non-nullable pointers.

## Usage - local variables

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/language/structs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Person struct {
}
```

Structs can only be declared in the global scope, like [functions](../functions.md) and [procedures](../procedures.md).
Structs can only be declared in the global scope, like [functions](functions.md) and [procedures](procedures.md).

For creating an instance of the declared struct, you can pass values for either all or none of the fields in curly braces.
To access a field of the instance, you can address the field by its name:
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/language/while-loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: While Loops

While loops are designed to do something until a certain condition evaluates to `false`.
This means, that a while loop could also run infinitely when the condition never gets fulfilled. <br>
Like the [if statement](../if-statements.md), the condition of the `while` loop must evaluate to a
[boolean value](../primitive-types.md#the-bool-data-type), but can hold complex, nested expressions.
Like the [if statement](if-statements.md), the condition of the `while` loop must evaluate to a
[boolean value](primitive-types.md#the-bool-data-type), but can hold complex, nested expressions.

## Usage

Expand All @@ -29,5 +29,5 @@ while true {
```

!!! tip "Usage of loop alternatives"
If you somehow know how many times you want to execute something, we recommend you to use a [for loop](../for-loops.md)
instead. If you want to iterate over a container of items, consider using the [foreach loop](../foreach-loops.md).
If you somehow know how many times you want to execute something, we recommend you to use a [for loop](for-loops.md)
instead. If you want to iterate over a container of items, consider using the [foreach loop](foreach-loops.md).

0 comments on commit b861e15

Please sign in to comment.