Skip to content

Commit 37add3a

Browse files
authored
Migrate documentation to Docusaurus (#56)
1 parent e6949a5 commit 37add3a

File tree

2,981 files changed

+7214
-143125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,981 files changed

+7214
-143125
lines changed

.editorconfig

+11-76
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ root = true
55

66
# Code files
77
[*.{cs,csx}]
8+
9+
dotnet_sort_system_directives_first = true
10+
11+
csharp_style_namespace_declarations = file_scoped:suggestion
12+
813
roslynator_accessibility_modifiers = explicit
914
roslynator_accessor_braces_style = single_line_when_expression_is_on_single_line
1015
roslynator_array_creation_type_style = implicit_when_type_is_obvious
@@ -35,6 +40,8 @@ roslynator_use_var_instead_of_implicit_object_creation = true
3540
roslynator_infinite_loop_style = while
3641
roslynator_doc_comment_summary_style = multi_line
3742
roslynator_enum_flag_value_style = shift_operator
43+
roslynator_blank_line_after_file_scoped_namespace_declaration = true
44+
roslynator_null_check_style = pattern_matching
3845

3946
dotnet_diagnostic.RCS0001.severity = suggestion
4047
dotnet_diagnostic.RCS0003.severity = suggestion
@@ -63,7 +70,6 @@ dotnet_diagnostic.RCS0039.severity = suggestion
6370
dotnet_diagnostic.RCS0041.severity = suggestion
6471
dotnet_diagnostic.RCS0042.severity = suggestion
6572
dotnet_diagnostic.RCS0043.severity = suggestion
66-
dotnet_diagnostic.RCS0044.severity = suggestion
6773
dotnet_diagnostic.RCS0046.severity = suggestion
6874
dotnet_diagnostic.RCS0048.severity = silent
6975
dotnet_diagnostic.RCS0049.severity = suggestion
@@ -75,6 +81,7 @@ dotnet_diagnostic.RCS0055.severity = suggestion
7581
dotnet_diagnostic.RCS0057.severity = suggestion
7682
dotnet_diagnostic.RCS0058.severity = suggestion
7783
dotnet_diagnostic.RCS0059.severity = suggestion
84+
dotnet_diagnostic.RCS0060.severity = suggestion
7885
dotnet_diagnostic.RCS1002.severity = silent
7986
dotnet_diagnostic.RCS1006.severity = suggestion
8087
dotnet_diagnostic.RCS1008.severity = suggestion
@@ -112,7 +119,6 @@ dotnet_diagnostic.RCS1083.severity = suggestion
112119
dotnet_diagnostic.RCS1090.severity = suggestion
113120
dotnet_diagnostic.RCS1091.severity = suggestion
114121
dotnet_diagnostic.RCS1096.severity = warning
115-
dotnet_diagnostic.RCS1111.severity = suggestion
116122
dotnet_diagnostic.RCS1124.severity = suggestion
117123
dotnet_diagnostic.RCS1126.severity = warning
118124
dotnet_diagnostic.RCS1129.severity = suggestion
@@ -130,10 +136,12 @@ dotnet_diagnostic.RCS1189.severity = suggestion
130136
dotnet_diagnostic.RCS1207.severity = suggestion
131137
dotnet_diagnostic.RCS1237.severity = none
132138
dotnet_diagnostic.RCS1244.severity = suggestion
139+
dotnet_diagnostic.RCS1248.severity = suggestion
133140
dotnet_diagnostic.RCS1250.severity = suggestion
134141
dotnet_diagnostic.RCS1252.severity = suggestion
135142
dotnet_diagnostic.RCS1253.severity = suggestion
136143
dotnet_diagnostic.RCS1254.severity = suggestion
144+
dotnet_diagnostic.RCS1255.severity = none
137145

138146
dotnet_diagnostic.IDE0007.severity = none
139147
dotnet_diagnostic.IDE0007WithoutSuggestion.severity = none
@@ -180,83 +188,10 @@ dotnet_diagnostic.IDE0074.severity = none
180188
dotnet_diagnostic.IDE0074WithoutSuggestion.severity = none
181189
dotnet_diagnostic.IDE0079.severity = none
182190
dotnet_diagnostic.IDE0090.severity = none
191+
dotnet_diagnostic.IDE0220.severity = none
183192
dotnet_diagnostic.IDE1005.severity = suggestion
184193
dotnet_diagnostic.IDE1006.severity = suggestion
185194

186195
dotnet_diagnostic.RS1024.severity = none # Compare symbols correctly
187196
dotnet_diagnostic.RS1025.severity = none
188197
dotnet_diagnostic.RS1026.severity = none
189-
190-
[*.{cs,vb}]
191-
#### Naming styles ####
192-
193-
# Naming rules
194-
195-
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
196-
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
197-
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
198-
199-
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
200-
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
201-
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
202-
203-
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
204-
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
205-
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
206-
207-
# Symbol specifications
208-
209-
dotnet_naming_symbols.interface.applicable_kinds = interface
210-
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
211-
dotnet_naming_symbols.interface.required_modifiers =
212-
213-
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
214-
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
215-
dotnet_naming_symbols.types.required_modifiers =
216-
217-
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
218-
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
219-
dotnet_naming_symbols.non_field_members.required_modifiers =
220-
221-
# Naming styles
222-
223-
dotnet_naming_style.begins_with_i.required_prefix = I
224-
dotnet_naming_style.begins_with_i.required_suffix =
225-
dotnet_naming_style.begins_with_i.word_separator =
226-
dotnet_naming_style.begins_with_i.capitalization = pascal_case
227-
228-
dotnet_naming_style.pascal_case.required_prefix =
229-
dotnet_naming_style.pascal_case.required_suffix =
230-
dotnet_naming_style.pascal_case.word_separator =
231-
dotnet_naming_style.pascal_case.capitalization = pascal_case
232-
233-
dotnet_naming_style.pascal_case.required_prefix =
234-
dotnet_naming_style.pascal_case.required_suffix =
235-
dotnet_naming_style.pascal_case.word_separator =
236-
dotnet_naming_style.pascal_case.capitalization = pascal_case
237-
dotnet_style_coalesce_expression = true:suggestion
238-
dotnet_style_null_propagation = true:suggestion
239-
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
240-
dotnet_style_prefer_auto_properties = true:silent
241-
dotnet_style_object_initializer = true:suggestion
242-
dotnet_style_operator_placement_when_wrapping = beginning_of_line
243-
tab_width = 4
244-
indent_size = 4
245-
end_of_line = crlf
246-
dotnet_style_collection_initializer = true:suggestion
247-
248-
[*.cs]
249-
csharp_using_directive_placement = outside_namespace:silent
250-
csharp_prefer_simple_using_statement = true:suggestion
251-
csharp_prefer_braces = true:silent
252-
csharp_style_namespace_declarations = block_scoped:silent
253-
csharp_style_prefer_method_group_conversion = true:silent
254-
csharp_style_expression_bodied_methods = false:silent
255-
csharp_style_expression_bodied_constructors = false:silent
256-
csharp_style_expression_bodied_operators = false:silent
257-
csharp_style_expression_bodied_properties = true:silent
258-
csharp_style_expression_bodied_indexers = true:silent
259-
csharp_style_expression_bodied_accessors = true:silent
260-
csharp_style_expression_bodied_lambdas = true:silent
261-
csharp_style_expression_bodied_local_functions = false:silent
262-
csharp_indent_labels = one_less_than_current

.github/workflows/build.yml

+166
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
tags:
6+
- v*
7+
pull_request:
8+
9+
env:
10+
Configuration: Release
11+
TreatWarningsAsErrors: true
12+
WarningsNotAsErrors: 1591,NU5128
13+
Deterministic: true
14+
RunCodeAnalysis: false
15+
16+
jobs:
17+
pre_build:
18+
runs-on: ubuntu-20.04
19+
outputs:
20+
version: ${{ steps.version.outputs.version }}
21+
version3: ${{ steps.version.outputs.version3 }}
22+
defaults:
23+
run:
24+
working-directory: src
25+
steps:
26+
- uses: actions/checkout@v3
27+
with:
28+
fetch-depth: 0
29+
- run: dotnet tool install -g GitVersion.Tool --version 5.10.0
30+
- name: Resolve version
31+
id: version
32+
run: |
33+
dotnet-gitversion > version.json
34+
version="$(jq -r '.SemVer' version.json)"
35+
version3="$(jq -r '.MajorMinorPatch' version.json)"
36+
pr_version="$(jq -r '.MajorMinorPatch' version.json)-$(jq -r '.PreReleaseLabel' version.json).${{ github.run_number }}.${{ github.run_attempt }}"
37+
if [ "${{ github.event_name }}" = "pull_request" ]; then version=$pr_version; fi
38+
echo "Resolved version: $version"
39+
echo "version=${version}" >> $GITHUB_OUTPUT
40+
echo "Resolved version3: $version3"
41+
echo "version3=${version3}" >> $GITHUB_OUTPUT
42+
43+
build_vs_extension:
44+
needs: pre_build
45+
runs-on: windows-latest
46+
env:
47+
Version: ${{ needs.pre_build.outputs.version }}
48+
DeployExtension: false
49+
defaults:
50+
run:
51+
working-directory: src
52+
steps:
53+
- uses: actions/checkout@v3
54+
- run: (Get-Content source.extension.vsixmanifest) -replace 'Version="1.0.0"', 'Version="${{ needs.pre_build.outputs.version3 }}"' | Set-Content source.extension.vsixmanifest
55+
working-directory: src/Snippetica.VisualStudio
56+
- run: dotnet restore Tools/DocumentationGenerator/DocumentationGenerator.csproj
57+
- run: dotnet build Tools/DocumentationGenerator/DocumentationGenerator.csproj --no-restore
58+
- run: |
59+
cd tools
60+
./generate_snippets.ps1
61+
name: "Generate snippets"
62+
working-directory: "."
63+
- run: dotnet restore
64+
- uses: microsoft/[email protected]
65+
- run: msbuild -m
66+
- uses: actions/upload-artifact@v3
67+
name: "Upload vsix file"
68+
with:
69+
name: vs_extension
70+
path: src/Snippetica.VisualStudio/bin/Release/*.vsix
71+
- uses: actions/upload-artifact@v3
72+
name: "Upload manifest file"
73+
with:
74+
name: vs_extension
75+
path: src/Snippetica.VisualStudio/manifest.json
76+
- uses: actions/upload-artifact@v3
77+
name: "Upload Visual Studio snippets"
78+
with:
79+
name: vs_snippets
80+
path: src/Snippetica.VisualStudio/**/*.snippet
81+
82+
build_vs_code_extensions:
83+
needs: pre_build
84+
runs-on: ubuntu-20.04
85+
env:
86+
Version: ${{ needs.pre_build.outputs.version }}
87+
DefineConstants: VSCODE
88+
strategy:
89+
matrix:
90+
component:
91+
- name: cpp
92+
directoryName: Snippetica.Cpp
93+
- name: cs
94+
directoryName: Snippetica.CSharp
95+
- name: html
96+
directoryName: Snippetica.Html
97+
- name: json
98+
directoryName: Snippetica.Json
99+
- name: markdown
100+
directoryName: Snippetica.Markdown
101+
- name: vb
102+
directoryName: Snippetica.VisualBasic
103+
- name: xml
104+
directoryName: Snippetica.Xml
105+
defaults:
106+
run:
107+
working-directory: src/Snippetica.VisualStudioCode/${{ matrix.component.directoryName }}/package
108+
steps:
109+
- uses: actions/checkout@v3
110+
- run: dotnet restore
111+
working-directory: src/Tools/SnippetGenerator
112+
- run: dotnet build --no-restore
113+
working-directory: src/Tools/SnippetGenerator
114+
- run: |
115+
cd tools
116+
./generate_snippets.ps1
117+
working-directory: "."
118+
shell: pwsh
119+
name: "Generate snippets"
120+
- run: >
121+
sed -i 's/"version": "1.0.0"/"version": "${{ needs.pre_build.outputs.version3 }}"/' "package.json"
122+
- run: npm install -g @vscode/vsce
123+
- run: vsce package
124+
- uses: actions/upload-artifact@v3
125+
with:
126+
name: "vs_code_extension_${{ matrix.component.name }}"
127+
path: "src/Snippetica.VisualStudioCode/${{ matrix.component.directoryName }}/package/*.vsix"
128+
129+
publish_vs_extension:
130+
needs: build_vs_extension
131+
runs-on: windows-latest
132+
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
133+
steps:
134+
- uses: actions/download-artifact@v3
135+
with:
136+
name: vs_extension
137+
path: vs_extension
138+
- run: |
139+
$visualStudioPath = vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VSSDK -property installationPath
140+
$vsixPublisher = Join-Path "$visualStudioPath" "VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe"
141+
& "$vsixPublisher" publish -payload Snippetica.VisualStudio.vsix -publishManifest manifest.json -personalAccessToken ${{ secrets.VS_MARKETPLACE_TOKEN }}
142+
working-directory: vs_extension
143+
name: Publish VS extension to Marketplace
144+
145+
publish_vs_code_extension:
146+
needs: build_vs_code_extensions
147+
runs-on: ubuntu-20.04
148+
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
149+
strategy:
150+
matrix:
151+
component:
152+
- name: cpp
153+
- name: cs
154+
- name: html
155+
- name: json
156+
- name: markdown
157+
- name: vb
158+
- name: xml
159+
steps:
160+
- uses: actions/download-artifact@v3
161+
with:
162+
name: vs_code_extension_${{ matrix.component.name }}
163+
path: vs_code_extension
164+
- run: npm install -g @vscode/vsce
165+
- run: vsce publish -p ${{ secrets.VS_MARKETPLACE_TOKEN }}
166+
working-directory: vs_code_extension

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"dotnet.defaultSolution": "src/Snippetica.sln"
3+
}

