diff --git a/docs/basics/structure/book.md b/docs/basics/structure/book.md index d86773d5..e38bb94e 100644 --- a/docs/basics/structure/book.md +++ b/docs/basics/structure/book.md @@ -237,6 +237,14 @@ The book will be treated as a book in index mode (that means, no big "node view" See also [Leaflets](/docs/advanced/leaflets) for more information. +### **allow_open_book_with_invalid_links** (Boolean, _optional_) + +Default value: `false`. + +If set to `true`, the book will not throw an error when trying to open a book with invalid book links. Instead, the link will be rendered in red with a tooltip explaining that the link is invalid. + +The main use for this is for mods that have external translators for their books, where translations might be outdated after entries have been removed or moved. + ## Usage Examples `/data//modonomicon/books//book.json`: diff --git a/docs/getting-started/getting-started.md b/docs/getting-started/getting-started.md index a2743a29..54ce62bd 100644 --- a/docs/getting-started/getting-started.md +++ b/docs/getting-started/getting-started.md @@ -23,12 +23,10 @@ Even for modpack creators it is recommended to follow this process. Datagen is a ## Manually creating books -:::warn +:::warning -It is not recommended to manually create books. It is much more convenient and error-free to use datagen. +It is not recommended to manually create books. It is much more convenient and error-free to use datagen. JSON is not a great format for text editing, and can be annoying to properly format text. ::: -If you instead want to manually create a book by editign JSON files directly there is currently no guide, however you can look at the generated results of the demo book **[here](https://github.com/klikli-dev/modonomicon/tree/HEAD/neo/src/generated/resources/data/modonomicon/modonomicon/books)**. - -Further, you can reference the [Structure](../basics/structure/) section to learn about the file structures. \ No newline at end of file +If you instead want to manually create a book by creating and editing JSON files directly, follow **[Step by Step Guide for a Book via Datapack](./step-by-step-with-datapack/)**. diff --git a/docs/getting-started/step-by-step-with-datagen/step-by-step-with-datagen.md b/docs/getting-started/step-by-step-with-datagen/step-by-step-with-datagen.md index 75155601..cc08c591 100644 --- a/docs/getting-started/step-by-step-with-datagen/step-by-step-with-datagen.md +++ b/docs/getting-started/step-by-step-with-datagen/step-by-step-with-datagen.md @@ -5,7 +5,7 @@ sidebar_position: 10 # Step by Step Guide for Book Datagen This page will guide you through the recommended and most convenient way to create a book. -It uses the Demo Book modonomicon provides as a starting point. +It uses the [Demo Book](https://github.com/klikli-dev/modonomicon/tree/HEAD/neo/src/generated/resources/data/modonomicon/modonomicon/books) modonomicon provides as a starting point. :::tip diff --git a/docs/getting-started/step-by-step-with-datapack/step-by-step-with-datapack.md b/docs/getting-started/step-by-step-with-datapack/step-by-step-with-datapack.md new file mode 100644 index 00000000..bcd36044 --- /dev/null +++ b/docs/getting-started/step-by-step-with-datapack/step-by-step-with-datapack.md @@ -0,0 +1,34 @@ +--- +sidebar_position: 10 +--- + +# Step by Step Guide for a Book via Datapack + +This page will guide you through a reasonably easy way to create a book _without_ datagen. +It uses the [Demo Book](https://github.com/klikli-dev/modonomicon/tree/HEAD/neo/src/generated/resources/data/modonomicon/modonomicon/books) modonomicon provides as a starting point. + +:::tip + +If you run into any issues or have any questions, join our Discord: **https://dsc.gg/klikli** + +::: + +:::warning + +It is not recommended to manually create books. It is much more convenient and error-free to use [datagen](../step-by-step-with-datagen/). JSON is not a great format for text editing, and can be annoying to properly format text. + +::: + + +The best approach is to create a datapack from the demo book, and then modify and extend it to your needs. This saves you a lot of time and effort in manually creating a valid file structure for your book. + +:::tip + +If you are already well-versed with datapacks you can look at the demo book **[here](https://github.com/klikli-dev/modonomicon/tree/HEAD/neo/src/generated/resources/data/modonomicon/modonomicon/books)** and the demo multiblocks used by the book **[here](https://github.com/klikli-dev/modonomicon/tree/HEAD/neo/src/generated/resources/data/modonomicon/modonomicon/multiblocks)** and simply download the individual files you want to use as a reference. + +::: + +First, download the modonomicon source code, as it contains the demo book: +1. Start by visiting https://github.com/klikli-dev/modonomicon +2. Find the green "Code" button and click it. Then click "Download ZIP" at the bottom of the dropdown menu. +3. Extract the ZIP file to a location of your choice. \ No newline at end of file diff --git a/docs/getting-started/step-by-step-with-datapack/step1.md b/docs/getting-started/step-by-step-with-datapack/step1.md new file mode 100644 index 00000000..8ebe4e33 --- /dev/null +++ b/docs/getting-started/step-by-step-with-datapack/step1.md @@ -0,0 +1,17 @@ +--- +sidebar_position: 10 +--- + +# Step 1: Set up an empty datapack + +1. Set up a folder structure as required by minecraft: https://minecraft.wiki/w/Data_pack#Folder_structure. + 1. You do not need to create all the subfolders of the `data` folder, you can keep `data` empty in the first step. + +2. Now create a folder for your namespace. Usually your namespace is your mod id or modpack id (e.g. the modpack name in all lowercase with no spaces) (See also https://minecraft.wiki/w/Resource_location#Namespaces) + +3. In your namespace folder, create a folder `/modonomicon/`. + +4. In the `/modonomicon/` folder, create a folder `/books/` and `/multiblocks/`: + :::info + If you do not plan on having any multiblocks or multiblock pages, you can skip the `/multiblocks/` folder. + ::: \ No newline at end of file diff --git a/docs/getting-started/step-by-step-with-datapack/step2.md b/docs/getting-started/step-by-step-with-datapack/step2.md new file mode 100644 index 00000000..e3db8012 --- /dev/null +++ b/docs/getting-started/step-by-step-with-datapack/step2.md @@ -0,0 +1,22 @@ +--- +sidebar_position: 20 +--- + +# Step 2: Copy demo content into your datapack + + +1. In your file explorer go to the folder you extracted and then into `\neo\src\generated\resources\data\modonomicon\modonomicon\books\`. + +2. Copy the `demo` folder (or if you want to make a leaflet, the `demo_leaflet` folder) and paste it in your datapack's `/modonomicon/books/` folder. + +3. In your file explorer go to the folder you extracted and then into `\neo\src\generated\resources\data\modonomicon\modonomicon\multiblocks\`. + +4. Copy all `.json` files and paste them in your datapack's `/modonomicon/multiblocks/` folder. + :::info + If you do not plan on having any multiblocks or multiblock pages, you can skip copying the contents of the `/multiblocks/` folder. + ::: + +5. If you did not set up multiblocks, go into your datapack folder `/data//modonomicon/books/demo/entries/features/` and delete the `multiblock.json` file. + :::info + If you do not delete that file, this multiblock entry will look for the multiblocks in the `/multiblocks/` folder and will throw an error if it does not find them. + ::: diff --git a/docs/getting-started/step-by-step-with-datapack/step3.md b/docs/getting-started/step-by-step-with-datapack/step3.md new file mode 100644 index 00000000..0e092334 --- /dev/null +++ b/docs/getting-started/step-by-step-with-datapack/step3.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 30 +--- + +# Step 3: Test and extend the Demo Book + +You can now test your datapack in game. An item named `book.modonomicon.demo.name` should be available in the Modonomicon creative tab and JEI/REI/EMI. + +When you first open the book, it will not have proper texts instead it will have contents like `book.modonomicon.demo.features.spotlight.description`. + +Both the weird book name and weird content texts happen because the demo book uses the minecraft translation system. You can either create a resource pack with a language file (you can copy individual lines or the entire file from https://github.com/klikli-dev/modonomicon/blob/version/1.21.1/neo/src/generated/resources/assets/modonomicon/lang/en_us.json), or you can directly type your desired text in the json files. + +:::tip +It is recommended to use the translation system, otherwise it is impossible for others to translate your book. +::: + +**You can now edit the demo book to your liking to make your own book**. +Reference the [Basics](../basics/) and [Advanced](../advanced/) sections to learn about the valid JSON keys and structures. \ No newline at end of file