Skip to content

Commit

Permalink
Fix several minor issues in the docs (#734)
Browse files Browse the repository at this point in the history
* Add tabs and admonition to clarify modpack namespace confusion

* Update Docusaurus to 2.4.3 to fix broken tab label formatting

* Fix 404 error on /docs route

* Add undocumented entry_color field to entry.json reference
  • Loading branch information
object-Object authored Mar 16, 2024
1 parent c9053e6 commit 13883fc
Show file tree
Hide file tree
Showing 5 changed files with 236 additions and 188 deletions.
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

0 comments on commit 13883fc

Please sign in to comment.