Skip to content

Commit a2a2600

Browse files
author
maximv
committed
adding the dotnet-cstomd to DryIoc.Docs project and md generation in debug; fixing the collapsible sections
1 parent 925e65a commit a2a2600

9 files changed

+56
-15
lines changed
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"dotnet-cstomd": {
6+
"version": "1.2.0",
7+
"commands": [
8+
"cstomd"
9+
]
10+
}
11+
}
12+
}

docs/DryIoc.Docs/DryIoc.Docs.csproj

+10
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
<ProjectReference Include="..\..\src\DryIoc.MefAttributedModel\DryIoc.MefAttributedModel.csproj" />
2424
</ItemGroup>
2525

26+
<ItemGroup>
27+
<DocFile Include="**\*.cs" />
28+
</ItemGroup>
29+
30+
<Target Name="MdGenerate" BeforeTargets="BeforeBuild"
31+
Condition=" '$(Configuration)' == 'Debug' ">
32+
<Message Text="Generating the Markdown documentation..." Importance="high"/>
33+
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet cstomd %(DocFile.Identity)" />
34+
</Target>
35+
2636
<ItemGroup>
2737
<Compile Update="Extensions\MefAttributedModel.cs">
2838
<Generator>CsToMd</Generator>

docs/DryIoc.Docs/SelectConstructorOrFactoryMethod.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,19 @@ Default constructor means no dependencies.
2626
To avoid the exception you may specify what constructor to use while registering.
2727
2828
Given the class with the two constructors:
29-
```cs md*/
29+
md*/
3030
//md{ usings ...
31+
//md```cs
3132
using DryIoc;
3233
using DryIocAttributes;
3334
using DryIoc.MefAttributedModel;
3435
using System.ComponentModel.Composition;
3536
using NUnit.Framework;
3637
// ReSharper disable UnusedVariable
38+
//md```
3739
//md}
3840

41+
//md```cs
3942
public interface IDependency { }
4043
public class Dep : IDependency {}
4144
public class Foo

docs/DryIoc.Docs/SelectConstructorOrFactoryMethod.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,19 @@ If class has multiple constructors the default behavior is to throw correspondin
2525
To avoid the exception you may specify what constructor to use while registering.
2626

2727
Given the class with the two constructors:
28-
```cs
28+
<details><summary><strong>usings ...</strong></summary>
29+
30+
```cs
2931
using DryIoc;
3032
using DryIocAttributes;
3133
using DryIoc.MefAttributedModel;
3234
using System.ComponentModel.Composition;
3335
using NUnit.Framework;
3436
// ReSharper disable UnusedVariable
37+
```
38+
</details>
3539

40+
```cs
3641
public interface IDependency { }
3742
public class Dep : IDependency {}
3843
public class Foo

docs/DryIoc.Docs/SpecifyDependencyAndPrimitiveValues.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,17 @@
2424
## Service Type
2525
2626
The minimal part of service and dependency resolution specification is Service Type. It allows container to find corresponding service registration:
27-
28-
```cs md*/
27+
md*/
2928
//md{ usings ...
29+
//md```cs
3030
using System;
3131
using NUnit.Framework;
3232
using DryIoc;
3333
// ReSharper disable UnusedVariable
34+
//md```
3435
//md}
3536

37+
//md```cs
3638
class Resolving_with_a_service_type
3739
{
3840
[Test] public void Example()

docs/DryIoc.Docs/SpecifyDependencyAndPrimitiveValues.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@
2323
## Service Type
2424

2525
The minimal part of service and dependency resolution specification is Service Type. It allows container to find corresponding service registration:
26+
<details><summary><strong>usings ...</strong></summary>
2627

27-
```cs
28-
//md{ usings ...
28+
```cs
2929
using System;
3030
using NUnit.Framework;
3131
using DryIoc;
3232
// ReSharper disable UnusedVariable
33-
//md}
33+
```
34+
</details>
3435

36+
```cs
3537
class Resolving_with_a_service_type
3638
{
3739
[Test] public void Example()
@@ -397,7 +399,7 @@ class Injecting_the_custom_value_depending_on_context
397399

398400
public interface ILogger
399401
{
400-
public Type ContextType { get; }
402+
Type ContextType { get; }
401403
}
402404

403405
public class Logger : ILogger

docs/DryIoc.Docs/ThreadSafety.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
2121
The above guaranties are possible because of the Container data-structure.
2222
In a pseudo code and simplifying things a lot the DryIoc Container may be represented as following:
23-
```cs md*/
23+
md*/
2424
//md{ usings ...
25+
//md```cs
2526
using System;
2627
using System.Linq.Expressions;
2728
using System.Threading.Tasks;
@@ -30,8 +31,10 @@ The above guaranties are possible because of the Container data-structure.
3031
using DryIoc;
3132
#pragma warning disable CS0649
3233
// ReSharper disable UnusedVariable
34+
//md```
3335
//md}
3436

37+
//md```cs
3538
class Oversimplified_container
3639
{
3740
class Ref<T> { public T Value; } // represents the CAS (compare-and-swap) box for the referenced value

docs/DryIoc.Docs/ThreadSafety.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ DryIoc ensures that:
1919

2020
The above guaranties are possible because of the Container data-structure.
2121
In a pseudo code and simplifying things a lot the DryIoc Container may be represented as following:
22+
<details><summary><strong>usings ...</strong></summary>
23+
2224
```cs
23-
//md{ usings ...
2425
using System;
2526
using System.Linq.Expressions;
2627
using System.Threading.Tasks;
@@ -29,8 +30,10 @@ using ImTools;
2930
using DryIoc;
3031
#pragma warning disable CS0649
3132
// ReSharper disable UnusedVariable
32-
//md}
33+
```
34+
</details>
3335

36+
```cs
3437
class Oversimplified_container
3538
{
3639
class Ref<T> { public T Value; } // represents the CAS (compare-and-swap) box for the referenced value

docs/DryIoc.Docs/UsingInTestsWithMockingLibrary.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010

1111
For examples below we need to add:
1212

13-
//md{ usings ...
14-
//md ```cs
13+
<details><summary><strong>usings ...</strong></summary>
14+
15+
```cs
1516
using System.Collections.Concurrent;
1617
using NUnit.Framework;
1718
using DryIoc;
1819
using NSubstitute;
1920
using Moq;
20-
//md ```
21-
//md}
21+
```
22+
</details>
2223

2324

2425
## Auto-mocking with NSubstitute

0 commit comments

Comments
 (0)