Skip to content

Commit

Permalink
feat(articles): Add code highlighting for JSON, add LLVM language for…
Browse files Browse the repository at this point in the history
… highlighting MCFunction.
  • Loading branch information
Ayfri committed May 19, 2024
1 parent 192363a commit b40ad50
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
10 changes: 5 additions & 5 deletions src/jsMain/resources/markdown/articles/KoreHelloWorld.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Check [Kore Introduction](https://ayfri.com/articles/kore-introduction/) for mor
"pack_format": 41,
"description": "Hello World Datapack"
}
}
}
```

2. Create a folder named `data` inside the `hello_world` folder.
Expand All @@ -66,7 +66,7 @@ Check [Kore Introduction](https://ayfri.com/articles/kore-introduction/) for mor
1. Inside the `data` folder, create a new folder named `hello_world`.
2. Inside the `hello_world` folder, create a folder named `functions`.
3. Inside the `functions` folder, create a file named `load.mcfunction` with the following content:
```mcfunction
```llvm
tellraw @a {"text":"Hello World","color":"green"}
```
Expand Down Expand Up @@ -135,9 +135,9 @@ Check [Kore Introduction](https://ayfri.com/articles/kore-introduction/) for mor

Kore will generate the necessary files for your datapack based on the code you provide. The `load` function will create a function with a
random name and add the `tellraw` command to it. So you don't need to worry about naming the function or creating the function file, this
simplifies the process for beginners.
The `pack` function will create the `pack.mcmeta` file with the specified description and format. The `dataPack` function will create the
necessary folders and files for the datapack. The `generateZip` function will generate a zip file containing the datapack files.
simplifies the process for beginners. The `pack` function will create the `pack.mcmeta` file with the specified description and format.
The `dataPack` function will create the necessary folders and files for the datapack. The `generateZip` function will generate a zip file
containing the datapack files.

## Conclusion

Expand Down
60 changes: 30 additions & 30 deletions src/jsMain/resources/markdown/articles/KoreTimer.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ Check [Kore Introduction](https://ayfri.com/articles/kore-introduction/) for mor
2. **Create the `pack.mcmeta` File:**
- Inside the `timer_datapack` folder, create a file named `pack.mcmeta`.
- Add the following JSON content to the file:
```json
{
"pack": {
"pack_format": 41,
"description": "A simple timer datapack"
}
}
```
```json
{
"pack": {
"pack_format": 41,
"description": "A simple timer datapack"
}
}
```

### Step 2: Adding the Timer Functionality

Expand All @@ -58,43 +58,43 @@ Check [Kore Introduction](https://ayfri.com/articles/kore-introduction/) for mor
2. **Create the `tick.mcfunction` File:**
- Inside the `functions` folder, create a file named `tick.mcfunction`.
- Add the following commands to the file:
```
scoreboard players add @a timer 1
execute as @a[scores={timer=400..}] run say 20 seconds have passed!
execute as @a[scores={timer=400..}] run scoreboard players set @a[scores={timer=400..}] timer 0
```
```llvm
scoreboard players add @a timer 1
execute as @a[scores={timer=400..}] run say 20 seconds have passed!
execute as @a[scores={timer=400..}] run scoreboard players set @a[scores={timer=400..}] timer 0
```

3. **Create the `load.mcfunction` File:**
- Inside the `functions` folder, create a file named `load.mcfunction`.
- Add the following commands to the file:
```
scoreboard objectives add timer dummy
```
```llvm
scoreboard objectives add timer dummy
```

4. **Create the `tick.json` File:**
- Inside the `data` folder, create a folder named `minecraft`.
- Inside the `minecraft` folder, create a folder named `tags`.
- Inside the `tags` folder, create a folder named `functions`.
- Inside the `functions` folder, create a file named `tick.json`.
- Add the following JSON content to the file:
```json
{
"values": [
"timer:tick"
]
}
```
```json
{
"values": [
"timer:tick"
]
}
```

5. **Create the `load.json` File:**
- Inside the `functions` folder, create a file named `load.json`.
- Add the following JSON content to the file:
```json
{
"values": [
"timer:load"
]
}
```
```json
{
"values": [
"timer:load"
]
}
```

### Step 3: Loading the Datapack

Expand Down
4 changes: 2 additions & 2 deletions src/jsMain/resources/public/prism.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b40ad50

Please sign in to comment.