This page is aimed at developers that want their wiki to be accessible via the oracle index mod.
Project Setup
- Create your wiki directory / content layout as normal, following the instructions of moddedmc.wiki
- Make sure you have _meta.json files with entries for all your content. The oracle index uses the meta.json files to build the navigation bar.
- Copy the entire wiki to your mods resources folder. This can be automated, see auto gradle sync. The correct path is: "resources/assets/oracle_index/books/your-mod-id/".
- The oracle index will automatically load your mods resources.
The resulting directory tree should look like this:
There is no hot-reloading. Use the moddedmc.wiki live preview to create your wiki contents.
Limitations
The Oracle Index only includes a primitive markdown parser. This means that most html tags are not supported. Most markdown features, such as headings, bold, italic, links between pages, etc. are supported. Some moddedmc-specific html tags such as the "ModAsset", "Callout" or "CraftingRecipe" are supported. Non-supported html tags will be ignored, and will not be displayed at all.
If you want to use other html tags, feel free to open a PR.
If a <ModAsset>
image matches an existing ingame item, the actual ingame item (or blockitem) will be displayed instead. This means that you don't need to include the rendered textures of your items.
All images are expected in the ".assets/modid/" folder, not the ".assets/item/modid" subfolder.
If you have something in a paragraph that you don't want to display inside the ingame wiki (e.g. a table or other not-supported element), you can wrap the paragraph in a div like this:
<div onlineOnly="true" >
Item Links
One extra feature added by the Oracle Index is the ability to link relevant items for a wiki page. To do so, a new parameter is added to the mdx frontmatter: "related_items", which contains an array of ingame item IDs. This can look as follows:
---title: Generatorsicon: oritech:basic_generator_blockrelated_items: [oritech:basic_generator_block, oritech:bio_generator_block, oritech:lava_generator_block, oritech:fuel_generator_block, oritech:big_solar_panel_block]---Here would be your content.
Custom Book / Opening the Screens
Oracle Index does not come with a guide book by default. However, in your mod, you can very easily just add a new book item, and open the desired screen when the book is used. You could also open the book via other mechanisms, such as a button in another screen.
Call the following code on the client side:
OracleScreen.activeBook = "oracle-index"; // your book nameOracleScreen.activeEntry = "oracle_index:books/oracle-index/user_guide.mdx"; // your modId + filepathMinecraftClient.getInstance().setScreen(new OracleScreen());