Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
✨ Improve code blocks, update admonitions
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixr-codes committed Oct 15, 2023
1 parent 33a2ced commit ab4afd3
Show file tree
Hide file tree
Showing 15 changed files with 123 additions and 142 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
theme/* linguist-vendored
scripts/* linguist-vendored
*.md linguist-detectable
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ You can install them all at once by running the appropiate installer script in
the `install` with your shell:

```console
sh ./install
```

```powershell
powershell .\install
```

```console
nu ./install
./install
```

5 changes: 3 additions & 2 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ src = "src"

[preprocessor.admonish]
command = "mdbook-admonish"
assets_version = "2.0.1" # do not edit: managed by `mdbook-admonish install`
assets_version = "3.0.0" # do not edit: managed by `mdbook-admonish install`

[preprocessor.toc]
command = "mdbook-toc"
Expand All @@ -17,7 +17,8 @@ renderer = ["html"]
[preprocessor.webinclude]

[output.html]
additional-css = ["./theme/mdbook-admonish.css"]
additional-css = ["./theme/mdbook-admonish.css", "./theme/mdbook-admonish.css", "./theme/codeblockplus.css"]
additional-js = ["./scripts/codeblockplus.js"]
curly-quotes = true
default-theme = "coal"
preferred-dark-theme = "coal"
Expand Down
6 changes: 5 additions & 1 deletion install
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env sh

cargo install --force --version 0.4.35 mdbook
cargo install --force --version 1.12.1 mdbook-admonish
cargo install --force --version 1.13.0 mdbook-admonish
cargo install --force --version 0.14.1 mdbook-toc
cargo install --force --version 0.1.0 mdbook-webinclude
echo $(curl -sS https://raw.githubusercontent.com/phoenixr-codes/mdbook-code-block-plus/master/codeblockplus.css) > theme/codeblockplus.css
echo $(curl -sS https://raw.githubusercontent.com/phoenixr-codes/mdbook-code-block-plus/master/codeblockplus.min.js) > scripts/codeblockplus.js
1 change: 1 addition & 0 deletions scripts/codeblockplus.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ control and generation.
allay add templating
```

```erb
```erb,lang=mcfunction
<%# using erb %>
<% 10.times do |i| %>
scoreboard objectives add position<%= i %>
<% end %>
```

```toml
```toml,icon=gear,filepath=allay.toml
[scripts]
base-path = "scripts"
pre = [
Expand Down
9 changes: 3 additions & 6 deletions src/dev/scripts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ Most programming languages a capable of reading arguments provided in the
command-line. Rust uses these method to allow users to provide options
specific to a script in the configuration file.

```python
# FILE: helloworld.py
```python,filepath=scripts/helloworld.py
from argparse import ArgumentParser

parser = ArgumentParser()
Expand All @@ -25,7 +24,7 @@ One can then provide arguments in their configuration file like this:

```toml
[scripts]
# ...
base-path = "scripts"
pre = [
{ run = "helloworld.py", with = "python", args = ["John Doe", "42"] }
]
Expand All @@ -51,9 +50,7 @@ Another less recommended approach is the usage of the
file. It is designed to be used by external programs but parsing TOML is less
supported than parsing command-line arguments in many programming languages.

```python
# FILE: helloworld.py

```python,filepath=scripts/helloworld.py
import os
from pathlib import Path
import tomllib
Expand Down
26 changes: 11 additions & 15 deletions src/example-project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,17 @@ a behavior pack as well as an resource pack.

## Step 1: Initialize the project

> **Bash**
>
> ```bash
> mkdir lost-sword
> cd lost-sword
> allay init
> ```
> **PowerShell**
>
> ```powershell
> New-Item -Path . -Name "lost-sword" -ItemType "directory"
> Set-Location -Path '.\lost-sword'
> allay init
> ```
```bash
mkdir lost-sword
cd lost-sword
allay init
```

```powershell
New-Item -Path . -Name "lost-sword" -ItemType "directory"
Set-Location -Path '.\lost-sword'
allay init
```


## Step 2: Configure the World Template
Expand Down
14 changes: 7 additions & 7 deletions src/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ scripts as well.
The name of the project which will be used for the individual add-ons as well
unless overridden with `pack.*.name` where `*` is one of `bp`, `rp`, `sp` or `wt`.

```toml
```toml,icon=gear,filepath=allay.toml
[project.name]
de-de = "Hallo Welt"
en-us = "Hello World"
Expand All @@ -40,7 +40,7 @@ The description of the project which will be used for the individual add-ons as
well unless overridden with `pack.*.description` where `*` is one of `bp`, `rp`,
`sp` or `wt`.

```toml
```toml,icon=gear,filepath=allay.toml
[project.description]
de-de = "Das ist mein tolles Projekt."
en-us = "This is my amazing project."
Expand All @@ -53,7 +53,7 @@ en-us = "This is my amazing project."
The version of the project of the form `n.n.n` where `n` is any natural number or
zero.

```toml
```toml,icon=gear,filepath=allay.toml
[project]
# ...
version = "0.1.0"
Expand All @@ -66,7 +66,7 @@ Specifies whether the project is currently in development. This has impact on th
build process and maybe some scripts. This behavior can be overridden with
`allay build --release`.

```toml
```toml,icon=gear,filepath=allay.toml
[project]
# ...
development = true
Expand All @@ -88,7 +88,7 @@ An array of people that are considered the "authors" of the project. An optional
email address may be included within angled brackets at the end of each author
entry.

```toml
```toml,icon=gear,filepath=allay.toml
[project]
# ...
authors = ["John Doe", "Joana Doe <[email protected]>"]
Expand All @@ -100,7 +100,7 @@ authors = ["John Doe", "Joana Doe <[email protected]>"]
The name of the license(s). You might want to include a `LICENSE.txt` file in the
root of your project which contains the content of the license.

```toml
```toml,icon=gear,filepath=allay.toml
[project]
# ...
license = "MIT OR Apache-2.0"
Expand All @@ -111,7 +111,7 @@ license = "MIT OR Apache-2.0"

The URL to a site that is the home page for your project.

```toml
```toml,icon=gear,filepath=allay.toml
[project]
# ...
url = "https://github.com/allay-mc/example"
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ used to convert between file types such as [JSON5](https://json5.org/) to

Scripts are executed in order how they are specified in the configuration file.

```toml
```toml,icon=gear,filepath=allay.toml
[scripts]
base-path = "scripts/"
pre = [
Expand Down Expand Up @@ -41,7 +41,7 @@ project

Then you can refer to the scripts like this in your configuration file.

```toml
```toml,icon=gear,filepath=allay.toml
[scripts]
base-path = "scripts"
pre = [
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/conditional.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ There are often cases where one want to execute simple commands such as
[`tsc`](https://www.typescriptlang.org/docs/handbook/compiler-options.html) to
transpile TypeScript along with dynamic arguments such as environment variables.

```toml
```toml,icon=gear,filepath=allay.toml
[scripts]
base-path = "scripts/"
pre = [
Expand Down Expand Up @@ -33,7 +33,7 @@ Get-ChildItem * -Include *.ts -Recurse | Remove-Item # remove TypeScript files

The configuration would then look like this:

```toml
```toml,icon=gear,filepath=allay.toml
[scripts]
base-path = "scripts/"
pre = [
Expand Down Expand Up @@ -107,7 +107,7 @@ first or chained and modified with the following operators:

Conditions can be wrapped in parentheses to group them:

```
```text
(condition1 & condition2) | condition3
```

Expand Down
2 changes: 1 addition & 1 deletion src/scripts/executables.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Running Executables

```toml
```toml,icon=gear,filepath=allay.toml
[scripts]
# ...
pre = [
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Some scripts might accept additional options which can be set with the `args`
field.

```toml
```toml,icon=gear,filepath=allay.toml
[scripts]
base-path = "scripts/"
pre = [
Expand All @@ -23,7 +23,7 @@ the command-line. Note that arguments are not pre-processed like shells do meani
you cannot use [glob patterns](https://en.wikipedia.org/wiki/Glob_(programming)) or
environment variables.

```toml
```toml,icon=gear,filepath=allay.toml
[scripts]
base-path = "scripts/"
pre = [
Expand Down
1 change: 1 addition & 0 deletions theme/codeblockplus.css

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

Loading

0 comments on commit ab4afd3

Please sign in to comment.