QcHandbookWeb Namespace
Data of the web handbook (web/handbook/data, shown by web/handbook/handbook.js like the handbook screen of the game): one JSON file per language with the packs, the categories with their entries in list order and every page in the form of QcHandbookJson::entry, each with the English title the search compares (QcHandbook::search). More...
| Header: | #include <common/handbook/QcHandbookWeb.h> |
Functions
| QcHandbookMarkdown::File | data(const QcHandbook &handbook) |
| QStringList | icons(const QcHandbook &handbook) |
| QcHandbookMarkdown::File | languages(const QStringList &ids) |
| QcStatus | write(const QList<QcHandbookMarkdown::File> &files, const QString &directory) |
Detailed Description
The same handbook gives the same bytes.
Function Documentation
QcHandbookMarkdown::File QcHandbookWeb::data(const QcHandbook &handbook)
Returns the data file of handbook: {"language", "packs": [{"id", "name", "version"}], "categories": [{"id", "title", "entries": [id]}], "entries": {id: page with "englishTitle"}}; categories without entries are left out.
QStringList QcHandbookWeb::icons(const QcHandbook &handbook)
Returns the item names whose icons the pages of handbook show (entries, links, recipe cells), sorted.
QcHandbookMarkdown::File QcHandbookWeb::languages(const QStringList &ids)
Returns languages.json for the languages ids: {"languages": [{"id", "name"}]} with each language's own name ("Deutsch").
QcStatus QcHandbookWeb::write(const QList<QcHandbookMarkdown::File> &files, const QString &directory)
Writes files into directory (created when missing); existing files of the same names are replaced. Returns an error when a file cannot be written.