-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from Flipez/refactor-documentation-generator
Co-authored-by: Flipez <[email protected]> Refactor documentation generator
- Loading branch information
Showing
72 changed files
with
1,859 additions
and
1,594 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
functions: | ||
new: | ||
description: "Creates a new instance of HTTP" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
functions: | ||
open: | ||
description: "Opens a file pointer to the file at the path, mode and permission can be set optionally." | ||
input: | | ||
IO.open("main.go", "r", "0644") | ||
output: | | ||
<file:main.go> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
functions: | ||
parse: | ||
description: "Takes a STRING and parses it to a HASH or ARRAY. Numbers are always FLOAT." | ||
input: | | ||
JSON.parse('{"test": 123}') | ||
JSON.parse('["test", 123]') | ||
output: | | ||
{"test": 123.0} | ||
["test", 123.0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
functions: | ||
abs: | ||
description: "" | ||
acos: | ||
description: "Returns the arccosine, in radians, of the argument" | ||
input: | | ||
Math.acos(1.0) | ||
output: | | ||
0.0 | ||
asin: | ||
description: "Returns the arcsine, in radians, of the argument" | ||
input: | | ||
Math.asin(0.0) | ||
output: | | ||
0.0 | ||
atan: | ||
description: "Returns the arctangent, in radians, of the argument" | ||
input: | | ||
Math.atan(0.0) | ||
output: | | ||
0.0 | ||
ceil: | ||
description: "Returns the least integer value greater or equal to the argument" | ||
input: | | ||
Math.ceil(1.49) | ||
output: | | ||
2.0 | ||
copysign: | ||
description: "Returns a value with the magnitude of first argument and sign of second argument" | ||
input: | | ||
Math.copysign(3.2, -1.0) | ||
output: | | ||
-3.2 | ||
cos: | ||
description: "Returns the cosine of the radion argument" | ||
input: | | ||
Math.cos(Pi/2) | ||
output: | | ||
0.0 | ||
exp: | ||
description: "Returns e**argument, the base-e exponential of argument" | ||
input: | | ||
Math.exp(1.0) | ||
output: | | ||
2.72 | ||
floor: | ||
description: "Returns the greatest integer value less than or equal to argument" | ||
input: | | ||
Math.floor(1.51) | ||
output: | | ||
1.0 | ||
log: | ||
description: "Returns the natural logarithm of argument" | ||
input: | | ||
Math.log(2.7183) | ||
output: | | ||
1.0 | ||
log10: | ||
description: "Returns the decimal logarithm of argument" | ||
input: | | ||
Math.log(100.0) | ||
output: | | ||
2.0 | ||
log2: | ||
description: "Returns the binary logarithm of argument" | ||
input: | | ||
Math.log2(256.0) | ||
output: | | ||
8.0 | ||
max: | ||
description: "Returns the larger of the two numbers" | ||
input: | | ||
Math.max(5.0, 10.0) | ||
output: | | ||
10.0 | ||
min: | ||
description: "Returns the smaller of the two numbers" | ||
input: | | ||
Math.min(5.0, 10.0) | ||
output: | | ||
5.0 | ||
pow: | ||
description: "Returns argument1**argument2, the base-argument1 exponential of argument2" | ||
input: | | ||
Math.pow(2.0, 3.0) | ||
output: | | ||
8.0 | ||
rand: | ||
description: "Returns a pseudo-random number in the half-open interval [0.0, 1.0]." | ||
input: | | ||
Math.rand() | ||
output: | | ||
0.6046602879796196 | ||
remainder: | ||
description: "Returns the IEEE 754 floating-point remainder of argument1/argument2" | ||
input: | | ||
Math.remainder(100.0, 30.0) | ||
output: | | ||
10.0 | ||
round: | ||
description: "Returns the nearest integer, rounding half away from zero" | ||
input: | | ||
Math.round(73.3) | ||
output: | | ||
73.0 | ||
sin: | ||
description: "Returns the sine of the radion argument" | ||
input: | | ||
Math.sin(Pi) | ||
output: | | ||
0.0 | ||
sqrt: | ||
description: "Returns the square root of argument" | ||
input: | | ||
Math.sqrt(3.0 * 3.0 + 4.0 * 4.0) | ||
output: | | ||
5.0 | ||
tan: | ||
description: "Returns the tangent of the radion argument" | ||
input: | | ||
Math.tan(0.0) | ||
output: | | ||
0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
functions: | ||
exit: | ||
description: "Terminates the program with the given exit code." | ||
input: | | ||
OS.exit(1) | ||
output: | | ||
exit status 1 | ||
raise: | ||
description: "Terminates the program with the given exit code and prints the error message." | ||
input: | | ||
OS.raise(1, "broken") | ||
output: | | ||
🔥 RocketLang raised an error: "broken" | ||
exit status 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
functions: | ||
format: | ||
description: | | ||
Formats the given unix timestamp with the given layout | ||
[Go date and time formats](https://gosamples.dev/date-time-format-cheatsheet/) are natively supported. | ||
You can also use some but not all [formats present in many other languages](https://apidock.com/ruby/Time/strftime) which are not fully supported. | ||
Take a look at [the source](https://github.com/Flipez/rocket-lang/blob/main/stdlib/time.go) to see which formatters are supported. | ||
input: | | ||
Time.format(Time.unix(), "Mon Jan _2 15:04:05 2006") | ||
Time.format(Time.unix(), "%a %b %e %H:%M:%S %Y") | ||
output: | | ||
"Mon Oct 31 00:08:10 2022" | ||
"Mon Oct 31 00:28:43 2022" | ||
parse: | ||
description: | | ||
Parses a given string with the given format to a unix timestamp. | ||
[Go date and time formats](https://gosamples.dev/date-time-format-cheatsheet/) are natively supported. | ||
You can also use some but not all [formats present in many other languages](https://apidock.com/ruby/Time/strftime) which are not fully supported. | ||
Take a look at [the source](https://github.com/Flipez/rocket-lang/blob/main/stdlib/time.go) to see which formatters are supported. | ||
input: | | ||
Time.parse("2022-03-23", "2006-01-02") | ||
Time.parse("2022-03-23", "%Y-%m-%d") | ||
output: | | ||
1647993600 | ||
1647993600 | ||
sleep: | ||
description: "Stops the RocketLang routine for at least the stated duration in seconds" | ||
input: | | ||
Time.sleep(2) | ||
unix: | ||
description: "Returns the current time as unix timestamp" | ||
input: | | ||
Time.unix() | ||
output: | | ||
1668788502 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import CodeBlock from '@theme/CodeBlock'; | ||
|
||
class CodeBlockSimple extends React.Component { | ||
constructor(props){ | ||
super(props); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div | ||
style={{ | ||
backgroundColor: '#303846', | ||
borderRadius: 5, | ||
}}> | ||
<CodeBlock language="js" showLineNumbers> | ||
{this.props.input} | ||
</CodeBlock> | ||
{ this.props.output ? ( | ||
<CodeBlock language="js" title='Output'> | ||
{this.props.output} | ||
</CodeBlock>) : ("") } | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default CodeBlockSimple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
e580bee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
rocket-lang-play – ./wasm
rocket-lang-play-flipez.vercel.app
rocket-lang-play.vercel.app
rocket-lang-play-git-main-flipez.vercel.app
play.rocket-lang.org
e580bee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
rocket-lang – ./docs
rocket-lang.org
www.rocket-lang.org
rocket-lang.vercel.app
rocket-lang-git-main-flipez.vercel.app
rocket-lang-flipez.vercel.app