Skip to content

Links and Media

SevenMark uses double brackets for wiki links, external links, anchors, and file media.

sevenmark
[[target]]
[[target | display]]
[[#style="..." || target | display]]

The optional parameter prefix must end with ||. Without ||, the bracket body is parsed as the target text itself.

Parsing is target-first: after an optional parameter prefix, the parser reads the first unescaped | as the display separator and the last unescaped # in the target as the anchor separator. Escaped separators stay in the target text.

Wiki Pages

Plain targets are document links:

sevenmark
[[HomePage]]
[[API Reference | API documentation]]
[[Tutorial | Getting started guide]]

Use document: when you want to make the document namespace explicit:

sevenmark
[[document:Guide | Guide page]]

Anchors

Append an anchor to a document target with #, or start the target with # for an anchor in the current document.

sevenmark
[anchor(installation)]
## Installation

[[Guide#installation | Jump to installation]]
[[#installation | Jump within this page]]

If a literal # belongs in the title, escape it:

sevenmark
[[C\# Guide | C# Guide]]

If several unescaped hashes appear in the target, the last one starts the anchor:

sevenmark
[[Guide#install#linux | Linux install anchor]]

Category and User Pages

category: and user: are wiki namespaces:

sevenmark
[[category:Programming Languages | Category page]]
[[user:Alice | Alice's page]]

External URLs

Targets that start with http:// or https:// are external links. Other schemes are not rendered as external URLs.

sevenmark
[[https://example.com]]
[[https://rust-lang.org | Official Rust website]]
[[https://github.com/rust-lang/rust | Rust GitHub repository]]

If no display text is provided, the target itself is displayed.

File Media

Use file: targets for file media:

sevenmark
[[file:image.png | Alt text for image]]
[[file:screenshot.jpg | Application screenshot]]
[[file:document.pdf | PDF document]]
[[file:video.mp4 | Video file]]

The file title after file: is resolved by the preprocessing and postprocessing stages. Link targets and file media are separate AST nodes: links become LinkElement, and file media becomes MediaElement.

Namumark File Syntax

For migration compatibility, SevenMark also accepts Namumark file brackets and maps them to the same MediaElement AST:

sevenmark
[[파일:image.png]]
[[파일:image.png|width=120&height=80&object-fit=cover]]
[[파일:#1f1e33.jpg#|width=100]]
[[Page|[[파일:logo.png|width=25]]]]

The | section on 파일: media is interpreted as Namumark-style image parameters separated by &. Valid key=value entries become normal SevenMark media parameters such as #width, #height, and #object-fit. A file title that starts with # may use Namumark's trailing # disambiguation form; the trailing marker is removed from the stored file title.

Linked Files

To make file media clickable, keep the file: target as the media source and add a link parameter in the prefix:

sevenmark
[[#url="https://example.com" || file:logo.png | Logo]]
[[#document="Guide" || file:guide-cover.png | Guide cover]]
[[#category="Rust" || file:rust-logo.png | Rust category]]
[[#user="Alice" || file:avatar.png | Alice]]

Media link parameters are resolved in this priority order:

sevenmark
#url > #document > #category > #user

Add #anchor to append a fragment to the selected media link:

sevenmark
[[#document="Guide" #anchor="installation" || file:guide-cover.png | Installation]]

These parameters are media wrapper links. On a normal link element such as [[#url="https://a.example" || Guide | Label]], the target remains Guide; the #url parameter does not override the link target.

Theme-aware Files

File media can use #theme="light" or #theme="dark" in the parameter prefix. The renderer exposes valid theme values as data-theme="light" or data-theme="dark" on the media wrapper; other values are ignored.

sevenmark
[[#theme="light" || file:logo-light.svg | Light logo]]
[[#theme="dark" || file:logo-dark.svg | Dark logo]]

This is useful when the frontend chooses which file to show in light and dark color schemes.

Parameters

Parameters can be applied before the target by ending the parameter prefix with ||.

sevenmark
[[#style="float:right; width:180px" || file:sample.png | Example]]
[[#class="external-doc" || https://example.com/docs | Docs]]
[[#theme="dark" || file:logo-dark.svg | Dark logo]]

Common renderer parameters include #style, #class, and #dark-*. For file: media, #theme="light" and #theme="dark" provide a dedicated theme hint.

If the prefix does not contain ||, it is not a parameter prefix:

sevenmark
[[#style="color:red" Guide | The target includes the #style text]]

Backslash escapes the next character inside bracket syntax, so \|, \#, and \] can be used when those characters should be literal target or display text.

Link targets are not parsed recursively inside link or media display text. Media targets are allowed in link display content so Namumark linked-image syntax can map to existing link and media AST nodes without creating a dedicated compatibility AST.

In Tables

sevenmark
{{{#table
[[#head [[Name]] [[Image]] [[Link]]]]
[[[[John]] [[[file:john.jpg | John's photo]]] [[[https://john.com | Profile]]]]]
}}}

In Lists

sevenmark
{{{#list #1
[[Profile images:]]
[[[[file:avatar1.png | User 1]]]]
[[[[file:avatar2.png | User 2]]]]
[[Documentation: [[https://docs.example.com | Official docs]]]]
}}}

External Media Embeds

Provider embeds still use provider parameters such as [[#youtube #id="..."]]. For YouTube, Spotify, Discord, and related embeds, see External Media Embeds.