Skip to content

Commit

Permalink
update to footer,docs layout
Browse files Browse the repository at this point in the history
  • Loading branch information
JaDogg committed Dec 22, 2023
1 parent 7da1f5d commit 79f12ad
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 67 deletions.
2 changes: 1 addition & 1 deletion src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<img src="/imgs/yaksha_logo.png" class="w-24 mt-8" />
<div>
<p class="font-bold">Yaksha - The Programming Language</p>
<p>&#169 2023 YakshaLang</p>
<p>&#169 2023 Bhathiya Perera</p>
<p>Website designed by <a class="link text-blue-500" href="https://abandontech.cloud" target="_blank" rel="noreferrer">AbandonTech</a></p>
</div>
</aside>
Expand Down
44 changes: 23 additions & 21 deletions src/layouts/DocsLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,32 @@ const headingsByDepth = headings.reduce((acc, heading) => {

<Layout title="Yaksha | Docs">

<div class="flex bg-base-300">
<div class="w-fit bg-base-200 md:w-96">
<ul class="sticky top-20 menu">
{headingsByDepth.map(h =>
<li>
{h.children.length > 0 &&
<details open>
<summary class="hover:text-primary"><a href={`#${h.slug}`}>{h.text}</a></summary>
<ul>
{h.children.map(child =>
<li class="hover:text-primary"><a href={`#${child.slug}`}>{child.text}</a></li>
)}
</ul>
</details>
}
{h.children.length == 0 &&
<summary class="hover:text-primary"><a href={`#${h.slug}`}>{h.text}</a></summary>
}
</li>)}
<div class="flex bg-base-300 w-full">
<div class="hidden md:block bg-base-200 md:w-96">
<ul class="sticky max-h-screen flex-nowrap top-24 menu">
<div class="max-h-full overflow-y-auto mb-24">
{headingsByDepth.map(h =>
<li>
{h.children.length > 0 &&
<details open>
<summary class="hover:text-primary"><a href={`#${h.slug}`}>{h.text}</a></summary>
<ul>
{h.children.map(child =>
<li class="hover:text-primary"><a href={`#${child.slug}`}>{child.text}</a></li>
)}
</ul>
</details>
}
{h.children.length == 0 &&
<summary class="hover:text-primary"><a href={`#${h.slug}`}>{h.text}</a></summary>
}
</li>)}
</div>
</ul>
</div>

<div class="relative mx-auto prose py-8 px-8 max-w-fit md:max-w-6xl dark:prose-invert prose-headings:scroll-mt-36 md:prose-headings:scroll-mt-96">
<slot/>
<div class="mx-auto prose prose-sm md:prose-base py-4 md:py-8 px-4 md:px-8 md:max-w-6xl dark:prose-invert prose-headings:scroll-mt-36 md:prose-headings:scroll-mt-96">
<slot />
</div>
</div>

Expand Down
57 changes: 19 additions & 38 deletions src/pages/docs/0001-features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ my_sr = "Hello World"
another_sr: sr = "Hello World"
```

---

<Status status="done">
### String literals
Expand All @@ -46,8 +45,6 @@ If you `+` two string literals that will be done at compile time.

String literals are automatically converted to `sr` or `str`.

---

<Status status="done">
### (Semi)Managed Strings
</Status>
Expand All @@ -74,7 +71,6 @@ a: str = "hello world"
println(a)
```

---

<Status status="done">
### Standard integers
Expand All @@ -91,7 +87,6 @@ print("Four =")
println(a)
```

---

<Status status="in-progress">
### Integer types
Expand All @@ -116,7 +111,6 @@ i: u32 = 4u32 # datatype ✅ | literal ✅
j: u64 = 5u64 # datatype ✅ | literal ✅
```

---

<Status status="done">
### Float types
Expand All @@ -133,7 +127,6 @@ b: f64 = 2.0 # datatype ✅ | literal ✅
c: float = 3.0f # datatype ✅ | literal ✅
```

---

## Syntax features

Expand All @@ -154,7 +147,6 @@ def main() -> int:
return 0
```

---

<Status status="done">
### Basic Functions
Expand All @@ -169,7 +161,6 @@ def main() -> int:
return 0
```

---

<Status status="done">
### Exposing C functions
Expand All @@ -179,7 +170,6 @@ def main() -> int:
* 💀 `@nativexxx` functions cannot call each other or normal functions.


---

#### @native - native functions
```yaksha
Expand All @@ -204,8 +194,6 @@ yk__sds yy__get_global_arg(int32_t nn__n)
```
</details>
---
### @nativemacro - macros with arguments
```yaksha
Expand All @@ -226,7 +214,6 @@ def max_int(a: int, b:int) -> int:
```
</details>
---
### @nativedefine - simple #define
Expand All @@ -242,7 +229,6 @@ def banana(a: int, b: int, c:int) -> int:
```
</details>
---
### @varargs - variable argument functions
Expand All @@ -263,8 +249,6 @@ def new(count: int, s: str) -> Array[str]:
```
</details>

---

<Status status="not-started">
### Template functions
</Status>
Expand All @@ -291,7 +275,6 @@ def hmget(a: HashMap[K,V], key: K) -> V:
pass
```

---

<Status status="not-started">
### GPU/OpenCL device functions
Expand All @@ -304,7 +287,6 @@ def calculate(n: int) -> int:
return 1 + 1
```

---

<Status status="done">
### Defer statement
Expand Down Expand Up @@ -339,7 +321,7 @@ Hello World
All done
```

---


<Status status="in-progress">
### Del statement
Expand All @@ -360,7 +342,6 @@ def main() -> int:
```
<Note mode="icon">Compiles to `free` or other runtime functions.</Note>

---

<Status status="in-progress">
### Class statement
Expand All @@ -382,7 +363,7 @@ class Teacher:
address: str
```

---


#### Creating and freeing objects

Expand Down Expand Up @@ -421,7 +402,7 @@ def main() -> int:
return 0
```

---


#### Exposing native structures

Expand All @@ -446,7 +427,7 @@ class Color:
```
</details>
---
<Status status="in-progress">
### Import statement
Expand All @@ -471,7 +452,7 @@ def main() -> int:

<Note mode="icon">Name mangling takes place for this.</Note>

---


<Status status="done">
### While loop
Expand All @@ -488,7 +469,7 @@ def main() -> int:
return 0
```
---
<Status status="done">
### Foreach loop
Expand All @@ -510,7 +491,7 @@ def main() -> int:
return 0
```

---


<Status status="done">
### Endless for loop
Expand All @@ -529,7 +510,7 @@ def main() -> int:
return 0
```

---


<Status status="done">
### C-For loop
Expand Down Expand Up @@ -564,7 +545,7 @@ def main() -> int:
* This is why `add` function does not have a return statement.
</Note>

---


<Status status="in-progress">
## Builtin Functions
Expand Down Expand Up @@ -603,12 +584,12 @@ def main() -> int:

<Note mode="icon">Builtin functions may call different implementations based on input.</Note>

---


## Non primitive data types
This section describes other essential types of builtin structures.

---


<Status status="in-progress">
### Dynamic Arrays
Expand All @@ -628,7 +609,7 @@ def main() -> int:

<Note mode="icon">Must ensure array elements are freed. `int` need not be deleted as they are primitive types.</Note>

---


<Status status="in-progress">
### String Hash Map
Expand All @@ -653,7 +634,7 @@ def main() -> int:
* `len` will give the total number of elements of the String Hash Map.
</Note>

---


<Status status="in-progress">
### Hash Map
Expand All @@ -666,7 +647,7 @@ Simple single key single value hashmaps.
* key and value both need to be deleted.
</Note>

---


<Status status="in-progress">
## Macros & YakshaLisp
Expand All @@ -682,15 +663,15 @@ It has it's own built in functions, can use `import`, read/write files and even
* So you can meta-program while you meta-program.
</Note>

---


### Philosophy?
YakshaLisp provide the ability to write token-list to token-list conversion macros. One can use `my_macro!{t t t}` style expansion to achieve this. So why YakshaLisp? because it needs to process a list of tokens.
Additionally, Yaksha and YakshaLisp are polar opposites of each other, therefore I think they can compliment each other nicely.

<Note mode="icon">Think Yin-Yang!</Note>

---


#### What are the differences?

Expand Down Expand Up @@ -757,7 +738,7 @@ Additionally, Yaksha and YakshaLisp are polar opposites of each other, therefore
</tbody>
</table>

---


<Status status="done">
### Builtin functions, values & prelude
Expand Down Expand Up @@ -795,7 +776,7 @@ All below listed functions are available at the moment.
* `random` - random number between given range
* `time` - unix time as number

---


### Macro environments

Expand All @@ -807,7 +788,7 @@ During garbage collection, mark phase will start marking from `builtins_root` an

Environment is an unordered_map with string keys. Environments and maps use same data type internally.

---


### How does it look like

Expand Down
8 changes: 4 additions & 4 deletions src/pages/docs/0002-runtime-library.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Yaksha programming language preserves anything that starts with `yk__` or `YK__`

<Note mode="icon">This avoids collisions with C standard library functions or keywords.</Note>

---


## Standard Library Components

Expand All @@ -30,7 +30,7 @@ Small core library with useful features.
import libs
```

---


<Status status="in-progress">
### UI Library
Expand All @@ -42,7 +42,7 @@ Use raygui with raylib.
import raylib.gui
```

---


<Status status="in-progress">
### Raylib - Graphics/Game/Audio Library
Expand All @@ -54,7 +54,7 @@ Use raylib to build games and such
import raylib
```

---


<Status status="not-started">
### CL Library
Expand Down
Loading

0 comments on commit 79f12ad

Please sign in to comment.