Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Documentation Monster Template SyntaxNew to Visual Studio Code? Get it now.
Documentation Monster Template Syntax

Documentation Monster Template Syntax

Rick Strahl

|
1 install
| (0) | Free
Syntax highlighting and embedded C# support for DocMonster HTML templates (.dmhtml, .wwscript, .wwshtml).
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Documentation Monster Template Syntax

VS Code language extension providing syntax highlighting and embedded C# support for DocMonster HTML templates.

Features

  • Full HTML syntax highlighting (inherits from VS Code's built-in HTML grammar)
  • C# syntax highlighting inside DocMonster template delimiters
  • Embedded C# language support (bracket matching, comment toggling, auto-closing pairs)
  • Automatic association for .dmhtml, .wwscript, and .wwshtml files

Delimiter Forms

Delimiter Purpose Example
{{ expr }} HTML-encoded output {{ Topic.Title }}
{{! expr }} Raw/unencoded output {{! Helpers.Markdown(Topic.Body) }}
{{: expr }} Explicit HTML-encoded output {{: Topic.Abstract }}
{{% code }} C# statement block {{% if (!string.IsNullOrEmpty(Topic.Keywords)) { }}

Multi-line Code Blocks

{{%
    var name = "Rick";
    if (string.IsNullOrEmpty(name)) { }}
        <div>{{ name }}</div>
{{% } }}

File Associations

  • .dmhtml, .wwscript, .wwshtml files — automatically recognized via the extension's language contribution
  • .html files — add workspace files.associations in .vscode/settings.json:
{
  "files.associations": {
    "*.html": "docmonster-template"
  }
}

Installation

From VSIX file (recommended for sharing)

  1. Build the VSIX (see Building a VSIX below)
  2. In VS Code, open the Command Palette (Ctrl+Shift+P)
  3. Run Extensions: Install from VSIX...
  4. Select the .vsix file

Or from the command line:

code --install-extension docmonster-template-syntax-0.1.0.vsix

Manual folder install

Copy the extension folder to:

%USERPROFILE%\.vscode\extensions\docmonster-template-syntax

Then reload VS Code.

Development mode

  1. Open the docmonster-template-syntax folder in VS Code
  2. Press F5 to launch an Extension Development Host
  3. Open template files to verify highlighting

Building a VSIX

The extension uses @vscode/vsce to package into an installable .vsix file.

Prerequisites

npm install -g @vscode/vsce

Package

cd docmonster-template-syntax
vsce package

This produces docmonster-template-syntax-0.1.0.vsix in the extension folder.

Scope and Limitations

This extension provides:

  • Syntax coloring for HTML and embedded C# in template delimiters
  • Embedded-language editor behavior (bracket matching, comments) inside C# regions

This extension does not provide:

  • C# IntelliSense or autocompletion inside template regions
  • Roslyn diagnostics, rename, or semantic symbol awareness
  • Full language server support for mixed HTML/C# template editing

These would require a custom language server or virtual-document projection design in a future phase.

TextMate Scopes

Region Scope
{{ }} delimiters punctuation.section.embedded.begin/end.docmonster
{{! }} delimiters punctuation.section.embedded.begin/end.docmonster.raw
{{: }} delimiters punctuation.section.embedded.begin/end.docmonster.encoded
{{% }} delimiters punctuation.section.embedded.begin/end.docmonster.code
Expression content meta.embedded.inline.csharp
Code block content meta.embedded.block.csharp
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft