Skip to content

Commit

Permalink
Split dirs settings
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Feb 5, 2021
1 parent 1a3cadb commit 43399be
Show file tree
Hide file tree
Showing 34 changed files with 414 additions and 441 deletions.
6 changes: 4 additions & 2 deletions docs/config-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ Add a file named `mdsnippets.json` at the target directory with the following co
"ReadOnly": false,
"LinkFormat": "Tfs",
"TocLevel": 3,
"Exclude": [ "Dir1", "Dir2" ],
"ExcludeDirectories": [ "Dir1", "Dir2" ],
"ExcludeMarkdownDirectories": [ "Dir2", "Dir3" ],
"ExcludeSnippetDirectories": [ "Dir4", "Dir5" ],
"UrlsAsSnippets": [ "Url1", "Url2" ],
"TocExcludes": [ "Exclude Heading1", "Exclude Heading2" ],
"Convention": "InPlaceOverwrite",
Expand All @@ -63,7 +65,7 @@ Add a file named `mdsnippets.json` at the target directory with the following co
"HashSnippetAnchors": true
}
```
<sup><a href='/src/ConfigReader.Tests/allConfig.json#L1-L17' title='Snippet source file'>snippet source</a> | <a href='#snippet-allConfig.json' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/ConfigReader.Tests/allConfig.json#L1-L19' title='Snippet source file'>snippet source</a> | <a href='#snippet-allConfig.json' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
6 changes: 4 additions & 2 deletions docs/max-width.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ The Max Width setting is used to control the maximum characters per line of a sn
DirectoryMarkdownProcessor processor = new(
"targetDirectory",
maxWidth: 80,
shouldIncludeDirectory: _ => true);
directoryIncludes: _ => true,
markdownDirectoryIncludes: _ => true,
snippetDirectoryIncludes: _ => true);
processor.Run();
```
<sup><a href='/src/Tests/Snippets/Usage.cs#L31-L39' title='Snippet source file'>snippet source</a> | <a href='#snippet-directorymarkdownprocessorrunmaxwidth' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Tests/Snippets/Usage.cs#L33-L43' title='Snippet source file'>snippet source</a> | <a href='#snippet-directorymarkdownprocessorrunmaxwidth' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
2 changes: 1 addition & 1 deletion docs/mdsource/config-file.source.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The schema also includes `enum` values for constrained value types.
* [Convention](/readme.md#document-convention).
* [TocLevel: Heading level](/docs/toc.md#heading-level).
* [TocExcludes: Ignore headings](/docs/toc.md#ignore-headings).
* [Exclude: Exclude directories from snippet discovery](/docs/snippet-exclusion.md).
* [Exclude: Exclude directories from discovery](/docs/exclusion.md).
* [WriteHeader: Disable Header](/docs/header.md#disable-header).
* [UrlPrefix](/readme.md#urlprefix).
* [UrlsAsSnippets: Urls to files to be included as snippets](/readme.md#urlsassnippets).
Expand Down
48 changes: 48 additions & 0 deletions docs/mdsource/exclusion.source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Exclusions


## Exclude directories from snippet and markdown discovery

To exclude directories use `-e` or `--exclude-directories`.

For example the following will exclude any directory containing 'foo' or 'bar'

```ps
mdsnippets -e foo:bar
```


## Exclude snippets from directories

To exclude directories from snippet discovery use `--exclude-snippet-directories`.

For example the following will exclude any directory containing 'foo' or 'bar'

```ps
mdsnippets --exclude-snippet-directories foo:bar
```

## Exclude markdown from directories

To exclude directories from markdown discovery use `--exclude-markdown-directories`.

For example the following will exclude any directory containing 'foo' or 'bar'

```ps
mdsnippets --exclude-markdown-directories foo:bar
```


## Ignored paths

When scanning for snippets the following are ignored:

* All directories and files starting with a period `.`
* Any of the following directory names: `bin`, `obj`
* All binary files as defined by https://github.com/sindresorhus/binary-extensions/:

snippet: BinaryFileExtensions

* Files that cannot contain comments:

snippet: NoAcceptCommentsExtensions
27 changes: 0 additions & 27 deletions docs/mdsource/snippet-exclusion.source.md

This file was deleted.

Loading

0 comments on commit 43399be

Please sign in to comment.