Skip to content

Commit 481224d

Browse files
authored
GroovyScript Improvements (#12)
* change mclang to ini for highlighting * fix Fluid typo * fix codeblock rendering in events/index.md * speed up details animation * increase the page size * add introduction page * move external compat and getting started to introduction * fix file paths * collapse sidebar tabs by default * order sidebar tabs * add main page to sidebar as root tab * move warning to top of page * add editors.md for the language server * convert introduction into getting started * list all valid extensions * move run config into separate file * run config packmode * add `init` phase, intent * introduction index links to pages * add reloading page for reloading information * use mind control on tsconfig to make it like me * use headers for run_config * move run-config related info to run_config * word reload options better * fix links pointing to moved file * remove Familiarity since thats been gone for year+ * add Object Mappers page * remove duplicate explicit title * move GrS specific info from Groovy to Introduction * tweak builder file * fix page change breaking on index files and root * explain basic operations more extensively * list modifications to Groovy GrS makes, add preprocessors * fix grammar and typo errors * improve log description * adjust ordering * document classes array not object * add classes file * cleanup readme * rename introduction folder to getting_started * fix index file being included twice * specify version and bug for classes package warning * correct misinformation about when editor starts up * correct misinformation about where groovy.log is * correct preprocessor information * fix some assignment operators * add lists category and fix issues in differences from java * add headers to strings page * fix run_config issues from review * basics whitespace adjustment * remove incorrect class caching information * improve groovy.log documentation * adjust link in run_config to point to new location * adjust reloading example to actually work * remove udplicates in operator overloading * reload by event
1 parent a278ffd commit 481224d

265 files changed

Lines changed: 2373 additions & 529 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@
22

33
This is where the entire site is stored, and to keep the repository tidy, please contribute as follows.
44

5-
## How to contribute
5+
## How to Contribute
6+
7+
1. Clone the GitHub.
8+
2. Install [`pnpm`](https://pnpm.io/).
9+
3. Run `pnpm i` on the project to download the required development dependencies to `node_modules`.
10+
4. Run `pnpm dev` to launch the localhost server.
11+
5. Run `pnpm build` to confirm that all links are valid.
12+
6. Thank you for contributing!
613

7-
1. Setup project
814

9-
```sh
10-
pnpm i
11-
```
1215

13-
For develop server, run `pnpm dev`.
16+
### Optional Steps
1417

15-
2. Setup cz-git
18+
Setup cz-git
1619

1720
If you don't know what this is, check out [here](https://cz-git.qbb.sh/guide/#as-global-use).
1821

@@ -31,29 +34,3 @@ replace ~/.czrc to
3134
"markBreakingChangeMode": true
3235
}
3336
```
34-
35-
3. Additional Formats
36-
37-
- DropDown
38-
39-
```markdown
40-
// after frontmatter
41-
<script lang="ts" setup>
42-
import DropDown from "../../components/DropDown.vue"
43-
</script>
44-
45-
// something
46-
47-
<DropDown>
48-
<template #label>
49-
50-
`replaceByName()`
51-
52-
</template>
53-
<template #content>
54-
55-
See the [Crafting page](https://groovyscript-docs.readthedocs.io/en/latest/groovyscript/minecraft/crafting/) for details about these.
56-
57-
</template>
58-
</DropDown>
59-
```

components/internal/CustomDocFooter.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ function shouldOperateChangeTabKeybind() {
2222
onKeyStroke([",", "ArrowLeft"], (e) => {
2323
if (!shouldOperateChangeTabKeybind()) return
2424
e.preventDefault()
25-
if (control.value.prev?.link) router.go(control.value.prev.link)
25+
if (control.value.prev?.link) router.go(control.value.prev.link.replace(/\.md$/, ''))
2626
});
2727
2828
onKeyStroke([".", "ArrowRight"], (e) => {
2929
if (!shouldOperateChangeTabKeybind()) return
3030
e.preventDefault()
31-
if (control.value.next?.link) router.go(control.value.next?.link)
31+
if (control.value.next?.link) router.go(control.value.next.link.replace(/\.md$/, ''))
3232
});
3333
3434
</script>

docs/.vitepress/config/en.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ const sidebar = generateSidebar([
1313
keepMarkdownSyntaxFromTitle: true,
1414
useTitleFromFrontmatter: true,
1515
useTitleFromFileHeading: true,
16-
sortMenusByName: true,
16+
sortMenusByFrontmatterOrder: true,
17+
sortMenusOrderByDescending: true,
18+
collapsed: true,
1719
collapseDepth: 2,
1820
folderLinkNotIncludesFileName: true,
1921
useFolderLinkFromIndexFile: true,
22+
rootGroupText: 'GroovyScript',
23+
rootGroupLink: '.',
24+
rootGroupCollapsed: false,
2025
}
2126
]);
2227

docs/.vitepress/theme/composables/details.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const EXPAND_DETAILS_ANIMATION_DURATION = 250
1+
const EXPAND_DETAILS_ANIMATION_DURATION = 50
22

33
export function handleDetailsAnimation(details: HTMLDetailsElement) {
44
let animation: Animation | undefined

docs/.vitepress/theme/style.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@
33
* https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
44
*/
55

6+
7+
/**
8+
* Page Size
9+
*
10+
* Increases the page size so that there isn't large dead space on the sides
11+
* of larger monitors.
12+
* -------------------------------------------------------------------------- */
13+
14+
:root {
15+
--vp-layout-max-width: 100%
16+
}
17+
18+
.VPDoc.has-aside .content-container {
19+
max-width: 95% !important;
20+
}
21+
22+
623
/**
724
* Colors
825
*

docs/groovy-script/content/block.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ content.createBlock('dust_block')
4848
Let's assume that the pack id is `nomifactory` so that the item and block id will be `nomifactory:dust_block`.
4949
Insert this line into the lang file.
5050

51-
```mclang:no-line-numbers
51+
```ini:no-line-numbers
5252
tile.nomifactory.dust_block.name=Heart of the universe
5353
```
5454

docs/groovy-script/content/fluid.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The example above creates a simple fluid for you, but you can also create fluids
6060
Use the following methods to register custom fluids.
6161

6262
```groovy:no-line-numbers
63-
content.registerFluid(Fluis)
63+
content.registerFluid(Fluid)
6464
```
6565

6666
::: info Warning {id="warning"}
@@ -77,6 +77,6 @@ If a fluid has a block the block state json is automatically generated,
7777
Add `fluid.[pack id].[fluid name]=Fluid Name` to your lang file
7878

7979
Example for molten iron:
80-
```mclang:no-line-numbers
80+
```ini:no-line-numbers
8181
fluid.placeholdername.molten_iron=Molten Iron
8282
```

docs/groovy-script/content/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ for CraftTweaker, but for GroovyScript it doesn't require another mod.
66
::: info Warning {id="warning"}
77
Requires version 0.4.0+. <br>
88
Before you start adding content make sure to specify the pack name and id in
9-
your [runConfig](../getting_started.md#run-config). <br>
10-
Also make sure to read [pack name and id](../getting_started.md#pack-name-and-id)
9+
your [runConfig](../getting_started/index.md#run-config). <br>
10+
Also make sure to read [pack name](../getting_started/run_config.md#packname) and [id](../getting_started/run_config.md#packid)
1111
:::
1212

1313
Currently, GroovyScript adds helpers to create

docs/groovy-script/content/item.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
order: 1000
3+
---
4+
15
# Creating items
26

37
## The simplest way
@@ -47,7 +51,7 @@ the lang file. GroovyScript generates a default lang file at `.minecraft/groovy/
4751
Let's assume that the pack id is `nomifactory` so that the item id will be `nomifactory:heart_of_the_universe`.
4852
Insert this line into the lang file.
4953

50-
```mclang:no-line-numbers
54+
```ini:no-line-numbers
5155
item.nomifactory.heart_of_the_universe.name=Heart of the universe
5256
```
5357

docs/groovy-script/getting_started.md

Lines changed: 0 additions & 144 deletions
This file was deleted.

0 commit comments

Comments
 (0)