Skip to content

Latest commit

 

History

History
102 lines (79 loc) · 3.73 KB

config-file.md

File metadata and controls

102 lines (79 loc) · 3.73 KB

Config File

The dotnet tool and the MSBuild Task support a config file convention.

Add a file named mdsnippets.json at the target directory with the following content:

{
  "$schema": "https://raw.githubusercontent.com/SimonCropp/MarkdownSnippets/master/schema.json",
  "Convention": "InPlaceOverwrite"
}

snippet source | anchor

{
  "$schema": "https://raw.githubusercontent.com/SimonCropp/MarkdownSnippets/master/schema.json",
  "Convention": "SourceTransform"
}

snippet source | anchor

All Settings

{
  "$schema": "https://raw.githubusercontent.com/SimonCropp/MarkdownSnippets/master/schema.json",
  "ReadOnly": false,
  "LinkFormat": "Tfs",
  "TocLevel": 3,
  "ExcludeDirectories": [ "Dir1", "Dir2" ],
  "ExcludeMarkdownDirectories": [ "Dir2", "Dir3" ],
  "ExcludeSnippetDirectories": [ "Dir4", "Dir5" ],
  "UrlsAsSnippets": [ "Url1", "Url2" ],
  "TocExcludes": [ "Exclude Heading1", "Exclude Heading2" ],
  "Convention": "InPlaceOverwrite",
  "WriteHeader": true,
  "MaxWidth": 80,
  "Header": "GENERATED FILE - Source File: {relativePath}",
  "UrlPrefix": "TheUrlPrefix",
  "TreatMissingAsWarning": true,
  "ValidateContent": true,
  "OmitSnippetLinks": true
}

snippet source | anchor

JSON Schema

Editor help is available by adding the $schema field to the mdsnippets.json file.

{
  "$schema": "https://raw.githubusercontent.com/SimonCropp/MarkdownSnippets/master/schema.json"
}

In the screenshot, JetBrains Rider, is able to offer code completion support.

IDE schema code completion

The schema also includes enum values for constrained value types.

IDE schema code completion

More Info