Skip to content

Commit 44714d9

Browse files
committed
Enable MarkdownSnippets.MsBuild
1 parent d305f1f commit 44714d9

File tree

3 files changed

+14
-20
lines changed

3 files changed

+14
-20
lines changed

README.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,14 @@ Apply the `LogWithName` attribute:
4848

4949
<!-- snippet: LogWithName -->
5050
<a id='snippet-logwithname'></a>
51-
```csharp
52-
using Destructurama.Attributed;
53-
...
51+
```cs
5452
public class PersonalData
5553
{
5654
[LogWithName("FullName")]
5755
public string? Name { get; set; }
5856
}
5957
```
60-
<sup><a href='/test/Destructurama.Attributed.Tests/LogWithNameAttributedTests.cs#L37-L43' title='Snippet source file'>snippet source</a> | <a href='#snippet-logwithname' title='Start of snippet'>anchor</a></sup>
58+
<sup><a href='/src/Destructurama.Attributed.Tests/LogWithNameAttributedTests.cs#L36-L42' title='Snippet source file'>snippet source</a> | <a href='#snippet-logwithname' title='Start of snippet'>anchor</a></sup>
6159
<!-- endSnippet -->
6260

6361
## 2. Ignoring a property
@@ -66,9 +64,7 @@ Apply the `NotLogged` attribute:
6664

6765
<!-- snippet: LoginCommand -->
6866
<a id='snippet-logincommand'></a>
69-
```csharp
70-
using Destructurama.Attributed;
71-
...
67+
```cs
7268
public class LoginCommand
7369
{
7470
public string? Username { get; set; }
@@ -77,18 +73,18 @@ public class LoginCommand
7773
public string? Password { get; set; }
7874
}
7975
```
80-
<sup><a href='/test/Destructurama.Attributed.Tests/Snippets.cs#L29-L37' title='Snippet source file'>snippet source</a> | <a href='#snippet-logincommand' title='Start of snippet'>anchor</a></sup>
76+
<sup><a href='/src/Destructurama.Attributed.Tests/Snippets.cs#L29-L37' title='Snippet source file'>snippet source</a> | <a href='#snippet-logincommand' title='Start of snippet'>anchor</a></sup>
8177
<!-- endSnippet -->
8278

8379
When the object is passed using `{@...}` syntax the attributes will be consulted.
8480

8581
<!-- snippet: LogCommand -->
8682
<a id='snippet-logcommand'></a>
87-
```csharp
83+
```cs
8884
var command = new LoginCommand { Username = "logged", Password = "not logged" };
89-
log.Information("Logging in {@Command}", command);
85+
_log.Information("Logging in {@Command}", command);
9086
```
91-
<sup><a href='/test/Destructurama.Attributed.Tests/Snippets.cs#L44-L47' title='Snippet source file'>snippet source</a> | <a href='#snippet-logcommand' title='Start of snippet'>anchor</a></sup>
87+
<sup><a href='/src/Destructurama.Attributed.Tests/Snippets.cs#L44-L47' title='Snippet source file'>snippet source</a> | <a href='#snippet-logcommand' title='Start of snippet'>anchor</a></sup>
9288
<!-- endSnippet -->
9389

9490
## 3. Ignoring a property if it has default value
@@ -164,9 +160,7 @@ Note that masking also works for properties of type `IEnumerable<string>` or der
164160

165161
<!-- snippet: CustomizedMaskedLogs -->
166162
<a id='snippet-customizedmaskedlogs'></a>
167-
```csharp
168-
using Destructurama.Attributed;
169-
...
163+
```cs
170164
public class CustomizedMaskedLogs
171165
{
172166
/// <summary>
@@ -284,7 +278,7 @@ public class CustomizedMaskedLogs
284278
public string? ShowFirstAndLastThreeAndCustomMaskInTheMiddlePreservedLengthIgnored { get; set; }
285279
}
286280
```
287-
<sup><a href='/test/Destructurama.Attributed.Tests/MaskedAttributeTests.cs#L10-L129' title='Snippet source file'>snippet source</a> | <a href='#snippet-customizedmaskedlogs' title='Start of snippet'>anchor</a></sup>
281+
<sup><a href='/src/Destructurama.Attributed.Tests/MaskedAttributeTests.cs#L9-L128' title='Snippet source file'>snippet source</a> | <a href='#snippet-customizedmaskedlogs' title='Start of snippet'>anchor</a></sup>
288282
<!-- endSnippet -->
289283

290284
## 7. Masking a string property with regular expressions
@@ -319,7 +313,7 @@ __Available properties__:
319313

320314
<!-- snippet: WithRegex -->
321315
<a id='snippet-withregex'></a>
322-
```csharp
316+
```cs
323317
public class WithRegex
324318
{
325319
private const string REGEX_WITH_VERTICAL_BARS = @"([a-zA-Z0-9]+)\|([a-zA-Z0-9]+)\|([a-zA-Z0-9]+)";
@@ -337,5 +331,5 @@ public class WithRegex
337331
public string? RegexReplaceSecond { get; set; }
338332
}
339333
```
340-
<sup><a href='/test/Destructurama.Attributed.Tests/Snippets.cs#L6-L25' title='Snippet source file'>snippet source</a> | <a href='#snippet-withregex' title='Start of snippet'>anchor</a></sup>
334+
<sup><a href='/src/Destructurama.Attributed.Tests/Snippets.cs#L6-L25' title='Snippet source file'>snippet source</a> | <a href='#snippet-withregex' title='Start of snippet'>anchor</a></sup>
341335
<!-- endSnippet -->

mdsnippets.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{
1+
{
22
"$schema": "https://raw.githubusercontent.com/SimonCropp/MarkdownSnippets/master/schema.json",
3-
"MaxWidth": 100,
3+
"MaxWidth": 110,
44
"Convention": "InPlaceOverwrite"
55
}

src/Destructurama.Attributed.Tests/Destructurama.Attributed.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<PrivateAssets>all</PrivateAssets>
1818
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1919
</PackageReference>
20-
<!--<PackageReference Include="MarkdownSnippets.MsBuild" Version="24.5.1" PrivateAssets="all" />-->
20+
<PackageReference Include="MarkdownSnippets.MsBuild" Version="24.5.1" PrivateAssets="all" />
2121
</ItemGroup>
2222

2323
<ItemGroup>

0 commit comments

Comments
 (0)