.idea | ||
docs | ||
.gitignore | ||
navigation.json | ||
README.md |
Grasscutter Docs
This repository contains the documentation for Grasscutter. The documentation is written in Markdown. Used on the Grasscutter wiki.
Contributing
If you want to contribute to the documentation, you can do so by forking this repository and making a pull request. Any useful additions are welcome.
How to Contribute
- Fork this repository
- Add your changes or additions to the
docs
folder - Edit the
navigation.json
file to include your new page or any changes you made. - Commit your changes
- Make a pull request
How to Add a New Page
Create a new Markdown file in the docs
folder.
You may also use existing sub-folders or create new ones to organize your pages.
How to Edit the navigation.json
File
The navigation.json
file contains the navigation structure of the wiki. It is used to generate the sidebar on the wiki.
The file is structured as a JSON array of objects. Each object represents a page or a subfolder.
If the object represents a page, it has the following structure:
{
"name": "Server Errors",
"_type": "file",
"path": "Troubleshooting/Server-Errors.md"
}
name
is the name of the page as it will appear in the sidebar_type
is alwaysfile
for pagespath
is the path to the page relative to thedocs
folder
If the object represents a folder, it has the following structure:
{
"name": "Troubleshooting",
"_type": "dir",
"_main": true,
"children": [
{
"name": "Server Errors",
"_type": "file",
"path": "Troubleshooting/Server-Errors.md"
}
]
}
name
is the name of the folder as it will appear in the sidebar_type
is alwaysdir
for folders_main
istrue
if the folder is the main folder of the wiki,false
otherwise. Main folders are displayed in the sidebar as top-level items. This property should befalse
for subfolders inside main folderschildren
is an array of objects representing the pages and subfolders inside the folder. The structure of these objects is the same as the structure of the main object.
NOTE
children
can contain both pages and subfolders. However, creating another subfolder inside a subfolder is NOT recommended if it can be avoided.
This is how one main
object in the navigation.json
containing both files and subfolders should look like:
{
"name": "Resources",
"_type": "dir",
"_main": true,
"children": [
{
"name": "MongoDB Tutorial",
"_type": "file",
"path": "Resources/MongoDB-Tutorial.md"
},
{
"name": "Redirecting Text Blocks",
"_type": "file",
"path": "Resources/Redirecting-Text-Blocks.md"
},
{
"name": "Fun Stuff",
"_type": "dir",
"_main": false,
"children": [
{
"name": "Colored nickname and signature",
"_type": "file",
"path": "Resources/Fun-Stuff/Colored-nickname-and-signature.md"
},
{
"name": "Avatar/Character",
"_type": "file",
"path": "Resources/Fun-Stuff/Avatar-Character.md"
}
]
}
]
}
If you want to add a new page to the wiki, and the main or subfolder containing it already exists, you only need to add the page object to the children
array of the folder object.