Starting fiddling with the docs site proper

This commit is contained in:
2024-12-27 13:40:49 +11:00
parent 2c4324db70
commit dc8845fd0e
20 changed files with 101 additions and 171 deletions

1
CNAME Normal file
View File

@@ -0,0 +1 @@
toylang.com

View File

@@ -1,6 +1,4 @@
This git branch is the documentation for The Toy Programming Language version 2.x, which can be found at [https://github.com/Ratstail91/Toy](https://github.com/Ratstail91/Toy).
This git branch is the documentation website for The Toy Programming Language version 2.x, which can be found at [https://github.com/Ratstail91/Toy](https://github.com/Ratstail91/Toy).
Toy v2.x is still under active development, so this documentation will change and evolve over time, and may not reflect the current reference implementation.
The docs can be found [here](docs/index.md).

BIN
android-chrome-192x192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
android-chrome-384x384.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
apple-touch-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

9
browserconfig.xml Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>

View File

@@ -1,12 +0,0 @@
# Introduction
[![Continuous Integration v2.x](https://github.com/Ratstail91/Toy/actions/workflows/continuous-integration-v2.yml/badge.svg)](https://github.com/Ratstail91/Toy/actions/workflows/continuous-integration-v2.yml)
The Toy Programming Language is an imperative, bytecode-interpreted, embeddable scripting language. Rather than functioning independently, it serves as part of another program, the "host". This design allows for straightforward customization by both the host's developers and end users, achieved by exposing program logic through text files.
The reference implementation can be found on [GitHub](https://github.com/Ratstail91/Toy).
[Reserved Words](reserved-words.md)
[Operators](operators.md)
[Types](types.md)

View File

@@ -1,41 +0,0 @@
# Operators
The following table lists the recognized operators, and their uses.
| Symbol | Description |
| --- | --- |
| `+` | Add. |
| `-` | Subtract. |
| `*` | Multiply. |
| `/` | Divide. |
| `%` | Modulo. |
| `=` | Assign. |
| `+=` | Add Assign. |
| `-=` | Subtract Assign. |
| `*=` | Multiply Assign. |
| `/=` | Divide Assign. |
| `%=` | Modulo Assign. |
| `++` | Increment. Not yet implemented. |
| `--` | Decrement. Not yet implemented. |
| `==` | Compare Equal. |
| `!=` | Compare Not Equal. |
| `<` | Compare Less. |
| `<=` | Compare Less Equal. |
| `>` | Compare Greater. |
| `>=` | Compare Greater Equal. |
| `(` `)` | Parenthesis. |
| `[` `]` | Brackets. |
| `{` `}` | Braces. |
| `&&` | And. |
| `\|\|` | Or. |
| `!` | Not. |
| `?` `:` | Ternary. |
| `?` | Question. Not used. |
| `:` | Colon. |
| `.` | Dot. Not yet implemented. |
| `..` | Concatenate. |
| `...` | Rest. Not yet implemented. |
| `&` | Ampersand. Not used. |
| `\|` | Pipe. Not used. |

20
docs/quick-start.md Normal file
View File

@@ -0,0 +1,20 @@
# Toy v2 Quick Start Guide
To help you start using Toy as fast as possible, here are the core elements of the language. Not everything available is listed, but this should give you a good starting point.
## Keyword 'print'
Firstly, the `print` keyword is used to output data to
## Keyword 'assert'
## Variables and Types
## Control Flow
## Functions
## External Libraries and Extending Toy
## Reserved Keywords & Operators

View File

@@ -1,44 +0,0 @@
# Reserved Words
The following list of words have special meaning to the language, so they can't be used as names for variables or functions.
```txt
any
array
as
assert
bool
break
class
const
continue
do
else
export
false
float
fn
function
for
foreach
function
if
import
in
int
null
of
opaque
print
return
string
table
true
type
typeas
typeof
var
while
yield
```

View File

@@ -1,71 +0,0 @@
# Types
When a variable name is declared, you may specify what kind of value can be stored within - this is known as its "type". If you attempt to store a value of a different type, an error will be raised.
```toy
//syntax
var name: type = value;
//example
var answer: int = 42;
```
Specifying a type is optional, in which case, the type is set to `any` by default ([see below](#any)).
```toy
//omit the type and set an integer value
var answer = 42;
print typeof answer; // will print "any"
```
You may access the type of a variable using the `typeof` keyword. Types can also act as values - the type of any type is `type`.
# null
The type `null` is a special case in the language, as it represents the absence of any meaningful value. It can't be specified as a variable's type, only as it's value.
Unlike the other types, the type of `null` is `null`.
# bool
The `bool` type can hold two meaningful values, either `true` or `false`.
# int
The `int` type can hold any whole number between `-2,147,483,648` and`2,147,483,647`, due to being stored as a signed 32-bit integer.
# float
The `float` type can hold a single-precision floating-point value as defined by IEEE 754, which is the most commonly used method for storing real numbers in 32 bits.
What this means in practice is that floating point errors are possible, but this is still the best option for managing decimal numbers.
# string
TODO
# array
TODO
# table
TODO
# function
TODO
# opaque
TODO
# type
TODO
# any
TODO

BIN
favicon-16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
favicon-32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

35
index.html Normal file
View File

@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<!-- device settings -->
<meta charset = "UTF-8" />
<meta name="Content-Type" content="text/html" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- page title -->
<title>The Toy Programming Language</title>
<!-- page information -->
<meta name="description" content="The Toy Programming Language" />
<meta name="author" content="Kayne Ruse" />
<meta name="keywords" content=""programming, coding" />
<!-- facebook -->
<meta property="og:url" content="toylang.com" />
<meta property="og:type" content="website" />
<meta property="og:image" content="repo-preview.png" />
<meta property="og:title" content="The Toy Programming Language" />
<meta property="og:description" content="The Toy Programming Language" />
<!-- twitter -->
<meta name="twitter:card" content="The Toy Programming Language" />
<meta name="twitter:url" content="toylang.com" />
<meta name="twitter:type" content="website" />
<meta name="twitter:image" content="repo-preview.png" />
<meta name="twitter:title" content="The Toy Programming Language" />
<meta name="twitter:description" content="The Toy Programming Language" />
</head>
<body>
<p>There's nobody here but us chickens!</p>
</body>
</html>

BIN
mstile-150x150.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
repo-preview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 KiB

16
safari-pinned-tab.svg Normal file
View File

@@ -0,0 +1,16 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="454.000000pt" height="454.000000pt" viewBox="0 0 454.000000 454.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.14, written by Peter Selinger 2001-2017
</metadata>
<g transform="translate(0.000000,454.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M1178 4533 c-3 -5 -4 -508 -3 -1118 l0 -1111 -565 0 -565 0 -3 -1152
-2 -1152 2230 0 2230 0 -2 1152 -3 1152 -522 0 c-359 0 -523 3 -524 10 0 6 0
509 0 1119 l-1 1107 -1133 0 c-624 0 -1135 -3 -1137 -7z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 730 B

19
site.webmanifest Normal file
View File

@@ -0,0 +1,19 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-384x384.png",
"sizes": "384x384",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}

BIN
toylogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB