10 Guide Page Format
ABKQPO edited this page 2026-11-21 16:12:09 +08:00

Guide Page Format

GuideNH runtime pages are markdown files parsed with:

  • standard markdown block and inline syntax
  • YAML frontmatter
  • GFM tables
  • strikethrough
  • mark highlight with ==text==
  • GuideNH inline underline extensions: ++text++ (straight underline), ^^text^^ (wavy underline), ::text:: (emphasis dots / dotted underline)
  • MDX comments using {/* ... */}
  • MDX-style custom tags

Supported Markdown

GuideNH pages support the common markdown features used in the example guide:

  • headings
  • paragraphs
  • inline emphasis, bold, strike, and code
  • inline mark highlight (==text==)
  • inline underline (++text++), wavy underline (^^text^^), and emphasis dots (::text::)
  • links and images
  • literal autolinks for direct URLs, www. hosts, and email addresses
  • reference links and reference images
  • unordered and ordered lists
  • GFM task lists
  • blockquotes
  • GitHub-style alert blockquotes such as [!NOTE]
  • horizontal rules
  • fenced code blocks
  • indented code blocks
  • GFM tables
  • HTML tables with captions, column groups, row groups, and merged cells
  • footnotes
  • lowercase HTML fragments such as <a>, <br>, <kbd>, <sub>, <sup>, and <details>
  • MDX comments in page text

See wiki/resourcepack/assets/guidenh/guidenh/_en_us/markdown.md for a live sample page.

Highlight

Use ==text== for inline highlighted text. Use <mark color="#8A6A00">text</mark> when a custom highlight color is needed. The default mark background is a dark golden yellow chosen to keep white text readable.

Code Blocks

Runtime code blocks currently support:

  • explicit fence languages such as java, lua, scala, csv, and mermaid
  • automatic language inference when the fence language is omitted
  • a language label shown above the block
  • a top-right copy button in the in-game viewer
  • lightweight runtime syntax highlighting for the detected language

Example:

```lua
local value = 42
print(value)
```

```
object Demo extends App {
  println("auto detected scala")
}
```

Indented code blocks are also supported:

    print("indented code")

When a fenced block resolves to mermaid and the source is a supported mindmap, GuideNH renders it as an interactive runtime mindmap instead of a plain code block.

When a fenced block is explicitly marked as csv, GuideNH renders it as a runtime table instead of a plain code block. If the fence language is omitted, CSV-shaped text still stays a code block and only uses CSV language detection for labeling/highlighting.

Explicit CSV tables can also provide column width hints:

```csv widths=120,80
name,value
iron,42
gold,17
```

Fence metadata also supports header=false and quoted width lists:

```csv widths="120,80" header=false
name,value
iron,42
gold,17
```

Direct GFM-style literal autolinks are also supported in normal paragraph text:

Visit https://example.com/docs, www.example.org, or guide@example.com

Mermaid Mindmaps

GuideNH runtime Mermaid support is currently focused on mindmap diagrams:

  • fenced ```mermaid blocks
  • auto-detected mermaid code fences whose content starts with mindmap
  • explicit <Mermaid>...</Mermaid> tags
  • explicit <Mermaid src="./diagram.mmd" /> imports
  • rich inline markdown labels inside Mermaid node text
  • optional <NodeContent id="...">...</NodeContent> children for arbitrary runtime blocks inside matching nodes
  • whole-diagram drag-to-pan interaction in the in-game viewer
  • layout: tidy-tree frontmatter inside Mermaid source
  • common mindmap node shapes such as square, rounded, circle, bang, cloud, and hexagon
  • parsed ::icon(...) and :::class metadata

Example:

```mermaid
mindmap
  root((GuideNH))
    Runtime
      Markdown
      CSV
    Mindmap::icon(fa fa-sitemap)
      Drag to pan
```

<Mermaid src="./markdown-mindmap.mmd" />

<Mermaid width="340" height="240">
mindmap
  root["**GuideNH** [Index](./index.md)"]
    runtime["Runtime blocks"]
    export["Site export"]

<NodeContent id="runtime">
Runtime nodes can mix text, links, and blocks.

<ItemImage id="minecraft:diamond" />
</NodeContent>

<NodeContent id="export">
![Machine Diagram](./test1.png)
</NodeContent>
</Mermaid>

Mermaid diagrams that are not supported at runtime yet still fall back to regular Mermaid-labeled code blocks.

CSV Table Import

GuideNH also supports runtime CSV file imports through an explicit tag:

<CsvTable src="./markdown-table.csv" />

The src path resolves relative to the current page, the same way runtime asset links and scene src imports do.

Imported CSV tables can also provide width hints:

<CsvTable src="./markdown-table.csv" widths="120,80" />

You can also write a CSV table inline with an explicit fence:

```csv
name,value
iron,42
gold,17
```

Markdown Tables

Column Widths

Ordinary GFM markdown tables can also provide runtime column width hints by adding a runtime attribute line immediately before the table:

{: widths="120,80" }
| Name | Value |
| --- | --- |
| Iron | 42 |
| Gold | 17 |

This keeps the table itself standard markdown while letting GuideNH apply runtime-only preferred column widths.

Merged Cells and Cell Attributes

  • An extra | after a cell adds one spanned column: || spans two columns, ||| spans three.
  • Start a cell with ^^ to merge it into the cell above; its content is added on a new line.
  • Edge colons set cell alignment: : left, right :, or : centered :.
  • A trailing IAL ({: ... }) sets color, background / bgcolor, safe style, align, valign, id, or class. Define reusable attributes with {:name: ...}. Unsafe CSS and external URLs are ignored.
  • End a physical row with \ to continue it on the next line. A delimiter row first (|--|--|) creates a headerless table.
  • Cells accept ordinary inline Markdown and MDX, including links, images, emphasis, and LaTeX. HTML tables also support explicit <thead>, <tbody>, and <tfoot> groups.
{:warning: style="background: #4b2418; color: #ffd8c2; font-weight: bold"}
| Stage | Products | Notes |
| --- | --- | --- |
| : First stage : | 2 ATP ||
| ^^ Next step | 3 ATP | {: warning } |
| Total ||| {: style="text-align: right; background: #26364d"}

HTML Tables

Use an HTML table for explicit row groups and multi-row headers. <caption> is shown above the table. Use <colgroup> and <col> to set preferred pixel or percentage column widths; width accepts pixels or percentages (with an optional px suffix), and span repeats one width for several columns. Group rows with <thead>, <tbody>, and <tfoot>. Header and data cells support colspan, rowspan, align, and valign; th also supports scope, abbr, and headers. Site export preserves common table attributes such as width, border, cellpadding, cellspacing, frame, rules, summary, bgcolor, and bordercolor. A table-level widths attribute can also provide comma-separated pixel hints:

<table widths="150,70,70,150">
  <caption>Fuel burn rates</caption>
  <colgroup>
    <col width="150" />
    <col width="70" span="2" />
    <col width="150" />
  </colgroup>
  <thead>
    <tr>
      <th scope="col" rowspan="2" align="left">Fuel</th>
      <th scope="colgroup" colspan="2" align="center">Burn rate</th>
      <th scope="col" rowspan="2" align="right">Notes</th>
    </tr>
    <tr>
      <th scope="col" align="right">Charcoal</th>
      <th scope="col" align="right">Coal</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row" rowspan="2" align="left">Solid fuel</th>
      <td align="right">42</td>
      <td align="right">17</td>
      <td rowspan="2" align="left">Per tick</td>
    </tr>
    <tr>
      <td colspan="2" align="right">59 combined</td>
    </tr>
  </tbody>
  <tfoot>
    <tr>
      <th scope="rowgroup" align="left">Total</th>
      <td colspan="3" align="right">59 units</td>
    </tr>
  </tfoot>
</table>

Task Lists, Alerts, And Footnotes

GuideNH runtime also supports several useful GFM-style behaviors:

  • task lists using - [ ] and - [x]
  • GitHub alert blockquotes such as [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], and [!CAUTION]
  • footnote references and definitions

Example:

- [x] done item
- [ ] todo item

> [!NOTE]
> alert body

Footnote ref[^one]

[^one]: tooltip text

Footnote references render as tooltip-style inline markers, and GuideNH appends a compact runtime footnote list near the bottom of the page.

List Width Customization

Standard markdown lists do not define width controls, but GuideNH runtime containers can constrain them:

<Column width="220">
- narrow list item
- another narrow item
</Column>

This is currently the recommended way to customize list line width at runtime.

GuideNH supports CommonMark reference definitions:

[Guide Ref][doc]
![Machine][img]

[doc]: ./subpage.md#intro
[img]: ./test1.png "Machine Diagram"

Lowercase HTML Runtime Tags

GuideNH runtime supports a focused subset of lowercase HTML-style tags directly:

Press <kbd>Shift</kbd> + <sub>1</sub>

<a href="./subpage.md" title="Open subpage">Open subpage</a><br clear="all" />

<details open>
<summary>More</summary>

Body text
</details>

Other raw HTML fragments still fall back to literal text-style handling instead of browser-grade HTML rendering.

MDX Comments

GuideNH supports the MDX comment form and ignores it before markdown compilation:

Visible text. {/* hidden inline comment */}

{/*
multiline comment
*/}

More visible text.

Frontmatter

GuideNH reads the first YAML frontmatter block and parses these known keys:

Key Type Meaning
navigation map Adds the page to the navigation tree
categories list of strings Adds the page to MediaWiki-style categories; each entry can optionally use `category
item_id item filter expression A single NEI-style item expression that makes the page discoverable by <ItemLink>
item_ids list of item filter expressions List form of item_id; any matching expression makes the page discoverable by <ItemLink>
fluid_id / fluid_ids string / string list Exact fluid registry-name binding, optionally with #anchor
ore_ids list of ore dictionary names Makes the page discoverable by ore-dictionary items (e.g. ingotIron, oreCopper)
bindings list of mappings Associates quests, research or custom content with this page; each entry is {type: "system", id: "ID", anchor: "section"}, with optional anchor
research_id / research_ids string / string list Thaumcraft research shortcuts for the page top; use bindings for section targets
author string Single author name. Displayed in the bottom bar.
authors list of strings or {name: ...} maps Multiple author names. At most two are displayed; additional ones are replaced with .... Takes precedence over author if both are present.
date string or YYYY-MM-DD date Content creation date. Displayed in the bottom bar.
updated string or YYYY-MM-DD date Last updated date. Displayed in the bottom bar.
zoom positive float Per-page content zoom multiplier (e.g. 1.5 = 150 %). Multiplied with the global contentZoom setting in ModConfig. Default 1.0.
any other key any YAML value Available to extensions and authoring tools

