add github page and small corrections
This commit is contained in:
parent
3af5da0ba2
commit
b8b1a4abe8
|
@ -16,7 +16,7 @@ export default defineConfig({
|
|||
favicon: '/favicon.ico',
|
||||
description: 'A simple and powerful scripting language for Minecraft datapacks.',
|
||||
social: {
|
||||
github: 'https://github.com/moritz-hoelting/shulkerscript-cli',
|
||||
email: 'mailto:shulkerscript@hoelting.dev',
|
||||
},
|
||||
tableOfContents: { minHeadingLevel: 1, maxHeadingLevel: 3 },
|
||||
defaultLocale: 'root',
|
||||
|
@ -40,6 +40,9 @@ export default defineConfig({
|
|||
expressiveCode: {
|
||||
shiki: shikiConfig,
|
||||
},
|
||||
components: {
|
||||
SocialIcons: './src/components/override/SocialIcons.astro',
|
||||
},
|
||||
sidebar: [
|
||||
{
|
||||
label: 'Guides',
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
import type { Props } from "@astrojs/starlight/props";
|
||||
import Default from "@astrojs/starlight/components/SocialIcons.astro";
|
||||
import { Icon } from "@astrojs/starlight/components";
|
||||
|
||||
const localePrefix = Astro.currentLocale === "en" ? "" : `/${Astro.currentLocale}`;
|
||||
---
|
||||
|
||||
<>
|
||||
<Default {...Astro.props} />
|
||||
<a href={`${localePrefix}/github`} rel="me" class="sl-flex">
|
||||
<span class="sr-only">GitHub</span>
|
||||
<Icon name="github" />
|
||||
</a>
|
||||
</>
|
||||
|
||||
<style>
|
||||
a {
|
||||
color: var(--sl-color-text-accent);
|
||||
padding: 0.5em;
|
||||
margin: -0.5em;
|
||||
}
|
||||
a:hover {
|
||||
opacity: 0.66;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,53 @@
|
|||
---
|
||||
title: GitHub
|
||||
description: View and contribute to the source code of ShulkerScript on GitHub.
|
||||
---
|
||||
|
||||
import { CardGrid, LinkCard, Aside } from "@astrojs/starlight/components";
|
||||
|
||||
The source code of this project is hosted on GitHub. You can view and contribute to the project by visiting the repositories.
|
||||
|
||||
## Organization
|
||||
|
||||
The project is split into multiple repositories:
|
||||
|
||||
<LinkCard
|
||||
title="shulkerscript-cli"
|
||||
href="https://github.com/moritz-hoelting/shulkerscript-cli"
|
||||
target="_blank"
|
||||
description="This is the program you can download and use to compile the <code>.shu</code> files.
|
||||
It is a wrapper for the library and depends on the other two repositories to do the actual work."
|
||||
/>
|
||||
<LinkCard
|
||||
title="shulkerscript-lang"
|
||||
href="https://github.com/moritz-hoelting/shulkerscript-lang"
|
||||
target="_blank"
|
||||
description="Library for parsing the syntax and transpiling to an intermediate representation.
|
||||
Can be used in other rust programs to embed the language."
|
||||
/>
|
||||
<LinkCard
|
||||
title="shulkerbox"
|
||||
href="https://github.com/moritz-hoelting/shulkerbox"
|
||||
target="_blank"
|
||||
description="Library for compiling the intermediate representation to a datapack that can be read by Minecraft.
|
||||
Also, provides an interface for constructing datapacks programatically in rust."
|
||||
/>
|
||||
|
||||
<Aside type="note" title="Keep in mind">
|
||||
Please raise issues in the respective repositories if it is related to a specific part of the project.
|
||||
If you are unsure where to raise an issue, you can get help by contacting us via the email on the top right.
|
||||
</Aside>
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
First off, thanks for taking the time to contribute! ❤️
|
||||
|
||||
All types of contributions are encouraged and valued. The community looks forward to your contributions. 🎉
|
||||
|
||||
<Aside type="tip" title="Other ways to support this project...">
|
||||
And if you like the project, but just don't have the time or knowledge to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
|
||||
- Star the project
|
||||
- Refer this project in your project's readme
|
||||
- Mention the project at local meetups and tell your friends/colleagues
|
||||
</Aside>
|
|
@ -1,10 +1,6 @@
|
|||
---
|
||||
title: Syntax
|
||||
description: Learn the syntax of ShulkerScript
|
||||
sidebar:
|
||||
badge:
|
||||
text: WIP
|
||||
variant: caution
|
||||
---
|
||||
|
||||
## Comments
|
||||
|
@ -158,6 +154,8 @@ if ("block ~ ~-1 ~ minecraft:stone") {
|
|||
}
|
||||
```
|
||||
|
||||
To learn more about how to combine or negate conditions, refer to the [if-else statement reference](/reference/conditionals).
|
||||
|
||||
## Execute Blocks
|
||||
Execute blocks are used to execute a block of code in a specific context.
|
||||
They consist of the keyword you would pass to the `/execute` command followed the argument as a string in parenthesis and a block of code.
|
||||
|
@ -190,6 +188,7 @@ positioned ("0 0 0"), in ("minecraft:overworld") {
|
|||
- `at`
|
||||
- `asat`
|
||||
- `facing`
|
||||
- [`if`](#conditional-statements)
|
||||
- `in`
|
||||
- `on`
|
||||
- `positioned`
|
||||
|
@ -197,6 +196,12 @@ positioned ("0 0 0"), in ("minecraft:overworld") {
|
|||
- `store`
|
||||
- `summon`
|
||||
|
||||
:::note
|
||||
When using the summon execute block with multiple commands in it, only one entity will be summoned and all commands will be executed on that entity. If you want to summon multiple entities, you have to use multiple summon execute blocks.
|
||||
:::
|
||||
|
||||
For general information on the execute command, refer to the [Minecraft Wiki](https://minecraft.wiki/w/Commands/execute).
|
||||
|
||||
## Groupings
|
||||
Groupings are used to group multiple commands into one `mcfunction` file without declaring a new function.
|
||||
This can be used for commands that need to be executed atomically.
|
||||
|
|
|
@ -21,6 +21,10 @@ if ("block ~ ~-1 ~ minecraft:grass_block") {
|
|||
}
|
||||
```
|
||||
|
||||
:::note
|
||||
Conditional statements are implemented to work atomically. This means that only the if or the else block will be executed, not both and only once, regardless of more than one condition being true. If either one is chosen, all commands in this block are run, even when a command before changes the state so the condition would be false. More about this can be found [here](/differences#interfering-with-conditions).
|
||||
:::
|
||||
|
||||
## Logical Operators
|
||||
|
||||
Logical operators can be used to combine multiple conditions. The following logical operators are supported:
|
||||
|
|
|
@ -20,3 +20,18 @@ run lua() {
|
|||
return "Hello, Lua!";
|
||||
};
|
||||
```
|
||||
|
||||
## Globals
|
||||
The following globals are available in the Lua environment:
|
||||
- `shu_location`: The relative filepath of the script being executed
|
||||
|
||||
After variables are introduced in ShulkerScript, it is planned to make them available in the Lua environment as well.
|
||||
|
||||
:::note
|
||||
If you can think of any other globals that should be available in the Lua environment, please let us know! This could include:
|
||||
- variables with values (like `shu_location`)
|
||||
- functions that calculate/modify values (general utility things not provided by Lua or specific to ShulkerScript)
|
||||
- functions that interact with the ShulkerScript environment (flags to set for the compiler to alter the build process)
|
||||
|
||||
Please either write a mail or open an issue on GitHub. The links can be found in the upper right corner of the page.
|
||||
:::
|
Loading…
Reference in New Issue