Skip to main content

What is Conceptual Documentation?

Conceptual Documentation is DotNetDocs’ system for enriching API reference documentation with rich, context-aware content that goes beyond what XML documentation comments can provide. While XML comments describe what an API element is, conceptual documentation explains how to use it effectively. Conceptual documentation is inspired by best practices from major documentation platforms like Microsoft Learn, Read the Docs, and Mintlify. It brings the power of rich, structured content to your .NET projects. Conceptual content is stored in separate .mdz files organized alongside your code, allowing technical writers and developers to collaborate on comprehensive documentation without cluttering source files.
The .mdz file extension was chosen to avoid being picked up by documentation platforms that autiomatically look for .md or .mdx files. It does not stand for anything in particular, except that if you have the file index.md and index.mdx and index.mdz in the same folder, the index.mdz file will appear last in the list.

How Conceptual Documentation Works

DotNetDocs follows a two-phase documentation pipeline:
1

XML Extraction

The AssemblyManager extracts documentation from XML comments in your compiled assemblies, populating basic API metadata like summaries, remarks, parameters, and return values.
2

Conceptual Loading

The DocumentationManager loads conceptual content from .mdz files in the configured ConceptualPath directory, enriching the documentation model with usage guides, examples, best practices, patterns, and considerations.
These two content sources are merged into a unified documentation model that renderers (like MintlifyRenderer) transform into beautiful, comprehensive documentation sites.

Configuration

Enabling Conceptual Documentation

Conceptual documentation is enabled by default in ProjectContext:

Configuration Properties

string
default:"conceptual"
The directory where conceptual documentation files (.mdz) are stored, relative to the documentation root.
bool
default:"true"
When true, DotNetDocs generates placeholder files for new types and loads existing conceptual content. When false, only XML comments are processed.
bool
default:"true"
Controls whether placeholder content is included in the final documentation. See Placeholders section below.

Conceptual Documentation Sections

DotNetDocs supports seven distinct conceptual sections, each with a specific purpose. These sections are available at three levels: namespace, type, and member.

Available Sections

File: summary.mdz Level: Namespace only Purpose: Brief description of what the namespace contains and its purposeThis section is only available at the namespace level since types and members already have summaries from XML <summary> tags.
File: usage.mdz Level: Namespace, Type, Member Purpose: Explains how to use the API elementUsage documentation provides step-by-step guides for common scenarios. This is where you explain HOW developers should interact with your API.
File: examples.mdz Level: Namespace, Type, Member Purpose: Concrete code examples showing the API in actionExamples should be complete, runnable code snippets that demonstrate real-world usage patterns.

Advanced Example

File: patterns.mdz Level: Namespace, Type, Member Purpose: Common usage patterns and architectural guidancePatterns documentation explains recurring solutions and architectural approaches.
File: considerations.mdz Level: Namespace, Type, Member Purpose: Important notes, gotchas, performance, and security considerationsThis section highlights important things developers need to know before using the API.

File Organization

Conceptual documentation files follow a hierarchical folder structure that mirrors your code organization:

Path Construction

The DocumentationManager constructs file paths based on the fully qualified names of your types:
  • Namespace: conceptual/{Namespace}/
  • Type: conceptual/{Namespace}/{TypeName}/
  • Member: conceptual/{Namespace}/{TypeName}/{MemberName}/
Dots in namespace names are converted to directory separators. For example, System.Text.Json becomes conceptual/System/Text/Json/.

Placeholders and the ShowPlaceholders Property

When ConceptualDocsEnabled = true, DotNetDocs automatically generates placeholder files for any conceptual sections that don’t exist yet. These placeholders help you identify documentation gaps and provide a starting point for writing.

Placeholder Format

Placeholder files include a special TODO comment marker:

Controlling Placeholder Visibility

The ShowPlaceholders property controls whether placeholder content appears in your final documentation:
When to use: During development to see documentation gaps and track progress.Result: All conceptual content loads, including placeholders. You’ll see placeholder sections in your generated documentation.

How Placeholder Detection Works

The DocumentationManager.IsTodoPlaceholderFile() method checks if a file starts with the TODO marker:
The TODO marker must be on the first non-empty line of the file to be recognized as a placeholder. Once you start customizing content, delete the TODO comment so DotNetDocs knows the file contains real documentation.

Using Markdown to Override Titles

Conceptual documentation files support full Markdown syntax, including headers. Renderers respect the structure of your Markdown, allowing you to override default section titles and organize content hierarchically.

Default Titles

By default, renderers use section names as titles:
Rendered as: A section titled “Usage” with your content

Custom Titles with Markdown Headers

Add your own headers to customize the title and create subsections:
Rendered as: Custom “Getting Started with DocumentationManager” title with “Basic Configuration” and “Processing Assemblies” subsections

Multi-Level Organization

Create deep hierarchies for complex topics:

Best Practices for Markdown Headers

Use Semantic Levels

Start with ## (H2) for main titles and nest logically with ### (H3) and #### (H4) for subsections.