Native fluid bindings and navigation icons

fluid_id accepts one registry-name binding. fluid_ids accepts a string list. Both may coexist and are merged without duplicate destinations. Append #anchor to target a section; distinct anchors remain distinct. Bindings use exact names and ignore displayed amount and NBT.

fluid_id: water
fluid_ids:
  - water#coolant
  - steam#uses
navigation:
  title: Fluid handling
  icon_fluid: water

Choose either navigation.icon_fluid for one registry name or icon_fluids for a nonempty list cycling once per second. These fields are mutually exclusive and cannot be combined with item or texture icon sources. They select page icons, not page bindings. Validate fluid availability in the running game; offline previews cannot verify registry contents.

External content bindings

bindings associates quests, research or another registered content type with this guide page. Write one YAML flow mapping per entry, with braces and commas:

---
navigation:
  title: Infusion guide
  required_mod: Thaumcraft
bindings:
  - {type: "thaumcraft", id: "INFUSION", anchor: "infusion"}
  - {type: "thaumcraft", id: "INFUSION", anchor: "apparatus"}
  - {type: "betterquesting", id: "01234567-89ab-cdef-0123-456789abcdef"}
---
Field Required Meaning
type Yes Content system: thaumcraft for research, betterquesting for quests, or a type registered by another integration; names are trimmed and lowercased
id Yes Original content ID. Research uses the registered ID, such as INFUSION, rather than a translated name. Quest IDs accept UUID and compact Base64 forms
anchor No Heading or named anchor in this guide page. Omit it to open the page from the top; it is not a Thaumonomicon page number

