Advanced
Advanced support gives you lot more freedom. From custom documentation to as many topics & sub-topics you might need.
Create documentation index file
Firstly you need to tell Voile what documentations you want to add. This is done by creating an index file in Common/Docs directory in your mod's resources. Voile searches for JSON files named in format of {ModGroup}_{ModName}.json.
Let's say your mod has group MyGroup and name MyMod. In that case you would create index file at Common/Docs/MyGroup_MyMod.json.
The index file has the following structure:
This will:
Define new documentation in group
MyGroup, with IDMyDocumentation, with user-friendly nameMy mod documentation.The group and ID is used as the root directory for the documentation. In this example, the directory Common/Docs/MyGroup_MyDocumentation will contain all the Markdown files for the documentation.
The group and ID are also used when referencing specific documentation's topic. The user-friendly name is shown to the user in the documentation list on the left side of the interface.
Mark the documentation as enabled. Disabled documentations are not shown to the player.
Give a sort index to the documentation. Sort indexes are used to sort documentation list: they are sorted from the lowest to highest. This allows you to control the order of documentations.
List of topics that the documentation will contain.
For example, the
index.mdtopic will be loaded fromCommon/Docs/MyGroup_MyDocumentation/index.mdThe
first-steps.mdtopic will be loaded fromCommon/Docs/MyGroup_MyDocumentation/tutorial/index.md
The directory structure will look something like this:
Writing topics
Topics are written in Markdown with a front-matter.
Common/Docs/MyGroup_MyDocumentation/index.md
Common/Docs/MyGroup_MyDocumentation/tutorial/first-steps.md
The topic's ID is derived from its file name. So index.md will have ID index and first-steps.md will have ID first-steps. You may also use field id in the front-matter to specify your own ID.
What's next?
It's recommended to learn:
Topic Identifiers - creating references to other topics
Formatting - Formatting in Voile's Markdown
You may also see Voile's internal docs in the GitHub repository. Make sure to follow the naming convention in the first chapter.