Using Fenced Code Blocks for Longer Code records a distinct Microsoft Learn authoring convention and keeps it scoped to that documentation environment rather than presenting it as a universal grammar rule.
ReviewedEvidence1 sourceSectionWriting & Style
Quick answer
Put longer code snippets or paths in fenced code blocks rather than leaving them as ordinary prose or forcing them into inline code.
Key details
Core Issueusing fenced code blocks for longer code
RegisterMicrosoft Learn technical documentation
Important caveats
Scope Boundary
This is Microsoft Learn Markdown authoring guidance; other publishing systems can use different code-block syntax.
Further guidance
Content
Put longer code snippets or paths in fenced code blocks rather than leaving them as ordinary prose or forcing them into inline code.
Purpose
Keep programmatic or structural text visually consistent and easier for readers to interpret in Microsoft Learn documentation.
Sources and evidence
Sources are shown with the role they play in this guide. Historical or style-sensitive claims are kept within the evidence boundary described above.
Using Approved Language Tags in Fenced Code Blocks records a distinct Microsoft Learn authoring convention and keeps it scoped to that documentation environment rather than presenting it as a universal grammar rule.
Using Triple-Colon Syntax for Referenced Code Snippets records a distinct Microsoft Learn authoring convention and keeps it scoped to that documentation environment rather than presenting it as a universal grammar rule.
Avoiding Horizontal Scrollbars in Code Blocks records a distinct Microsoft Learn authoring convention and keeps it scoped to that documentation environment rather than presenting it as a universal grammar rule.
Avoiding IDE Screenshots for Code Examples records a distinct Microsoft Learn authoring convention and keeps it scoped to that documentation environment rather than presenting it as a universal grammar rule.
Highlighting Key Lines in Code Blocks records a distinct Microsoft Learn authoring convention and keeps it scoped to that documentation environment rather than presenting it as a universal grammar rule.
Using Absolute URLs for Non-Documentation Microsoft Properties records a distinct Microsoft Learn authoring convention and keeps it scoped to that documentation environment rather than presenting it as a universal writing rule.
Using Block Includes for Reusable Sections records a distinct Microsoft Learn authoring convention and keeps it scoped to that documentation environment rather than presenting it as a universal writing rule.
Using File-Relative Links for Microsoft Learn Articles records a distinct Microsoft Learn authoring convention and keeps it scoped to that documentation environment rather than presenting it as a universal writing rule.