Skip to content

Commit 7a8fb82

Browse files
authored
Update README.md
1 parent 3033768 commit 7a8fb82

File tree

1 file changed

+5
-23
lines changed

1 file changed

+5
-23
lines changed

README.md

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Every powershell file is considered a possible command.
1212
When you write a special comment in your code it will add the result to the file:
1313

1414
```csharp
15-
// lsb: collection of IWhatever
15+
//lsb: collection.ps1 "IWhatever"
1616
```
1717

1818
It will parse that line and convert it into the following command:
1919
```
20-
collection.ps1 -of IWhatever
20+
collection.ps1 "IWhatever"
2121
```
2222

2323
The powershell script will then output some things to stdout which will be collected:
@@ -31,35 +31,17 @@ public class WhateverCollection {
3131
}
3232
```
3333

34-
The text will then end up below the comment:
34+
The comment will then be replaced by the content the script delivered:
3535
```
36-
// lsb: collection of IWhatever
3736
public class WhateverCollection {
3837
private List<IWhatever> data = new List<IWhatever>();
3938
4039
public WhateverCollection()
4140
{
4241
}
4342
}
44-
// end ļsb
4543
```
4644

47-
You can now change your command as often as you like. The text between the `lsb` command line and `end lsb` will be replaced every time
48-
the file is saved again.
49-
50-
When you like your code, simply add an exclamation mark to the end of the lsb command line:
51-
```
52-
// lsb: collection of IWhatever!
53-
public class WhateverCollection {
54-
private List<IWhatever> data = new List<IWhatever>();
55-
56-
public WhateverCollection()
57-
{
58-
}
59-
}
60-
// end ļsb
61-
```
62-
63-
This will remove the lsb line itself as well as the `end lsb` line leaving the new code block where it is.
64-
45+
This "template plugin" allows for a lot of automation since we are using powershell in the backend which is fully fledged and can tap into the .net framework as a huge library.
6546

47+
Also it works with any editor you like, as long as it allows for auto-reloading changes that have taken place outside of the editor. VSCode and Visual Studio both do.

0 commit comments

Comments
 (0)