Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix several minor issues in the docs #734

Merged
merged 4 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions web/docs/patchouli-basics/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
sidebar_position: 1
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Getting Started

This entry serves as a quick guide of what to do to get started making your own Patchouli
Expand Down Expand Up @@ -117,6 +120,9 @@ Within that folder, create the following structure:

Open `test_entry.json` and `test_category.json` and fill them in as follows:

<Tabs groupId="book-type">
<TabItem value="mod" label="Mod" default>

```json title="test_entry.json"
{
"name": "Test Entry",
Expand All @@ -131,11 +137,31 @@ Open `test_entry.json` and `test_category.json` and fill them in as follows:
}
```

</TabItem>
<TabItem value="modpack" label="Modpack">

```json title="test_entry.json"
{
"name": "Test Entry",
"icon": "minecraft:writable_book",
"category": "patchouli:test_category",
"pages": [
{
"type": "patchouli:text",
"text": "This is a test entry, but it should show up!"
}
]
}
```

</TabItem>
</Tabs>

```json title="test_category.json"
{
"name": "Test Category",
"description": "This is a test category for testing!",
"icon": "minecraft:writable_book"
"name": "Test Category",
"description": "This is a test category for testing!",
"icon": "minecraft:writable_book"
}
```

Expand All @@ -145,6 +171,18 @@ Save your files, then return ingame and open your book. Shift-click the pencil i
bottom-left corner. When you do so, it will reload the book contents, and you should see
the category and entry you just defined appear.

:::caution Important note for modpack authors

The namespace is always `patchouli` for IDs of books/categories/entries in
`.minecraft/patchouli_books` (i.e. modpack books). For example, with the above structure,
you would need to use the following IDs:

* Book: `patchouli:_YOURBOOKNAME_`
* Category: `patchouli:test_category`
* Entry: `patchouli:test_entry`

:::

### 6. Learn More!

You're done getting set up, now it's time to learn more about what you can do with
Expand Down
4 changes: 4 additions & 0 deletions web/docs/reference/entry-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,7 @@ starting path.
Additional list of items this page teaches the crafting process for, for use with the
in-world right click and quick lookup feature. Keys are ItemStack strings, values are
0-indexed page numbers.

## **entry_color** (String)

The color of the link to this entry from its category, in hex ("RRGGBB", # not necessary). Defaults to [`book.text_color`](book-json.md#text_color-string).
4 changes: 2 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.4.0",
"@docusaurus/preset-classic": "2.4.0",
"@docusaurus/core": "2.4.3",
"@docusaurus/preset-classic": "2.4.3",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.1.1",
Expand Down
6 changes: 6 additions & 0 deletions web/src/pages/docs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';
import {Redirect} from '@docusaurus/router';

export default () => {
return <Redirect to="docs/intro" />;
};
Loading
Loading