Skip to content

Commit

Permalink
doco
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Jan 19, 2020
1 parent 9ab7b94 commit 2176929
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/config-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,14 @@ Add a file named `mdsnippets.json` at the target directory with the following co
```
<sup><a href='/src/ConfigReader.Tests/sampleConfig.json#L1-L13' title='File snippet `sampleConfig.json` was extracted from'>snippet source</a> | <a href='#snippet-sampleConfig.json' title='Navigate to start of snippet `sampleConfig.json`'>anchor</a></sup>
<!-- endsnippet -->


## More Info

* [ReadOnly: Mark resulting files as read only](/#mark-resulting-files-as-read-only)
* [LinkFormat](/#linkformat)
* [TocLevel: Heading level](/#heading-level)
* [TocExcludes: Ignore headings](/#ignore-headings)
* [Exclude: Exclude directories from snippet discovery](/#exclude-directories-from-snippet-discovery)
* [WriteHeader: Disable Header](/#disable-header)
* [UrlPrefix](/#urlprefix)
13 changes: 12 additions & 1 deletion docs/mdsource/config-file.source.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,15 @@ The [dotnet tool](/MarkdownSnippets#installation) and the [MSBuild Task](msbuild

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

snippet: sampleConfig.json
snippet: sampleConfig.json


## More Info

* [ReadOnly: Mark resulting files as read only](/#mark-resulting-files-as-read-only)
* [LinkFormat](/#linkformat)
* [TocLevel: Heading level](/#heading-level)
* [TocExcludes: Ignore headings](/#ignore-headings)
* [Exclude: Exclude directories from snippet discovery](/#exclude-directories-from-snippet-discovery)
* [WriteHeader: Disable Header](/#disable-header)
* [UrlPrefix](/#urlprefix)
10 changes: 10 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ To exclude headings use the `--toc-excludes` argument. So for example to exclude
mdsnippets --toc-excludes heading1:heading2
```


## Header

When a .md file is written, a header is include. The default header is:
Expand All @@ -245,18 +246,27 @@ To change this file edit the source file and then run MarkdownSnippets.
<sup><a href='/src/Tests/HeaderWriterTests.DefaultHeader.verified.txt#L1-L4' title='File snippet `HeaderWriterTests.DefaultHeader.verified.txt` was extracted from'>snippet source</a> | <a href='#snippet-HeaderWriterTests.DefaultHeader.verified.txt' title='Navigate to start of snippet `HeaderWriterTests.DefaultHeader.verified.txt`'>anchor</a></sup>
<!-- endsnippet -->


### Disable Header

To disable the header use `--write-header`

```ps
mdsnippets --write-header false
```


### Custom Header

To apply a custom header use `--header`. `{relativePath}` will be replaced with the relative path of the `.source.md` file.

```ps
mdsnippets --header "GENERATED FILE - Source File: {relativePath}"
```


### Newlines in Header

To insert a newline use `\n`

```ps
Expand Down
10 changes: 10 additions & 0 deletions readme.source.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,24 +172,34 @@ To exclude headings use the `--toc-excludes` argument. So for example to exclude
mdsnippets --toc-excludes heading1:heading2
```


## Header

When a .md file is written, a header is include. The default header is:

snippet: HeaderWriterTests.DefaultHeader.verified.txt


### Disable Header

To disable the header use `--write-header`

```ps
mdsnippets --write-header false
```


### Custom Header

To apply a custom header use `--header`. `{relativePath}` will be replaced with the relative path of the `.source.md` file.

```ps
mdsnippets --header "GENERATED FILE - Source File: {relativePath}"
```


### Newlines in Header

To insert a newline use `\n`

```ps
Expand Down

0 comments on commit 2176929

Please sign in to comment.