blob: 677bf6da673d3a9153beb179ea2bc0c9640e97ef [file] [view]
# OINK features used by HugeGraph
This is the authoring and integration reference for the OINK version pinned in
`go.mod`. Use native Markdown and public theme interfaces before adding a local
renderer, template, script or stylesheet. Upgrade mechanics and override review
belong in [oink-upgrade.md](oink-upgrade.md).
## Choose the component by the content
| Content | Native form | Existing HugeGraph example |
| --- | --- | --- |
| Parallel entry points | Unordered link list + `{.cards}` | [Server installation choices](../content/en/docs/quickstart/hugegraph/hugegraph-server.md) |
| Actions readers perform in order | Ordered list + `{.steps}` | [Local preview](../content/en/community/documentation.md) |
| Equivalent commands or configurations | Adjacent fences with `{tab="…"}` | [Server serializers](../content/en/docs/quickstart/hugegraph/hugegraph-server.md) |
| Annotated directories | `filetree` fence; `wrap=true` for complete comments | Use for actual directory layouts, keeping comments short |
| Parameter definitions with direct search targets | Table + `{.fields}` | [Server configuration](../content/en/docs/config/config-option.md) |
| Technical comparisons and catalogs | Table + `{.wide}`; optional `.expand` | [RocksDB configuration](../content/en/docs/config/config-backend-rocksdb.md) |
| Architecture, dependencies or a decision flow | `mermaid` fence | [Server installation flow](../content/en/docs/quickstart/hugegraph/hugegraph-server.md) |
| Text hierarchy | `markmap` fence | [Server module outline](../content/en/docs/quickstart/hugegraph/hugegraph-server.md) |
| Quantitative comparison | `echarts` fence with its source table and test conditions | Benchmark content only when the chart clarifies a comparison |
| Screenshots inside an explanation | `gallery` fence | [Hubble screenshots](../content/en/docs/quickstart/toolchain/hugegraph-hubble.md) |
| Published release facts | `release-card` | [1.7.0 notes](../content/en/docs/changelog/hugegraph-1.7.0-release-notes.md) |
| Version or event progression | Definition list + `{.timeline}` | [Runtime transition in 1.8.0 notes](../content/en/docs/changelog/hugegraph-1.8.0-release-notes.md) |
| A release entry with dates or category labels | Heading + `{.update}` | [Compatibility highlights](../content/en/docs/changelog/hugegraph-1.8.0-release-notes.md) |
Automatic section cards already come from `params.ui.section_index: cards` and
child-page metadata. Keep that metadata accurate instead of duplicating a
section's child list. Handwritten cards suit cross-section recommendations.
Keep prerequisites and warnings visible; use a native `> [!DETAILS]- Title`
callout for supplemental detail.
## Common authoring patterns
Block attribute lines must touch the list, table or image they describe.
Fence attributes belong on the opening fence line, after the language.
The site's `markup.goldmark.parser.attribute.block: true` enables these markers.
### Cards and steps
```markdown
- [Server](/docs/quickstart/hugegraph/hugegraph-server/) — Run the database service.
- [Hubble](/docs/quickstart/toolchain/hugegraph-hubble/) — Explore and query a graph.
{.cards}
1. Install the required toolchain.
1. Clone the documentation repository.
1. Run the local preview.
{.steps}
```
OINK supports compact presentation for short lists:
`{.cards .td-cards-list}` and `{.steps .td-steps-compact}`.
Select them where each item is brief; longer descriptions and nested commands
benefit from the regular layout. Cards are unordered choices; Steps express order.
### Code and tabs
Use standard language-labelled fences, including `text` for plain text. Global
Hugo highlighting supplies inline line numbers. Ordinary snippets do not need a
filename or title bar. For one short standalone command, use:
````markdown
```bash {class="td-code-command" lineNos=false}
scripts/hugo.sh server
```
````
Command strips require exactly one line, no line numbers and no `collapse`.
Keep `lineNos=false` explicit because this site's global highlighting enables
line numbers.
Adjacent examples of the same settings in supported formats can become tabs
without a custom container:
````markdown
```json {tab="JSON"}
{"port": 8080}
```
```yaml {tab="YAML"}
port: 8080
```
````
Give a synchronized tab set a meaningful `group` on the first fence and a stable
`value` on every fence only when shared selection and persistence help readers.
For long code, choose enough initially visible lines for the task (usually 5–9);
do not fold short examples. Folding must preserve the complete copied source.
See [upstream code](https://oink.pgsty.com/docs/components/code/) and
[Tabs](https://oink.pgsty.com/docs/components/tabs/) for supported parameters.
### FileTree and technical tables
````markdown
```filetree {title="Store directories" wrap=true}
data/
m/ # schema store: property keys and labels
g/ # graph store: vertices, edges and indexes
```
````
Use `wrap=true` when readers need complete comments; keep the compact default for
short comments. Do not recreate wrapping with global CSS.
```markdown
| Option | Default | Meaning |
| --- | --- | --- |
| `auth.token_expire` | `86400` | JWT lifetime in seconds. |
{.wide .expand}
```
`.wide` preserves technical identifiers while giving descriptions room.
`.expand` adds OINK's table reader in HTML, including keyboard and close behavior;
Print, Markdown and RSS keep the complete static table. Ordinary tables should
remain compact. Existing `.td-table--wide` markers are compatible, so unrelated
pages and historical source branches need no mechanical migration.
Do not combine `.expand` with `.fields`, which renders a definition list.
See [upstream tables](https://oink.pgsty.com/docs/components/table/).
### Searchable parameter definitions
Use `.fields` for a genuine parameter reference: the first column names the
field, the last describes it, and any middle columns become labelled metadata.
The native renderer creates a definition list and stable `field-…` anchors;
local search can open the corresponding definition directly.
```markdown
| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `server.port` | int | `8080` | Port used by the service. |
{.fields meta="type default"}
```
`meta` explicitly assigns roles to middle columns; omit it to keep their
authored labels. The `required` role treats every nonempty cell as required,
so do not assign it to a column containing both `true` and `false` values.
Do not combine `.fields` with `.expand` or `.full-width`. Keep matrices,
environment-variable comparisons and ordinary prose tables as tables.
Latest Server, PD and Store parameter pages adopt this form selectively.
Historical source tables keep their existing structure and use the current
theme and search engine. Do not mechanically convert every table. Where an
existing field anchor must be preserved, use native `fields` / `field`
shortcodes with the field's explicit `id`, then test a real search click and
fragment scroll in both languages. Also check mobile, Duo View and the complete
Print/Markdown output. See [upstream fields](https://oink.pgsty.com/docs/components/fields/).
### Release cards
The release box is a native shortcode, not copied HTML. Its only source of
version and repository facts is an exact GitHub release-tag URL in front matter:
```yaml
---
title: HugeGraph 1.7.0 Release Notes
date: 2025-11-16
release_url: https://github.com/apache/hugegraph/releases/tag/1.7.0
---
```
```text
{{< release-card >}}
```
The shortcode takes no parameters. The tag supplies the displayed version,
the page's `date` supplies the release date, and OINK generates release,
source tarball/ZIP and repository links locally. Confirm the URL and date against
the actual release; do not point `release_url` at the project's download page.
The card complements HugeGraph's ASF download, signature and checksum guidance.
It also has readable Print, Markdown and RSS output.
See [release authoring](https://oink.pgsty.com/docs/write/releases/).
### Timelines and update headings
Use a definition list for a real progression of versions or dated events. Keep
ordered instructions as Steps and comparisons as tables. Timeline adds only CSS;
the marker and event text remain readable in Print and Markdown.
```markdown
1.7.0
: The last release supporting Java 11.
1.8.0
: Server, PD and Store require Java 17 for runtime and source builds.
{.timeline}
```
The `{.timeline}` line must touch the final definition. A blank line detaches the
marker and triggers an upstream warning. Multiple definitions under one marker
group related changes without repeating the version or date.
Use `.update` on an existing release heading when category labels or a known
date help readers scan the changes:
```markdown
### Key Breaking Changes & Compatibility {.update tags="Gremlin, Configuration, Client"}
```
The heading keeps its original text, anchor, TOC entry and search title. `date`
is optional and accepts a quoted calendar value such as `date="2025-11-16"`;
year and month precision are also supported. Do not invent a release date for
work in progress or repeat metadata under every ordinary heading. The native
metadata line retains its date and labels in Print, Markdown and RSS.
## Diagrams and images
Use Mermaid for relationships and flows, Markmap for text outlines, and ECharts
for numerical comparisons. OINK gives existing Mermaid diagrams a shared
reader with zoom/pan, source and SVG access; authors keep the same fence syntax.
Keep required diagram resources local and let OINK load runtimes only on pages
that use them. Enable another runtime only when real content needs it.
Published Markmap content is limited to text outlines and code. Its front matter
allows only a finite, nonnegative `levelGap`; active images, links,
raw HTML and other front matter fail the site's validator. ECharts needs its
source table, units and test conditions alongside the chart. Keep options within
the URL, HTML and CSS sinks accepted by `dist/validate-site-output.py`;
`$fn:` colour callbacks require a reviewed output contract before adoption.
### Image loading and albums
Use [Gallery](https://oink.pgsty.com/docs/components/gallery/) for screenshots
within a tutorial. Give images meaningful alternative text and captions; keep
assets local and avoid repeating the same screenshot at full width.
Use [Expo](https://oink.pgsty.com/docs/write/expo/) only for a standalone album:
a section with `type: expo` and `cascade: {type: expo}`, with leaf bundles
containing `index.md` and local images. Resource metadata owns captions,
credits and ordering. Add the matching Chinese bundle when adopting an album.
Expo supplies wall, masonry and seamless layouts. Processable local images get
WebP previews fitted within 960 × 960 pixels when either dimension exceeds 960
or the source is a GIF; otherwise they reuse the original. The viewer retains
the original, uses its cached preview while loading, and preloads one neighbor
on either side. The first four album tiles load eagerly (the first with high
priority), later tiles lazily; layout batches geometry work and uses known sizes.
Gallery has native lazy loading, asynchronous decoding and the shared viewer;
Expo's generated previews, neighboring-original preload and album layout work
do not apply to Gallery. Supply intrinsic `width` and `height` on standalone
Markdown images to reserve space; those attributes do not compress the file.
Inspect generated HTML and measure bytes/timing before claiming an improvement.
Consult `layouts/_partials/expo/items.html` in the module version pinned by `go.mod`.
### Video, audio and external references
For a real local recording, use a standalone Markdown image whose destination
is the local media file; OINK recognizes supported video/audio extensions and
renders its media player. Provide an informative title, captions or a transcript
where needed, and keep commands or essential instructions readable without
playback. Do not create a recording solely to demonstrate the component.
OINK progressively enhances the HTML media element with playback, seeking,
speed and volume controls; without JavaScript, native controls remain available.
Check keyboard operation, captions, mobile playback and the linked Print/Markdown
fallback. Keep autoplay off for instructional media.
YouTube, Bilibili and Vimeo destinations render as external link cards. Keep
`params.video_embeds: []`: a reader follows the link to watch on the provider's
site. Do not add remote posters, third-party iframes or loosen CSP to turn these
cards into embedded players. Local playback does not require enabling embeds.
External direct media files (for example, an HTTPS MP4 or MP3) must use ordinary
links rather than image syntax; the output validator rejects off-site media sources.
For an attributed social reference, the pinned theme uses a native
`> [!SOCIAL]` callout. The earlier `social` shortcode is retired; preserve the
source link and author rather than copying a platform widget. Use these cards
only when a real quoted post adds context. Interactive maps remain disabled;
an ordinary location link is sufficient unless actual content justifies a map.
### Terminal recordings
Use the optional [Asciinema recorder](https://oink.pgsty.com/docs/components/asciinema/)
when timing or interactive output helps, such as a startup walkthrough. Keep
commands copyable. A simple version check needs no player.
Record a real session with `asciinema rec demo.cast`, run the commands and exit.
Store the reviewed recording in `static/casts/`, then use:
```text
{{< asciinema file="/casts/demo.cast" title="Startup walkthrough" speed="1" >}}
```
Recordings contain terminal text and timestamps. Review them for credentials and
private output. Re-record when commands/output change; change `title` or `speed`
only for presentation. Resize the terminal before recording: overriding player
`cols`/`rows` can crop it. Check desktop and mobile playback.
The recorder is an authoring tool, not a build dependency.
## Native Duo View
OINK calls the feature **Duo View** in English and **双列视图** in
Chinese. Use **Sync Scroll / 同步滚动** for its optional approximate heading
alignment. The configuration and action IDs remain `params.ui.compare` and
`compare_translations`; do not rename those public identifiers.
HugeGraph enables the native feature globally. OINK discovers only real,
same-origin HTML translations of Docs, Book and Blog pages, loads the peer page
on demand, and hides the entry when no valid translation exists. Do not add a
parallel route map, copied reader template, machine-generated placeholder
translation or site-specific comparison controller. Align heading IDs only on
important pages where a real Sync Scroll problem is observed.
Site-level integrations loaded from hooks must stand down when
`window.OinkComparePane` is true. Content runtimes remain active so tables, tabs,
diagrams, code controls and fragment links continue to work inside each pane.
## Site integration and output checks
- `hugo.yaml` owns appearance, search and output configuration. Six style
presets are selected with `params.ui.preset_menu: [paper, slate, github, ink, news, terminal]`;
Slate remains the default. Boolean `true` offers only Paper/Slate; GitHub, Ink,
News and Terminal are experimental. Style and light/dark mode are independent;
OINK owns saved preferences. Keep purple navigation branding separate from the
reading area's native preset colours.
- Header and mobile drawers use the public `shell/appearance-menu.html` partial.
Sidebar persistence uses `OinkSidebar`; AI integration uses the public
search-tail API. Keep HugeGraph consent, version/language scope and local
availability behavior in their existing hooks/adapters.
- The top navigation retains the native shortcut-help entry and opens OINK's
complete panel. Use its native key definitions and preference control, without
a second shortcut registry. Check input focus, Chinese IME composition and
Escape handling; disabling single-key shortcuts must leave Ctrl/Cmd+K usable.
- Native reading width (`-` / `=`), rich copy (`params.ui.rich_copy`) and browsing
history improve long-page reading without local controllers. Rich copy uses
semantic HTML with the print palette while preserving plain text; verify code
copy separately. History stores up to 100 page paths, query strings, titles and
timestamps in local storage, scoped to the site's base path, with filtering,
individual deletion and clear controls. It makes no remote history request.
Turning off single-key shortcuts does not disable history. Check saved width
and history across languages, archived paths and Duo View without recording
comparison panes as extra visits.
- Local search uses native BM25 with `params.offline_search_index: content`, so
configuration names, error messages and body-only terms remain searchable in
both languages without a separate browser-built Lunr index. OINK loads the
current language's index on demand and splits it only above its native 2 MiB
threshold. A split body up to 8 MiB loads in the background; larger bodies or
Save-Data require the reader's explicit load action. Do not force splitting
for a small index or duplicate the engine. Keep accurate titles, descriptions
and keywords. Run `tests/e2e/search-ranking.spec.js`: all 24 metadata and 11
independent full-text ranking/click contracts remain mandatory, alongside
field-anchor checks. Do not add keywords or boosts merely to satisfy queries.
- Blog sections provide default covers and reading-time metadata; articles own
their real tags, categories and series order. Confirm authorship before adding
an author profile. `blog_index: cards` is a card index; it is distinct from
`blog_index: gallery` with `blog_gallery.mode: cards` (a masonry gallery).
Keep the current index until article imagery justifies another layout.
- Keep English/Chinese content and stable public routes aligned. Component styling
is not a reason to change executable commands or historical benchmark claims.
- Check affected HTML interaction, keyboard/mobile behavior and Print/Markdown
fallbacks. Check RSS where the component appears in a feed. A successful Hugo
render alone does not establish compatibility.
## Styles and runtime boundaries
Site styles are plain CSS in `assets/css/project.css`; OINK publishes this after
the theme bundle. The community roster loads its own plain CSS only where used.
There is no Sass compiler or Extended-edition requirement. Use native custom
properties and public components before adding a style or script override.
The blog's copy-link bar uses native `share: [copy]`, scoped by the configuration
cascade. Leave global sharing disabled; the native bar supplies accessible copy
feedback without a custom template or third-party share scripts.
The small `css/bundle.html` adapter preserves the native layer order and maps
reviewed Bootstrap SVG data URIs to the existing local control images through
`data/oink_css_assets.json`. Unknown data URIs fail the build and require review;
never relax ASF CSP or the output validator to make a theme upgrade pass.
Keep published CSS under `/css/` so relative fonts and control images work in
the latest and archived version directories.
The theme supplies its own navigation, version menus, tabs and search runtime.
Do not rely on `window.bootstrap`, Bootstrap data attributes or `window.lunr`.
Native component engines load near the viewport; tests must scroll a component
into view before asserting it is interactive. Markmap renders SVG text through
local ESM modules, and ReDoc uses a same-origin frame.
The exact [module pin](../go.mod), its downloaded `CHANGELOG.md` and tagged
source are the reference for the current site. Consult that release before
extending a component; the upstream website may describe a newer version.