apply the great colon correction of 2019.

master
Craig Oates 5 years ago
parent
commit
684975c236
  1. 6
      Adding-Console.Waterworks-to-Your-Project.md
  2. 4
      Gotchas-and-Where-C#-and-F#-Differ.md
  3. 2
      Home.md
  4. 2
      Introduction-to-Brittle-Fish.md
  5. 2
      Overview-of-Console.Waterworks.md
  6. 2
      Referencing-Other-Projects.md
  7. 2
      Solution-Overview.md
  8. 8
      Using-the-Help-Attributes.md
  9. 16
      Wiring-Console.Waterworks-into-Your-Project.md
  10. 6
      Writing-Command-Methods-in-F#.md

6
Adding-Console.Waterworks-to-Your-Project.md

@ -1,19 +1,19 @@
While there are several ways to add a NuGet package to a project, I will keep it simple. I will show you how to add Console.Waterworks (C.W.) to your project via the Package Manager console.
To add Console.Waterworks to your .Net console project, use the following line;
To add Console.Waterworks to your .Net console project, use the following line:
```powershell
// Change the version the number as you see fit.
Install-Package Console.Waterworks -Version 1.0.0.2
```
To add Console.Waterworks.Core to you .Net Core console project, use the following line;
To add Console.Waterworks.Core to you .Net Core console project, use the following line:
```powershell
// Change the version the number as you see fit.
Install-Package Console.Waterworks.Core -Version 1.0.0.1
```
For more information about release versions, check out their individual NuGet pages via;
For more information about release versions, check out their individual NuGet pages via:
* [Console.Waterworks NuGet page](https://www.nuget.org/packages/Console.Waterworks)
* [Console.Waterworks.Core NuGet page](https://www.nuget.org/packages/Console.Waterworks.Core/)

4
Gotchas-and-Where-C#-and-F#-Differ.md

@ -8,12 +8,12 @@ If you write a command-method which takes no arguments, you must make sure you s
## Using Spaces in your Command-Methods
For further information, please refer to the `ConsoleCommands` module in either the ".Net" or ."Net Core" console projects. You might need them to help explain this next point. The links for these modules are as follows;
For further information, please refer to the `ConsoleCommands` module in either the ".Net" or ."Net Core" console projects. You might need them to help explain this next point. The links for these modules are as follows:
- [BrittleFish ConsoleCommands.fs (.Net)](https://gitlab.com/craig.oates/Brittle-Fish/blob/master/BrittleFish/ConsoleCommands.fs)
- [BrittleFishCore ConsoleCommands.fs (Core)](https://gitlab.com/craig.oates/Brittle-Fish/blob/master/BrittleFishCore/ConsoleCommands.fs)
To begin, here are two command-methods;
To begin, here are two command-methods:
```f#
// Example 1

2
Home.md

@ -7,7 +7,7 @@ Welcome to the wiki of Brittle-Fish. If you are looking to learn about **using**
* [Console.Waterworks Wiki](https://gitlab.com/craig.oates/Console.Waterworks/wikis/home)
Before continuing, I recommend you are familiar with the following;
Before continuing, I recommend you are familiar with the following:
* [.Net 4.7+ and/or .Net Core 2.0+](https://dotnet.microsoft.com)
* [Visual Studio 17 (15.3.9+)](https://visualstudio.microsoft.com)

2
Introduction-to-Brittle-Fish.md

@ -10,7 +10,7 @@ If you are already familiar with .Net, you will know Microsoft focuses more on C
After fiddling around with C.W. and C.W.C. in an F# environment, I managed to get them working. The amount of work required was very little, to my surprise; C.W. and C.W.C. hold-up pretty well. Because of that, I felt comfortable providing documentation for F# developers. One of my concerns with doing this was making sure the F# part did not feel tacked-on. Yes, I wrote C.W. and C.W.C. in C# but you do not need to **use** them in C#. This realisation is why I made this repository. As an F# developer, you might not be able to change the internals of C.W. and C.W.C but I can help you use them with F#.
If you are wondering why I did not include everything in this wiki in the C.W. wiki, the two main reasons are;
If you are wondering why I did not include everything in this wiki in the C.W. wiki, the two main reasons are:
1. I wanted to minimise the need to do the "C#-shuffle". You are an F# developer, why look at C#?
2. I did not want the wikis to look and feel bloated/cluttered. I felt they would if I added an "F#-only" section. If you are a C# developer, the F# code will feel like it is in the way.

2
Overview-of-Console.Waterworks.md

@ -15,7 +15,7 @@ Data-Flow](attachments/console.waterworks-data-flow.png)
Because this repository focuses on teaching users how to **use**
C.W. with F#, there is no information on how C.W. **works**. For that, you
must refer to the wikis of the actual (C.W.) projects. Their links are as
follows;
follows:
* [Console.Waterworks
Wiki](https://gitlab.com/craig.oates/Console.Waterworks/wikis/home)

2
Referencing-Other-Projects.md

@ -56,6 +56,6 @@ namespace Commands
As you can see, once you are inside a command-method, you are free to put any code you want in there. For example, you can call your library code.
If you are unsure how to reference a .Net library in another project, within your solution, I have provided a link, which is;
If you are unsure how to reference a .Net library in another project, within your solution, I have provided a link, which is:
- [Manage References in a Project](https://docs.microsoft.com/en-us/visualstudio/ide/managing-references-in-a-project?view=vs-2019)

2
Solution-Overview.md

@ -1,5 +1,5 @@
If you would like to know how to add Console.Waterworks (C.W.) to your
F# project, use the following link;
F# project, use the following link:
* [Adding Console.Waterworks to your
Project](Adding-Console.Waterworks-to-Your-Project)

8
Using-the-Help-Attributes.md

@ -2,20 +2,20 @@ To help users discover features within your console program, Console.Waterworks
![help section screenshot](attachments/help-section-screenshot.png)
There are four attributes in total. They are;
There are four attributes in total. They are:
1. List Command: Show command at run-time.
2. Description: Describes what the command does.
3. Usage: Provides an example of how to use  the command.
4. Parameters: Lists out the commands argument list and their types.
For more information on the "help" attributes, please refer to the following link;
For more information on the "help" attributes, please refer to the following link:
- [Help Attributes Wiki Page (Console.Waterworks Wiki)](https://gitlab.com/craig.oates/Console.Waterworks/wikis/The-%22Help%22-Attributes)
To set-up the "help" section , you must create a command-method first. You can use any name you want. For example, I usually call it `help`.
Within the "help" command-method, enter the following code;
Within the "help" command-method, enter the following code:
```f#
let help () =
@ -42,7 +42,7 @@ let libtest3 name =
A nice side-effect of the attributes is your command-methods are "self-documented". And, because this bit of code is used by the end-user, there is an extra incentive to keep the documentation up-to-date.
For the sake of completeness, here is a link to the `ConsoleCommands` modules for the .Net and .Net Core projects;
For the sake of completeness, here is a link to the `ConsoleCommands` modules for the .Net and .Net Core projects:
- [BrittleFish ConsoleCommands.fs (.Net)](https://gitlab.com/craig.oates/Brittle-Fish/blob/master/BrittleFish/ConsoleCommands.fs)
- [BrittleFishCore ConsoleCommands.fs (Core)](https://gitlab.com/craig.oates/Brittle-Fish/blob/master/BrittleFishCore/ConsoleCommands.fs)

16
Wiring-Console.Waterworks-into-Your-Project.md

@ -1,8 +1,8 @@
This section assumes you have already created an F# console project. It, also, assumes you have added the appropriate Console.Waterworks (C.W.) version to it. If you have not and are unsure on how to do this, please refer to the following link;
This section assumes you have already created an F# console project. It, also, assumes you have added the appropriate Console.Waterworks (C.W.) version to it. If you have not and are unsure on how to do this, please refer to the following link:
- [Adding Console.Waterworks to Your Project](Adding-Console.Waterworks-to-Your-Project)
Once you have added Console.Waterworks(.Core) to your console project, you can begin using it. One thing to note with Console.Waterworks (C.W.) is how invasive it is. Because it has taken a lot out of your hands, it requires your project to look a certain way. The first thing you need to do is create a file called "ConsoleCommands.fs". When you have done that, to create a name-space called `Commands` and a module called `ConsoleCommands` within it. Whilst you are still in "ConsoleCommands.fs", add "open Console.Waterworks" to the module. If you are writing a .Net Core program, add `open Console.Waterworks.Core` statement in its place. Once that is set-up, add a function called `test`. You should end up with something which looks like this;
Once you have added Console.Waterworks(.Core) to your console project, you can begin using it. One thing to note with Console.Waterworks (C.W.) is how invasive it is. Because it has taken a lot out of your hands, it requires your project to look a certain way. The first thing you need to do is create a file called "ConsoleCommands.fs". When you have done that, to create a name-space called `Commands` and a module called `ConsoleCommands` within it. Whilst you are still in "ConsoleCommands.fs", add "open Console.Waterworks" to the module. If you are writing a .Net Core program, add `open Console.Waterworks.Core` statement in its place. Once that is set-up, add a function called `test`. You should end up with something which looks like this:
### .Net Version
@ -28,7 +28,7 @@ open Console.Waterworks
let test () = "The console is working"
```
With `ConsoleCommands` set-up, head back to "program.fs". We can now tell C.W. where to look for your `business logic`. To do this, add the following code to `main`;
With `ConsoleCommands` set-up, head back to "program.fs". We can now tell C.W. where to look for your `business logic`. To do this, add the following code to `main`:
```f#
let liaison = new CW_Liaison()
@ -51,13 +51,13 @@ To change your console program's assembly information, you need to alter its "As
### .Net
One way to change the assembly information in your .Net program is to alter it via the "Properties" menu. You can access it by right-clicking on a project in Solution Explorer and clicking on "Properties". For a more detailed guide, you can use the following links;
One way to change the assembly information in your .Net program is to alter it via the "Properties" menu. You can access it by right-clicking on a project in Solution Explorer and clicking on "Properties". For a more detailed guide, you can use the following links:
- [Setting Assembly Attributes](https://docs.microsoft.com/en-us/dotnet/framework/app-domains/set-assembly-attributes): This applies to the traditional and Core versions of .Net. It provides information on what resides in Assembly Information manifests and files.
- [How to Target a version of .Net](https://docs.microsoft.com/en-us/visualstudio/ide/how-to-target-a-version-of-the-dotnet-framework?view=vs-2019): This provides extra context on the Properties page in Visual Studio and how it fits the Assembly Information dialog box into it -- from a traditional .Net angle.
- [The AssemblyInfo.fs file for BrittleFish](https://gitlab.com/craig.oates/Brittle-Fish/blob/master/BrittleFish/AssemblyInfo.fs): The actual Assembly Information file for the BrittleFish console program. Use this as a reference for your own projects.
You might find you do not have a file called "AssemblyInfo.fs" within your project. If you are unfamiliar with these types of files, feel free to peruse the links above for help on learning how to add it. As an alternative, you can create a file in your project (in Visual Studio) and call it "AssemblyInfo.fs" -- make sure it is at the **root** level. From there, you can copy and paste the following code block into it (making sure you replace the code wrapped in `{delete the braces when you add your own info.}`);
You might find you do not have a file called "AssemblyInfo.fs" within your project. If you are unfamiliar with these types of files, feel free to peruse the links above for help on learning how to add it. As an alternative, you can create a file in your project (in Visual Studio) and call it "AssemblyInfo.fs" -- make sure it is at the **root** level. From there, you can copy and paste the following code block into it (making sure you replace the code wrapped in `{delete the braces when you add your own info.}`):
```f#
namespace {YOUR-PROJECT-NAME-HERE}.AssemblyInfo
@ -104,20 +104,20 @@ do
()
```
To help you get a sense of where this file should live, please review the file structure for BrittleFish. You can do that by using the following link;
To help you get a sense of where this file should live, please review the file structure for BrittleFish. You can do that by using the following link:
- [BrittleFish (Console Project) File Structure](https://gitlab.com/craig.oates/Brittle-Fish/tree/master/BrittleFish)
### .Net Core
Like the traditional .Net version, you can use the Properties dialog box in Visual Studio. Use the links below for extra information, which are;
Like the traditional .Net version, you can use the Properties dialog box in Visual Studio. Use the links below for extra information, which are:
- [Application Page, Project Designer (C#)](https://docs.microsoft.com/en-us/visualstudio/ide/reference/application-page-project-designer-csharp?view=vs-2019): This show you how to access the Properties page box and provides more information on how the Assembly Information dialog box fits into it -- from a .Net Core perspective.
- [The AssemblyInfo.fs file for BrittleFishCore](https://gitlab.com/craig.oates/Brittle-Fish/blob/master/BrittleFishCore/AssemblyInfo.fs): The actual Assembly Information file for the BrittleFishCore console program. Use this as a reference for your own projects.
I tend to find, Visual Studio automatically makes a "AssemblyInfo.fs" file when I create a .Net Core project. So, I do not need to go out of my way to make one. If, for some reason, you find yourself without one, you can use the same technique in the ".Net" section above. The same applies to the code block within it.
Like the section above, you can get a sense of where "AssemblyInfo.fs" should live (in a .Net Core project) by reviewing the file structure for BrittleFishCore. You can do that by using the following link;
Like the section above, you can get a sense of where "AssemblyInfo.fs" should live (in a .Net Core project) by reviewing the file structure for BrittleFishCore. You can do that by using the following link:
- [BrittleFishCore (Console Project) File Structure](https://gitlab.com/craig.oates/Brittle-Fish/tree/master/BrittleFishCore)

6
Writing-Command-Methods-in-F#.md

@ -1,6 +1,6 @@
If you are unsure what a command-method is, please read [**Overview of Command-Methods**](Overview-of-Command-Methods) before continuing.
When it comes to writing command-methods, there are certain requirements you must meet. They are;
When it comes to writing command-methods, there are certain requirements you must meet. They are:
1. Each command-method must be static.
2. Each command must return a string.
@ -9,7 +9,7 @@ To be frank, the first point exists because of the characteristics of C#. For th
The reason each command-method must return a string is because C.W. needs to provide feedback to the end-user. With that said, you are still free to write to the console whenever you want. On top of that, you can return an empty string if you prefer that. C.W. does not care what is inside the string, as long as it is a string.
Having taken the above into account, here is what a typical command-method looks like;
Having taken the above into account, here is what a typical command-method looks like:
```f#
let test () =
@ -17,7 +17,7 @@ let test () =
"C.W.  is set-up and ready to go."
```
More examples can be found at the following links;
More examples can be found at the following links:
- [BrittleFish Console Project (.Net)](https://gitlab.com/craig.oates/Brittle-Fish/blob/master/BrittleFish/ConsoleCommands.fs)
- [BrittleFish.Core Console Project (.Net Core)](https://gitlab.com/craig.oates/Brittle-Fish/blob/master/BrittleFishCore/ConsoleCommands.fs)

Loading…
Cancel
Save