Handbook

The Handbook namespace lets your mod add its own articles to the in-game Handbook app, so players can read guides, lore and reference material for your mod right next to the base game’s entries.

Article content is written in Markdown (the same renderer the base game uses), so you can use headings, lists, tables, links, inline code and fenced code blocks.

Required permission: ui

Import

import { Handbook } from "@hotbunny/hackhub-content-sdk";

Methods

Handbook.registerEntry(entry)

Register (or replace) a Handbook article. If an entry with the same id already exists it is overwritten. Entries are removed automatically when your mod is uninstalled.

Field Type Description
id string Unique article id. Re-registering the same id replaces the entry.
category string Category the article is grouped under. Unknown categories (including your own) are created automatically and shown with a generic book icon.
title string Article title shown in the sidebar and search results.
content string Article body, written in Markdown.
order? number Optional sort order within the category (lower comes first).
Handbook.registerEntry({
    id: "mymod-getting-started",
    category: "My Mod",
    title: "Getting Started",
    content: `# Welcome to My Mod

Run \`mymod scan <ip>\` to find vulnerable hosts, then:

1. Crack the credentials
2. Exfiltrate the data
3. Cover your tracks

| Command | Purpose |
| ------- | ------- |
| \`mymod scan\` | Discover hosts |
| \`mymod loot\` | Download files |
`,
    order: 0,
});

Group several articles under the same category to build a multi-page guide:

Handbook.registerEntry({ id: "mymod-intro",    category: "My Mod", title: "Introduction", content: "...", order: 0 });
Handbook.registerEntry({ id: "mymod-commands", category: "My Mod", title: "Commands",     content: "...", order: 1 });
Handbook.registerEntry({ id: "mymod-faq",      category: "My Mod", title: "FAQ",          content: "...", order: 2 });

Handbook.unregisterEntry(id)

Remove a previously registered article by id.

Handbook.unregisterEntry("mymod-faq");

Handbook.open(id?, category?)

Open the Handbook app. Pass both id and category to jump straight to a specific article; call with no arguments to open the contents page.

Parameter Type Description
id? string Article id to open.
category? string Category the article lives in.
// Open straight to your getting-started article
Handbook.open("mymod-getting-started", "My Mod");

// Just open the Handbook
Handbook.open();

Notes

  • Categories are created on demand - you don’t need to declare them. A category that isn’t one of the base game’s gets a generic book icon.
  • Re-registering an entry with an existing id replaces it, so it’s safe to register on every load.
  • All of your mod’s entries are cleaned up automatically when the mod is uninstalled.