You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+67-23Lines changed: 67 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,22 +10,32 @@ Giraffe web application template for the `dotnet new` command.
10
10
11
11
## Table of contents
12
12
13
-
-[Installation](#installation)
14
-
-[Updating the template](#updating-the-template)
15
-
-[Basics](#basics)
16
-
-[Template Options](#template-options)
13
+
-[Giraffe Template](#giraffe-template)
14
+
-[Table of contents](#table-of-contents)
15
+
-[Installation](#installation)
16
+
-[Updating the template](#updating-the-template)
17
+
-[Basics](#basics)
18
+
-[Template Options](#template-options)
17
19
-[ViewEngine](#viewengine)
18
20
-[Solution](#solution)
19
21
-[ExcludeTests](#excludetests)
20
22
-[Paket](#paket)
21
-
-[Known Issues](#known-issues)
23
+
-[Known Issues](#known-issues)
22
24
-[Cyclic reference](#cyclic-reference)
23
25
-[.NET Core 2.0 issues](#net-core-20-issues)
24
26
-[Using Visual Studio](#using-visual-studio)
25
-
-[Nightly builds and NuGet feed](#nightly-builds-and-nuget-feed)
26
-
-[Contributing](#contributing)
27
-
-[More information](#more-information)
28
-
-[License](#license)
27
+
-[Example:](#example)
28
+
-[Nightly builds and NuGet feed](#nightly-builds-and-nuget-feed)
29
+
-[Contributing](#contributing)
30
+
-[Examples](#examples)
31
+
-[Default](#default)
32
+
-[Installing the new template](#installing-the-new-template)
33
+
-[Creating a test project for each permutation](#creating-a-test-project-for-each-permutation)
34
+
-[Creating and testing all test projects for all permutations](#creating-and-testing-all-test-projects-for-all-permutations)
35
+
-[Creating and testing all permutations and updating the `paket.lock` file afterwards](#creating-and-testing-all-permutations-and-updating-the-paketlock-file-afterwards)
36
+
-[Testling the template locally](#testling-the-template-locally)
37
+
-[More information](#more-information)
38
+
-[License](#license)
29
39
30
40
## Installation
31
41
@@ -43,21 +53,21 @@ Whenever there is a new version of the Giraffe template you can update it by re-
43
53
44
54
You can also explicitly set the version when installing the template:
45
55
46
-
```
56
+
```console
47
57
dotnet new install "giraffe-template::1.4.0"
48
58
```
49
59
50
60
## Basics
51
61
52
62
After the template has been installed you can create a new Giraffe web application by simply running `dotnet new giraffe` in your terminal:
53
63
54
-
```
64
+
```console
55
65
dotnet new giraffe
56
66
```
57
67
58
68
If you wish to use [Paket](https://fsprojects.github.io/Paket/) for your dependency management use the `--Paket` or `-P` parameter when creating a new application:
59
69
60
-
```
70
+
```console
61
71
dotnet new giraffe --Paket
62
72
```
63
73
@@ -80,13 +90,13 @@ The Giraffe template supports four project templates, three different view engin
80
90
81
91
Use the `--ViewEngine` parameter (short `-V`) to set one of the supported values from above:
82
92
83
-
```
93
+
```console
84
94
dotnet new giraffe --ViewEngine razor
85
95
```
86
96
87
97
The same command can be abbreviated using the `-V` parameter:
88
98
89
-
```
99
+
```console
90
100
dotnet new giraffe -V razor
91
101
```
92
102
@@ -96,13 +106,13 @@ If you do not specify the `--ViewEngine` parameter then the `dotnet new giraffe`
96
106
97
107
When running `dotnet new giraffe` the created project will only be a single Giraffe project which can be added to an existing .NET Core solution. However, when generating a new Giraffe project from a blank sheet then the `--Solution` (or short `-S`) parameter can simplify the generation of an entire solution, including a `.sln` file and accompanied test projects:
98
108
99
-
```
109
+
```console
100
110
dotnet new giraffe --Solution
101
111
```
102
112
103
113
This will create the following structure:
104
114
105
-
```
115
+
```text
106
116
src/
107
117
- AppName/
108
118
- Views/
@@ -158,7 +168,7 @@ The affected SDKs are `2.1.x` where `x < 300`. The issue has been fixed in the S
158
168
159
169
If you do run into this issue the workaround is to explicitly specify the language:
160
170
161
-
```
171
+
```console
162
172
dotnet new giraffe -lang F#
163
173
```
164
174
@@ -176,7 +186,7 @@ All official Giraffe packages are published to the official and public NuGet fee
176
186
177
187
Unofficial builds (such as pre-release builds from the `develop` branch and pull requests) produce unofficial pre-release NuGet packages which can be pulled from the project's public NuGet feed on AppVeyor:
178
188
179
-
```
189
+
```url
180
190
https://ci.appveyor.com/nuget/giraffe-template
181
191
```
182
192
@@ -198,7 +208,7 @@ The `./build.ps1` PowerShell script comes with the following feature switches:
198
208
199
209
### Examples
200
210
201
-
#### Default:
211
+
#### Default
202
212
203
213
Windows:
204
214
@@ -212,7 +222,7 @@ macOS and Linux:
212
222
$ pwsh ./build.ps1
213
223
```
214
224
215
-
#### Installing the new template:
225
+
#### Installing the new template
216
226
217
227
Windows:
218
228
@@ -226,7 +236,7 @@ macOS and Linux:
226
236
$ pwsh ./build.ps1 -InstallTemplate
227
237
```
228
238
229
-
#### Creating a test project for each permutation:
239
+
#### Creating a test project for each permutation
230
240
231
241
Windows:
232
242
@@ -240,7 +250,7 @@ macOS and Linux:
240
250
$ pwsh ./build.ps1 -CreatePermutations
241
251
```
242
252
243
-
#### Creating and testing all test projects for all permutations:
253
+
#### Creating and testing all test projects for all permutations
244
254
245
255
Windows:
246
256
@@ -254,7 +264,7 @@ macOS and Linux:
254
264
$ pwsh ./build.ps1 -TestPermutations
255
265
```
256
266
257
-
#### Creating and testing all permutations and updating the `paket.lock` file afterwards:
267
+
#### Creating and testing all permutations and updating the `paket.lock` file afterwards
258
268
259
269
Windows:
260
270
@@ -268,6 +278,40 @@ macOS and Linux:
268
278
$ pwsh ./build.ps1 -UpdatePaketDependencies
269
279
```
270
280
281
+
#### Testling the template locally
282
+
283
+
If you already have giraffe-template installed, then
284
+
285
+
```console
286
+
$ dotnet new uninstall giraffe-template
287
+
```
288
+
289
+
This will install from the local file system
290
+
291
+
```console
292
+
dotnet new install ./src/ --force
293
+
```
294
+
295
+
To uninstall later:
296
+
297
+
```console
298
+
$ dotnet new uninstall <some-path>/giraffe-template/src
299
+
```
300
+
301
+
To use the template:
302
+
303
+
```console
304
+
dotnet new giraffe
305
+
```
306
+
307
+
Test it locally:
308
+
309
+
```console
310
+
dotnet run --project giraffe-template.fsproj
311
+
```
312
+
313
+
Remember to remove the template generated files
314
+
271
315
## More information
272
316
273
317
For more information about Giraffe, how to set up a development environment, contribution guidelines and more please visit the [main documentation](https://github.com/giraffe-fsharp/Giraffe#table-of-contents) page.
0 commit comments