Include
Use an include to reuse content from another document or template. The host authorizes the exact source revision before SevenMark expands it.
Basic Include
Use a bare title to select a root document:
{{{#include
PageName
}}}
{{{#include
HeaderTemplate
}}}
{{{#include
CommonFooter
}}}Use a UUID for stable identity, or an explicit name for an exact parent scope:
{{{#include id:019a0000-0000-7000-8000-000000000001 }}}
{{{#include name:template:019a0000-0000-7000-8000-000000000002:HeaderTemplate }}}See document references for escaping and scope rules.
Include with Namespace
Specify the namespace of the included page using the #namespace parameter (default: document):
{{{#include #namespace="document"
PageName
}}}
{{{#include #namespace="file"
TemplateFile
}}}
{{{#include #namespace="category"
CategoryPage
}}}A reusable Template has a separate namespace from a same-title Document:
{{{#include #namespace="template" #name="Reader" Greeting}}}
[[template:Greeting | Open the template]]For a bare title, omitting #namespace selects the Document namespace. Explicit named references contain their own namespace. A UUID keeps its immutable identity; #namespace does not restrict the namespace of the document selected by that UUID. An include can reuse an ordinary document as well as a template.
The canonical values are document, file, category, template, user, and site. The first five retain their existing title-case spellings. Site accepts only site; a host's display name is not a namespace alias. A namespace and a title are separate parts of the address. #namespace="template" Greeting selects the title Greeting in the template namespace. Titles such as template:Greeting and 틀:Greeting keep their prefixes as literal title text; the include directive does not remove them. Browser URL namespace prefixes do not add source syntax.
The editor filters completion candidates when an include supplies an explicit named namespace. Without one, the picker can offer authorized documents from every namespace. Selecting a candidate inserts its UUID and preserves its identity.
Includes compose approved templates through multiple levels under the shared evaluation, depth, and expansion budgets. If an include repeats the same source revision and arguments in its active chain, that include displays an error and the surrounding content renders.
The included document's categories do not become categories of the host document. The host must supply the approved revision and current access decision. Missing and denied includes show the authored target with the same unavailable marker. They do not expose included content or resolved private identity. Hosts can supply a lookup link through the runtime navigation callback; the destination checks access.
Include with Parameters
Include elements support optional parameters that can be passed to the included content:
{{{#include #param1="value1" #param2="value2"
TemplatePage
}}}
{{{#include #title="Custom Title" #author="John Doe"
ArticleTemplate
}}}Parameters other than #namespace become variable bindings for the included document. For example, #title, #author, and #date can supply template values. Templates declare the accepted input names, types, and defaults. The #namespace selector is not passed as a template argument.
Templates declare inputs with #param and convert incoming text under that schema. A caller can put {{{#expr value}}} in an argument value to evaluate a scalar before passing it. List and Record arguments currently use JSON text; structured Content argument slots are not implemented. Include targets remain explicit document references. See the complete typed template example.
Namumark Include Macro
SevenMark also accepts NamuMark include calls as syntax sugar:
[include(틀:상위 문서, 문서명1=나무위키:문법 도움말)]The first argument becomes the include target, and key=value arguments become normal include parameters. Escape commas in parameter values with \,. The first argument is a document name, not a template-only command. For example, [include(틀:Greeting)] selects the ordinary document titled 틀:Greeting. Importers must keep that identity unless they explicitly move the source into a different namespace. To select a native template, use an explicit namespace or a canonical name:template:root:Greeting reference.
Input names follow the typed declaration rules: start with a letter or _, then use letters, digits or _. The names true, false and null are reserved. An argument needs key=value; an empty value is valid. If an imported name cannot be represented, the parser reports the complete include call as an error and retains its source. It does not shorten the key, rename it, or change the include target. The renderer shows that exact call in red and continues with the surrounding content. The diagnostic explains the invalid name.
Symbolic input names such as (년) and A~B are outside the supported NamuMark subset. SevenMark keeps its native input identifier rules. Use a Record input for data with arbitrary string keys. For example, declare fields: Record and read fields["(년)"]. The input name fields remains a valid identifier; callers supply its value as JSON text.
This support imports the include call, not arbitrary template-body substitution. @name@ and @name=default@ remain text. Convert the template to declared inputs and explicit output:
{{{#param name: String = "Reader"}}}
Welcome, {{{#expr name}}}.The caller's value takes precedence over the declared default. An explicit empty String stays empty. Use provided("name") when caller presence matters. The former #define directive is removed. Do not convert imported defaults to it.
Include Use Cases
Template Reuse
# Article Title
{{{#include #author="John Doe" #date="2024-01-15"
ArticleHeader
}}}
Main article content here...
{{{#include
ArticleFooter
}}}Common Sections
# Documentation Page
{{{#include
WarningBanner
}}}
## Content
Documentation goes here...
{{{#include
RelatedLinks
}}}Parameterized Content
{{{#include #name="Laptop" #price="$1200" #stock="5"
ProductCard
}}}
{{{#include #name="Mouse" #price="$30" #stock="20"
ProductCard
}}}Complete Example
# Programming Tutorial
{{{#include #topic="Programming" #level="Beginner"
IntroTemplate
}}}
## Variables and Data Types
Variables store data that can be used throughout your program...
{{{#include
CodeExampleTemplate
}}}
## Control Flow
Control flow determines the order in which code executes...
{{{#category
Programming
}}}
{{{#category
Tutorials
}}}Technical Details
Processing responsibilities
- The parser records a target reference and optional parameters.
- The directive body selects one target; it is not the included source itself.
- The host resolves and authorizes the exact included revision.
- The transform expands the approved source and applies its argument bindings.
- Before delivery, the host rechecks read access to each used dependency.
Parameter Syntax
Use the standard parameter format:
#paramName="value"- String parameter- Multiple parameters can be specified in any order
- Parameters are optional; simple includes work without them
Best Practices
- Give each template one clear purpose.
- Document the expected argument names and values.
- Pass the values needed by each occurrence.
- Use UUID references when the include must survive a move or rename.
Include vs Other Elements
- Include: Embeds content from other pages (supports parameters)
- Category: Assigns page to categories (no parameters)
- Redirect: Declares a destination for host navigation (supports
#namespace) - Media: Embeds images/files using
[[]]syntax