Macros
Use a macro as a short form for content or value output. Live time and statistics are browser widgets. Cached HTML stores their descriptors, rather than values that would become stale.
Time and date
| Source | Result |
|---|---|
[now] | Current viewer-local date and time |
[datetime] | The same display as [now] |
[date] | Current viewer-local calendar date |
[age(2000-02-29)] | Full calendar years since the date |
[dday(2026-12-25)] | D-Day today, D-N before the date, or D+N after it |
Generated: [now]
Today: [date]
Age: [age(2000-02-29)]
Event: [dday(2026-12-25)]The runtime samples one display instant when it mounts or updates the document. It uses the viewer's time zone unless the frontend supplies a display override. A February 29 birthday reaches its anniversary on March 1 in a non-leap year. Write a valid YYYY-MM-DD date. A future birth date shows an unavailable marker. Remaining days use calendar dates, rather than elapsed 24-hour periods. The frontend controls refresh; the markup does not start a timer.
The expression functions have a different lifetime. Use them when a calculation or branch needs a fixed value from the approved render context:
{{{#let generated = now()}}}
{{{#let event = date("2026-12-25")}}}
Generated: {{{#expr format_date(generated, "%Y-%m-%d %H:%M")}}}
Days remaining: {{{#expr days_between(today(), event)}}}These explicit function calls need the evaluation context. A display macro does not. The host must invalidate cached results that depend on a calculation clock. Live widget updates never change evaluated branches or document dependencies.
Live statistics
All public documents: [pagecount]
Ordinary documents: [pagecount(document)]
Templates: [pagecount(template)]
Registered users: [stat(user_count)]
Active yesterday: [stat(active_user_count, yesterday)]
Created yesterday: [stat(documents_created, yesterday, document)]
Created on a date: [stat(documents_created, 2026-11-01, document)]
Created in a range: [stat(documents_created, 2026-11-01, 2026-12-01, template)]
Active in a range: [stat(active_user_count, 2026-11-01, 2026-12-01)]The renderer emits a typed request descriptor. The browser host batches these requests, fetches current public values from V7, and fills the placeholders. SevenMark does not query a service. Missing, failed, or unavailable data remains unavailable; a successful zero displays zero.
[stat(document_count)] is the full form of [pagecount]. [stat(document_count, document)] selects one namespace. [stat(user_count)] counts registered accounts. [stat(active_user_count, today)] counts active users for the current site day. [stat(documents_created, today, document)] counts initial document creation for the current site day. Periods accept today, yesterday, one YYYY-MM-DD date, or two comma-separated dates. A range includes its start date and excludes its end date. Dates must be valid Gregorian dates in years 0001 through 9999. The end must be after the start. The namespace is optional for document counts and creation counts.
Relative periods remain symbolic in cached HTML. V7 resolves all periods at fetch time using the site calendar and counting policy. It does not use the viewer's time zone or the date when the renderer created the HTML.
The host controls the maximum period. V7 defaults to 366 calendar days and publishes the configured limit in editor capabilities. A longer valid period is unavailable without preventing other statistics from loading. Historical counts follow current public visibility; they are not immutable snapshots.
Native namespace names are document, file, category, template, user, and site. Site's display name is host metadata and is not a source alias. An empty argument selects the total. An unknown namespace is an error. NamuMark namespace aliases are accepted by its sugar parser and lowered to native names.
Use the site functions only when a calculation or condition requires an approved snapshot value:
{{{#let total = site.document_count("document")}}}
{{{#if total > 0 :: Documents available: {{{#expr total}}} }}}That result becomes part of the cached render. The host must validate its used fact versions and expiry before reuse. Prefer display macros for live values.
Local values
Use #let for an immutable local and #param for a typed template input:
{{{#let projectName = "SevenMark"}}}
{{{#param release: String = "8.0.0"}}}
Welcome to [var(projectName)] release [var(release)].[var(name)] emits a scalar as text. Use its bare name inside expressions. A String never becomes markup because a variable macro emitted it.
{{{#let baseUrl = "https://example.com"}}}
{{{#let apiUrl = concat(baseUrl, "/api/v1")}}}
API endpoint: {{{#expr apiUrl}}}Bindings follow document order. Branches and each loop iteration have local scopes. An undeclared name produces a diagnostic and stops evaluation.
Content markers
| Source | Purpose |
|---|---|
[br] | Insert a hard line break |
[clear] | Clear floats |
[toc] | Display the document's table of contents |
[fn] | Display collected footnotes |
[anchor(name)] | Create a named anchor |
[anchor(details)]
First line[br]Second line
[[#details | Return to details]]
[fn]Use explicit footnote content with the native #fn directive. The [fn] macro only places the collected footnote list. See footnotes.
Table of contents
Write [toc] on its own line where you want the table of contents:
[toc]
# Overview
Introduction.
## Details
More information.The table lists the final heading numbers and plain-text titles. Each item links to its heading. Readers can collapse the table and open a folded section by following its link. A document without headings produces no table.
Top-level includes share the host's heading numbers. An include inside a table or another container has its own heading scope and local table. A section preview lists only the headings that the preview displays. Footnote bodies and editor notes do not become heading labels. A marker inside a heading or link produces no table.
The renderer charges table generation and each repeated table to the existing work and expansion budgets. The browser host supplies the table's interface label in its current language.
The NamuMark sugar [목차] becomes the same native node. The formatter writes [toc]. The marker has no arguments.