ChangeLog.md

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1010

1111
- Add snippet for 'while not' (`wx`) ([#54](https://github.com/josefpihrt/roslynator/pull/54)).
1212

13+
### Changed
14+
15+
- Migrate documentation to [Docusaurus](https://josefpihrt.github.io/docs/snippetica) ([#56](https://github.com/josefpihrt/roslynator/pull/56)).
16+
1317
## [1.0.0] - 2022-10-17
1418

1519
### Added

README.md

+21-29
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,32 @@
11
# Snippetica
22

3-
* A collection of snippets for C\#, C\+\+, HTML, JSON, Markdown, VB, XAML and XML\.
4-
* [Release Notes](http://github.com/josefpihrt/snippetica/blob/main/ChangeLog.md)\.
3+
A collection of snippets for C\#, C\+\+, HTML, VB and other languages\.
54

6-
## Snippetica for Visual Studio
5+
## Snippets for Visual Studio
76

8-
* Browse all available snippets with [Snippet Browser](http://pihrt.net/snippetica/snippets?engine=vs)\.
9-
* Download extension from [Marketplace](http://marketplace.visualstudio.com/search?term=publisher%3A"Josef%20Pihrt"%20Snippetica&target=vs&sortBy=Name)\.
7+
### Installation
108

11-
### Snippets
9+
Install extension from [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=josefpihrt.Snippetica)\.
1210

13-
Group|Count| |
14-
-----|-----|---:
15-
[Snippetica.Cpp](http://github.com/josefpihrt/snippetica/blob/main/src/Snippetica.VisualStudio/Snippetica.Cpp/README.md)|121|[Browse](http://pihrt.net/snippetica/snippets?engine=vs&language=cpp)
16-
[Snippetica.CSharp](http://github.com/josefpihrt/snippetica/blob/main/src/Snippetica.VisualStudio/Snippetica.CSharp/README.md)|581|[Browse](http://pihrt.net/snippetica/snippets?engine=vs&language=csharp)
17-
[Snippetica.Html](http://github.com/josefpihrt/snippetica/blob/main/src/Snippetica.VisualStudio/Snippetica.Html/README.md)|221|[Browse](http://pihrt.net/snippetica/snippets?engine=vs&language=html)
18-
[Snippetica.VisualBasic](http://github.com/josefpihrt/snippetica/blob/main/src/Snippetica.VisualStudio/Snippetica.VisualBasic/README.md)|517|[Browse](http://pihrt.net/snippetica/snippets?engine=vs&language=vb)
19-
[Snippetica.Xaml](http://github.com/josefpihrt/snippetica/blob/main/src/Snippetica.VisualStudio/Snippetica.Xaml/README.md)|91|[Browse](http://pihrt.net/snippetica/snippets?engine=vs&language=xaml)
20-
[Snippetica.Xml](http://github.com/josefpihrt/snippetica/blob/main/src/Snippetica.VisualStudio/Snippetica.Xml/README.md)|9|[Browse](http://pihrt.net/snippetica/snippets?engine=vs&language=xml)
21-
[Snippetica.Xml.CodeSnippet](http://github.com/josefpihrt/snippetica/blob/main/src/Snippetica.VisualStudio/Snippetica.Xml.CodeSnippet/README.md)|22|[Browse](http://pihrt.net/snippetica/snippets?engine=vs&language=xml)
11+
### Languages
2212

23-
## Snippetica for Visual Studio Code
13+
- [C#](https://josefpihrt.github.io/docs/snippetica/vs/csharp)
14+
- [Visual Basic](https://josefpihrt.github.io/docs/snippetica/vs/vb)
15+
- [C++](https://josefpihrt.github.io/docs/snippetica/vs/cpp)
16+
- [HTML](https://josefpihrt.github.io/docs/snippetica/vs/html)
17+
- [XAML](https://josefpihrt.github.io/docs/snippetica/vs/xaml)
18+
- [XML](https://josefpihrt.github.io/docs/snippetica/vs/xml)
2419

25-
* Browse all available snippets with [Snippet Browser](http://pihrt.net/snippetica/snippets?engine=vscode)\.
26-
* Download extension from [Marketplace](http://marketplace.visualstudio.com/search?term=publisher%3A"Josef%20Pihrt"%20Snippetica&target=vscode&sortBy=Name)\.
20+
## Snippets for VS Code
2721

28-
### Snippets
22+
### Installation
2923

30-
Group|Count| |
31-
-----|-----|---:
32-
[Snippetica.Cpp](http://github.com/josefpihrt/snippetica/blob/main/src/Snippetica.VisualStudio/Snippetica.Cpp/README.md)|121|[Browse](http://pihrt.net/snippetica/snippets?engine=vscode&language=cpp)
33-
[Snippetica.CSharp](http://github.com/josefpihrt/snippetica/blob/main/src/Snippetica.VisualStudio/Snippetica.CSharp/README.md)|227|[Browse](http://pihrt.net/snippetica/snippets?engine=vscode&language=csharp)
34-
[Snippetica.Html](http://github.com/josefpihrt/snippetica/blob/main/src/Snippetica.VisualStudio/Snippetica.Html/README.md)|221|[Browse](http://pihrt.net/snippetica/snippets?engine=vscode&language=html)
35-
[Snippetica.Json](http://github.com/josefpihrt/snippetica/blob/main/src/Snippetica.VisualStudio/Snippetica.Json/README.md)|18|[Browse](http://pihrt.net/snippetica/snippets?engine=vscode&language=json)
36-
[Snippetica.Markdown](http://github.com/josefpihrt/snippetica/blob/main/src/Snippetica.VisualStudio/Snippetica.Markdown/README.md)|47|[Browse](http://pihrt.net/snippetica/snippets?engine=vscode&language=markdown)
37-
[Snippetica.VisualBasic](http://github.com/josefpihrt/snippetica/blob/main/src/Snippetica.VisualStudio/Snippetica.VisualBasic/README.md)|178|[Browse](http://pihrt.net/snippetica/snippets?engine=vscode&language=vb)
38-
[Snippetica.Xml](http://github.com/josefpihrt/snippetica/blob/main/src/Snippetica.VisualStudio/Snippetica.Xml/README.md)|9|[Browse](http://pihrt.net/snippetica/snippets?engine=vscode&language=xml)
24+
Install extension from [VS Code Marketplace](https://marketplace.visualstudio.com/search?term=snippetica&target=VSCode&category=All%20categories&sortBy=Relevance)\.
3925

40-
*\(Generated with [DotMarkdown](http://github.com/JosefPihrt/DotMarkdown)\)*
26+
### Languages
27+
28+
- [C#](https://josefpihrt.github.io/docs/snippetica/vscode/csharp)
29+
- [Visual Basic](https://josefpihrt.github.io/docs/snippetica/vscode/vb)
30+
- [C++](https://josefpihrt.github.io/docs/snippetica/vscode/cpp)
31+
- [HTML](https://josefpihrt.github.io/docs/snippetica/vscode/html)
32+
- [XML](https://josefpihrt.github.io/docs/snippetica/vscode/xml)

docs/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# https://josefpihrt.github.io/docs/snippetica

src/.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"dotnet.defaultSolution": "Snippetica.sln"
3+
}

0 commit comments

Comments
 (0)