From 4e1595a8ae59085ba277ee3e1a51fb73936221e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Wed, 19 Jan 2022 18:50:51 +0100 Subject: [PATCH] Improve docs (#60) * switch theme Signed-off-by: Flipez * update generator Signed-off-by: Flipez * fix path and style Signed-off-by: Flipez * change base url Signed-off-by: Flipez * improve file docs Signed-off-by: Flipez * improve file docs Signed-off-by: Flipez * Add header Signed-off-by: Flipez --- docs/content/docs/control_expressions/foreach.md | 1 + docs/content/docs/control_expressions/if.md | 1 + docs/content/docs/literals/array.md | 1 + docs/content/docs/literals/boolean.md | 1 + docs/content/docs/literals/error.md | 1 + docs/content/docs/literals/file.md | 1 + docs/content/docs/literals/float.md | 1 + docs/content/docs/literals/hash.md | 1 + docs/content/docs/literals/integer.md | 1 + docs/content/docs/literals/null.md | 1 + docs/content/docs/literals/string.md | 1 + docs/content/docs/specification/builtins.md | 9 +++++---- docs/content/docs/specification/closures.md | 1 + docs/content/docs/specification/comments.md | 1 + docs/content/docs/specification/functions.md | 3 ++- docs/content/docs/specification/local_variables.md | 1 + docs/content/docs/specification/modules.md | 1 + docs/templates/literal.md | 1 + 18 files changed, 23 insertions(+), 5 deletions(-) diff --git a/docs/content/docs/control_expressions/foreach.md b/docs/content/docs/control_expressions/foreach.md index 4d3fe3b..50576a6 100644 --- a/docs/content/docs/control_expressions/foreach.md +++ b/docs/content/docs/control_expressions/foreach.md @@ -4,6 +4,7 @@ menu: docs: parent: "controls" --- +# Foreach For loops allow to iterate over different sets of data and perform actions based on them. ```js diff --git a/docs/content/docs/control_expressions/if.md b/docs/content/docs/control_expressions/if.md index f99f1a4..9a29c30 100644 --- a/docs/content/docs/control_expressions/if.md +++ b/docs/content/docs/control_expressions/if.md @@ -4,6 +4,7 @@ menu: docs: parent: "controls" --- +# If With `if` and `else` keywords the flow of a program can be controlled. ```js diff --git a/docs/content/docs/literals/array.md b/docs/content/docs/literals/array.md index 8166c3f..305bb0e 100644 --- a/docs/content/docs/literals/array.md +++ b/docs/content/docs/literals/array.md @@ -4,6 +4,7 @@ menu: docs: parent: "literals" --- +# Array diff --git a/docs/content/docs/literals/boolean.md b/docs/content/docs/literals/boolean.md index 49df426..67dcebd 100644 --- a/docs/content/docs/literals/boolean.md +++ b/docs/content/docs/literals/boolean.md @@ -4,6 +4,7 @@ menu: docs: parent: "literals" --- +# Boolean A Boolean can represent two values: `true` and `false` and can be used in control flows. diff --git a/docs/content/docs/literals/error.md b/docs/content/docs/literals/error.md index 21e931d..1183fb0 100644 --- a/docs/content/docs/literals/error.md +++ b/docs/content/docs/literals/error.md @@ -4,6 +4,7 @@ menu: docs: parent: "literals" --- +# Error diff --git a/docs/content/docs/literals/file.md b/docs/content/docs/literals/file.md index d5edb42..cf1910c 100644 --- a/docs/content/docs/literals/file.md +++ b/docs/content/docs/literals/file.md @@ -4,6 +4,7 @@ menu: docs: parent: "literals" --- +# File diff --git a/docs/content/docs/literals/float.md b/docs/content/docs/literals/float.md index de4edd0..11928df 100644 --- a/docs/content/docs/literals/float.md +++ b/docs/content/docs/literals/float.md @@ -4,6 +4,7 @@ menu: docs: parent: "literals" --- +# Float diff --git a/docs/content/docs/literals/hash.md b/docs/content/docs/literals/hash.md index 51ae1ac..012ba09 100644 --- a/docs/content/docs/literals/hash.md +++ b/docs/content/docs/literals/hash.md @@ -4,6 +4,7 @@ menu: docs: parent: "literals" --- +# Hash diff --git a/docs/content/docs/literals/integer.md b/docs/content/docs/literals/integer.md index 44cec06..ce3bd7d 100644 --- a/docs/content/docs/literals/integer.md +++ b/docs/content/docs/literals/integer.md @@ -4,6 +4,7 @@ menu: docs: parent: "literals" --- +# Integer An integer can be positiv or negative and is always internally represented by a 64-Bit Integer. diff --git a/docs/content/docs/literals/null.md b/docs/content/docs/literals/null.md index 7adc9a4..a6a5087 100644 --- a/docs/content/docs/literals/null.md +++ b/docs/content/docs/literals/null.md @@ -4,6 +4,7 @@ menu: docs: parent: "literals" --- +# Null diff --git a/docs/content/docs/literals/string.md b/docs/content/docs/literals/string.md index 58cf16a..5da2a1a 100644 --- a/docs/content/docs/literals/string.md +++ b/docs/content/docs/literals/string.md @@ -4,6 +4,7 @@ menu: docs: parent: "literals" --- +# String diff --git a/docs/content/docs/specification/builtins.md b/docs/content/docs/specification/builtins.md index 004fb87..834b782 100644 --- a/docs/content/docs/specification/builtins.md +++ b/docs/content/docs/specification/builtins.md @@ -5,7 +5,8 @@ menu: parent: "specification" toc: true --- -### exit(INTEGER) +# Builtin Functions +## exit(INTEGER) Terminates the program with the given exit code. @@ -14,7 +15,7 @@ Terminates the program with the given exit code. exit status 1 ``` -### raise(INTEGER, STRING) +## raise(INTEGER, STRING) Terminates the program with the given exit code and prints the error message. @@ -24,7 +25,7 @@ Terminates the program with the given exit code and prints the error message. exit status 1 ``` -### puts(STRING|ARRAY|HASH|BOOLEAN|INTEGER|NULL|FILE) +## puts(STRING|ARRAY|HASH|BOOLEAN|INTEGER|NULL|FILE) Prints the string representation of the given object to STDOUT. @@ -39,7 +40,7 @@ Prints the string representation of the given object to STDOUT. ["test", true, 3] ``` -### open(STRING, STRING, STRING) +## open(STRING, STRING, STRING) > Returns FILE Opens a file pointer to the file at the path of argument one with the mode of (optional) argument two and a file permission as optional argument three. diff --git a/docs/content/docs/specification/closures.md b/docs/content/docs/specification/closures.md index 60ceda4..3e4c6f3 100644 --- a/docs/content/docs/specification/closures.md +++ b/docs/content/docs/specification/closures.md @@ -5,6 +5,7 @@ menu: parent: "specification" toc: true --- +# Closures ```js newGreeter = def (greeting) { return def (name) { puts(greeting + " " + name); } diff --git a/docs/content/docs/specification/comments.md b/docs/content/docs/specification/comments.md index 0e3e7d9..5f3bbe4 100644 --- a/docs/content/docs/specification/comments.md +++ b/docs/content/docs/specification/comments.md @@ -5,6 +5,7 @@ menu: parent: "specification" toc: true --- +# Comments Comments start with `//` characters. All following content up to the end of the line is part of the comment. diff --git a/docs/content/docs/specification/functions.md b/docs/content/docs/specification/functions.md index 223081d..1f19fa1 100644 --- a/docs/content/docs/specification/functions.md +++ b/docs/content/docs/specification/functions.md @@ -1,10 +1,11 @@ --- -title: "Function" +title: "Functions" menu: docs: parent: "specification" toc: true --- +# Functions Implicit and explicit return statements are supported. ```js diff --git a/docs/content/docs/specification/local_variables.md b/docs/content/docs/specification/local_variables.md index 6fe044c..83e90a6 100644 --- a/docs/content/docs/specification/local_variables.md +++ b/docs/content/docs/specification/local_variables.md @@ -5,6 +5,7 @@ menu: parent: "specification" toc: true --- +# Local Variables Variables represent the object as a memorable name. ```js diff --git a/docs/content/docs/specification/modules.md b/docs/content/docs/specification/modules.md index 8f1be3c..65cef92 100644 --- a/docs/content/docs/specification/modules.md +++ b/docs/content/docs/specification/modules.md @@ -5,6 +5,7 @@ menu: parent: "specification" toc: true --- +# Modules > 👉 Modules were introduced in `0.11` Modules are seperate RocketLang files can be imported using the `import` statement. diff --git a/docs/templates/literal.md b/docs/templates/literal.md index 755f350..66694e3 100644 --- a/docs/templates/literal.md +++ b/docs/templates/literal.md @@ -4,6 +4,7 @@ menu: docs: parent: "literals" --- +# {{ .Title }} {{ .Description }}