Skip to content

Guide book

thecodewarrior edited this page Aug 2, 2016 · 5 revisions

Guide book

The guide book built in to LibrarianLib is based almost entirely around JSON files. The JSON files are language-specific, and will fall back to en_US if the entry doesn't exist in the current language.

The entire guide is built from pages. Entries are a JSON file, and each one can have 1 or more pages. The pseudocode definition of an entry is as follows:

{
    "title": << title >>
    << global data >>
    "pages":[
        {
            "type": << type >>
            << page data >>
        }
        << more pages >>
    ]
}

Global data generally data that wraps applies to multiple pages. For example, text pages can pull a specific page of text from a large block of text, removing the need to specify the text on each page and handle wrapping along multiple pages yourself.

Page data is data the page uses to display itself. For example, the text page has a property to specify what text to display, and the structure page has a property to specify what structure file to load.

Common data formats

Links

Links are used throughout guides, and are as follows: A link is almost exactly like a link on the internet. Links don't require .json to be added to the end. You can have absolute links like /some/dir/guide which will link to documentation/en_US/some/dir/guide.json and you can have relative links which will link relative to the directory this page is in. If you're looking at /some/dir/guide and you click a link sponge/bob it will take you to /some/dir/sponge/bob. Adding a :<num> at the end of a link will link to a specific page. (0-indexed, I'm a programmer, what do you expect?)

Sprites

Sprite definitions are pretty simple, the format is ResourceLocation@spritename[w,h]. If you specify only a ResourceLocation it'll default to the full texture, with a screen width and height of 16x16. Using ResourceLocation@spritename will pull a specific sprite for the texture and have a screen width and height of 16x16. Adding [w,h] to the end will set the screen width and height to w and h

Clone this wiki locally