Be Consistent

Use the same header style across all conceptual files in your project for a cohesive documentation experience.

Avoid H1

Reserve # (H1) for page titles. Start conceptual content with ## (H2) to maintain proper document hierarchy.

Include Code Fences

Use proper code fences with language identifiers for syntax highlighting: ```csharp

Including HTML and Components with noescape

Conceptual documentation often needs to include rich HTML content, JSX components, or other markup that should not be escaped. DotNetDocs provides the ```noescape code fence specifically for this purpose.

The Problem: HTML Gets Escaped

By default, the MarkdownXmlTransformer escapes HTML tags in your conceptual content to prevent conflicts with Markdown rendering. This is useful for XML documentation comments, but problematic when you want to include actual HTML or components:

The Solution: noescape Code Fences

The noescape code fence tells the transformer to pass content through without escaping and without code fence markers:
Result: The HTML content is included in the output exactly as written, allowing components to render properly.

How It Works

When the MarkdownXmlTransformer processes conceptual content:
  1. Regular content: HTML tags are escaped (<&lt;, >&gt;)
  2. Code fences: Content is preserved with backticks for syntax highlighting
  3. noescape fences: Content is extracted and passed through unchanged
From MarkdownXmlTransformer.cs:750-773:

Use Cases

Include Mintlify’s special components in your conceptual documentation:
Embed custom HTML when your renderer supports it:
Use callout components without worrying about escaping:
Create multi-step guides with structured components:

Best Practices

Verify Component Support

Ensure your renderer (e.g., MintlifyRenderer) supports the components you’re using. noescape only prevents escaping—rendering is up to your output format.

One Component Per Fence

For clarity, use separate noescape blocks for distinct components rather than grouping multiple components together.

Validate HTML

The transformer doesn’t validate HTML. Ensure your markup is well-formed to avoid rendering issues.

Mix with Markdown

You can freely mix noescape blocks with regular Markdown content in the same file—only the content inside noescape fences is unescaped.

Example: Complete Conceptual File

Here’s a real-world example mixing Markdown and components:

Technical Details

The noescape feature is implemented in the EscapeRemainingXmlTags method of MarkdownXmlTransformer:
  • Detection: Checks for noescape immediately after the opening ``` (within the first 20 characters)
  • Extraction: Skips the noescape keyword and any following newline, then extracts content up to the closing ```
  • Processing: Appends the content directly to the output without modifications
  • Preservation: Regular code fences and inline code (single backticks) are preserved with their delimiters
The noescape functionality only applies to conceptual documentation properties that go through the MarkdownXmlTransformer. It does not affect XML documentation comments, which always have HTML escaped for safety.

Creating Conceptual Documentation

Automatic Placeholder Generation

When you process an assembly with ConceptualDocsEnabled = true, DotNetDocs automatically creates placeholder files:
After running, you’ll find a complete folder structure in your conceptual/ directory with placeholders for all sections.

Manual Placeholder Generation

Generate placeholders without running the full pipeline:

Customizing Conceptual Content

To customize a placeholder:
  1. Open the .mdz file in your preferred Markdown editor
  2. Delete the TODO comment from the first line
  3. Replace the placeholder content with your documentation
  4. Save the file
The next time you process your assembly, DotNetDocs will load your customized content instead of the placeholder.

Workflow Example

Here’s a complete workflow for adding conceptual documentation to a project:
1

Generate Placeholders

2

Review Generated Structure

3

Customize Priority Sections

Edit the most important conceptual files first (usually usage.mdz and examples.mdz), removing the TODO comments and adding your content.
4

Process and Preview

Review the generated documentation to see which sections still need content.
5

Production Build

Only customized content appears in the final documentation.

Advanced Scenarios

Partial Documentation

You don’t need to fill in all seven sections for every API element. Only create the files that add value:

Shared Content with Includes

Some renderers (like MintlifyRenderer) support includes for reusing content across multiple files:

Multi-Assembly Projects

When documenting multiple assemblies, organize conceptual content by assembly:
Then process assemblies together:

Integration with the Pipeline

Conceptual content integrates seamlessly with DotNetDocs’ transformation pipeline:
Pipeline execution order:
  1. Extract XML: Load API metadata from XML comments
  2. Generate Placeholders: Create missing conceptual files (if enabled)
  3. Load Conceptual: Load conceptual content from .mdz files
  4. Merge Models: Combine multiple assemblies if needed
  5. Enrich: Run enrichers to add external metadata
  6. Transform: Run transformers to modify the model
  7. Render: Generate final documentation output
Conceptual content is loaded after placeholder generation but before enrichers and transformers run, allowing the entire pipeline to work with the complete documentation model.

See Also

Pipeline Overview

Learn about the complete documentation pipeline

Mintlify Provider

See how conceptual content renders in Mintlify

Placeholder Handling Spec

Technical specification for placeholder handling

Core Documentation Spec

Complete XML and conceptual mapping reference