Different pages and anchors remain separate destinations. Repeating the same content, page and anchor does not add another choice. The native editor, Web Editor and both IDE plugins support these single-line entries. Navigation and click behavior are described under External content pages.

All three fields are YAML strings. Double-quoted strings escape a quote as \" and a backslash as \\; single-quoted strings keep double quotes unchanged and escape an apostrophe by doubling it:

bindings:
  - {type: "custom \"system\"", id: "chapter: \"one\", part#1", anchor: "reader's notes"}
  - {type: 'custom "system"', id: 'chapter: "one", part#1', anchor: 'reader''s notes'}

Quotes, commas, colons and # inside a quoted value belong to that value. id preserves case and prefixes such as @; surrounding whitespace is removed. Do not append an anchor to the ID: use the separate anchor field.

The research-only shortcuts research_id and research_ids accept one research ID and a string list respectively. Use bindings whenever a heading destination is needed. Quest bindings use bindings; the old quest frontmatter field is no longer read.

navigation

Field Required Type Notes
title yes string Display name in navigation and search title fallback
keyword no string One additional search keyword or alias; supports prefix matching
keywords no list of strings Additional search keywords or aliases; values are combined and deduplicated
parent no page id Parent page id; omitted means top-level node
position no integer Sibling sort order; default 0, larger values appear earlier
recommend no integer Home recommendation priority; only included when set, larger values first
priority no integer Load priority for same-path page overrides; default 0, higher wins, equal priority lets the later resource pack entry win
icon no item id Item icon shown in navigation/search. Accepts modid:name, modid:name:meta, or modid:name:meta:{snbt}. The inline SNBT tail is the preferred way to attach NBT such as a custom display name.
icons no list of item ids List of item icons for animated cycling (one per second). Each entry uses the same syntax as icon, including inline :{snbt} tails. When present takes priority over icon.
icon_texture no asset path Texture icon path resolved like any other asset link
icon_textures no list of asset paths List of texture icons for animated cycling (one per second). When present takes priority over icon_texture.
icon_fluid no string One fluid registry name; excludes icon_fluids and item/texture sources
icon_fluids no string list Nonempty fluid registry names cycling once per second; excludes icon_fluid and item/texture sources
required_mod no mod id Hides the page unless this mod is loaded.
required_mods no list of mod ids Hides the page unless every listed mod is loaded.
excluded_mod no mod id Hides the page when this mod is loaded.
excluded_mods no list of mod ids Hides the page when any listed mod is loaded.

Example Frontmatter

item_ids:
  - minecraft:book
fluid_id: water#coolant
navigation:
  title: Guide Overview
  parent: index.md
  position: 10
  recommend: 0
  icon: minecraft:book
categories:
  - basics
  - examples|Overview
author: ExampleAuthor
date: 2024-01-15
updated: 2024-06-01

categories accepts either plain category names or category|sort key entries. Use <Category name="examples" rows="3" /> to render a category listing block, and <Special name="SpecialPages" rows="3" /> to embed the generated MediaWiki-style special-page index.

The templates/ folder under a language folder is reserved for template pages. Templates are written like any other page but are excluded from listings and the navigation tree. See Templates.

When any of author, authors, date, or updated is present, GuideNH shows a bottom bar in the guide screen (matching the top toolbar style) with right-aligned text like: Content from MyMod, Author ExampleAuthor, Date 2024-01-15, Updated 2024-06-01.

Multiple authors example:

authors:
  - Alice
  - Bob
  - Charlie

Or with structured entries:

authors:
  - name: Alice
  - name: Bob

zoom

The zoom key lets you enlarge or shrink the content of a single page without affecting any other page. The value is a positive float treated as a multiplier:

Example value Effect
1.0 (default) Normal size
1.5 150 % — content 50 % larger
0.75 75 % — content 25 % smaller

The per-page zoom is multiplied with the global contentZoom slider in ModConfig → GuideNH → UI. This lets server packs set a sensible baseline while still allowing individual pages to fine-tune layout for narrow or wide content.

Example: set this page to display at 150 % of the base zoom:

zoom: 1.5
navigation:
  title: My Dense Page

Page layout is recomputed at the zoom-adjusted width, so text wrapping and all block geometry remain correct at any zoom level.

GuideNH resolves ids and paths using these rules:

Input Meaning
subpage.md relative to the current page, in the current page namespace
./subpage.md relative to the current page, in the current page namespace
/guide.md rooted to the current page namespace, equivalent to currentmod:guide.md
gregtech:guide.md explicit namespace; opens gregtech:guidenh when the current guide path is guidenh
gregtech:/guide.md explicit namespace plus rooted path, normalized to gregtech:guide.md
subpage.md#anchor page plus anchor fragment
guidenh:other.md#anchor explicit modid:path#anchor
https://example.com external HTTP/HTTPS link

Page links are isolated by namespace. A link written from assets/guidenh/guidenh/_en_us/index.md as [Guide](guide.md) resolves to guidenh:guide.md; the same text in assets/gregtech/guidenh/_en_us/index.md resolves to gregtech:guide.md. If that page is missing in the current namespace, GuideNH reports it as a broken link instead of falling back to another mod's page.

Explicit modid:path links can cross from one mod's data-driven guide to another. The guide id is derived from the target page namespace and the current guide path, so a link from guidenh:guidenh to gregtech:guide.md opens page gregtech:guide.md in guide gregtech:guidenh.

Anchor fragments scroll the guide to a heading whose text lowercased and spaces replaced with hyphens matches the fragment (e.g. #crafting-recipe scrolls to ## Crafting Recipe), or to a <a name="..."> anchor.

Assets use the same resolution rules as links. For example:

  • test1.png resolves relative to the current page file.
  • /assets/example_structure.snbt resolves to the guide's asset root.
  • guidenh:textures/gui/example.png resolves as an explicit resource location.

Item Reference Syntax

Navigation icon and icons, along with tags that accept an item id, use ordinary item references:

modid:name
modid:name:meta
modid:name:meta:{snbt}

An omitted meta defaults to 0. An SNBT tail starts at the first { and is parsed as item NBT. Where wildcard metadata is supported, * can be combined with the SNBT tail.

Examples:

minecraft:diamond
minecraft:wool:14
minecraft:written_book:0:{title:TestBook,author:GuideNH}
minecraft:written_book:*:{title:TestBook,author:GuideNH}

Item Index Expressions

item_id accepts one NEI-style expression and item_ids accepts a YAML list of the same expressions. Each item_ids entry is independent; the page is linked when any entry matches. Whitespace combines terms, | combines alternatives, and , combines rules within one term.

  • minecraft:lava performs a case-insensitive partial registry-id match, so it also matches minecraft:lava_bucket.
  • <minecraft:wool:14> strictly matches one item and meta value.
  • ae2:white_paint_ball:*, :32767, and uppercase meta tokens such as :ANY are compatible strict all-meta forms.
  • 16384-16462,!16386 matches a metadata range while excluding 16386.
  • !minecraft:portal excludes a matching registry id.
  • r/^m\\w{6}ft$/ uses a Java regular expression against the registry id.
item_id: "minecraft:potion 16384-16462,!16386 | ae2:white_paint_ball:*"
item_ids:
  - minecraft:crafting_table
  - appliedenergistics2:item.ItemMultiMaterial:1
  - "minecraft:written_book:*:{title:TestBook,author:GuideNH},!minecraft:written_book:0"
  - "<minecraft:wool:14>"
  - wrench|hammer
  - "minecraft:potion 0-16,20-36,!28"
  - minecraft:diamond#Usage

In this example, whitespace combines conditions, , combines rules within one term, ! excludes a match, and | separates alternatives. The first expression therefore accepts potion metadata from 16384 through 16462 except 16386, or any metadata of ae2:white_paint_ball. The second expression demonstrates a wildcard item reference in a comma-separated expression with a reverse (!) rule. The last two entries show a metadata union with 28 excluded and an item mapping that opens the Usage heading anchor.

An optional #anchor suffix opens a matching page at a heading anchor. Exact item and explicit-meta mappings use the direct index first; expressions are evaluated only when needed.

Error Handling

If a page fails to parse, GuideNH creates an error page instead of crashing the guide. Invalid tags, ids, and attributes are reported inline as guide-rendered error text.