diff --git a/.github/Images/repo-banner.png b/.github/Images/repo-banner.png new file mode 100644 index 0000000..47e7752 Binary files /dev/null and b/.github/Images/repo-banner.png differ diff --git a/.github/Images/screenshot-1.png b/.github/Images/screenshot-1.png new file mode 100644 index 0000000..7c1a321 Binary files /dev/null and b/.github/Images/screenshot-1.png differ diff --git a/.github/Images/screenshot-2.PNG b/.github/Images/screenshot-2.PNG new file mode 100644 index 0000000..f59309b Binary files /dev/null and b/.github/Images/screenshot-2.PNG differ diff --git a/.github/Images/solution-structure.png b/.github/Images/solution-structure.png new file mode 100644 index 0000000..d560816 Binary files /dev/null and b/.github/Images/solution-structure.png differ diff --git a/README.md b/README.md index 3577935..4c50bf0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,83 @@ -# Smouldering-Beach-Ball -A F# project for creating placeholder images. Then intention is to create a NuGet package and a console program. +# ![repo-banner](B:\Work\SmoulderingBeachBall\readme\attachments\repo-banner.png) + +**Note: This project is a work in-progress. Doc's might be out-of-date.** + +## Summary + +Smouldering Beach Ball consists of  a .Net Standard 2.0 library, a console program and a "Test Centre". The purpose of this repository is to provide a way for people to create placeholder images. It does this by making the library available as a NuGet and providing a console program. The console program is useful for those needing access to the functionality and not the code. If you are one of the people wanting the features and not the code, I recommend downloading the CLI in [Releases](https://github.com/CraigOates/Smouldering-Beach-Ball/releases). It is a standard alone program so there is no install "concerns". + +### Pre-Requisites + +* Visual Studio 2017 +* F# +* xUnit +* FsCheck +* Console.Waterworks +* .Net 4.7 +* .Net Standard + +![solution-structure](.github/Images/solution-structure.png) + +## Smouldering Beach Ball (Library/NuGet Package) + +This is a F# .Net Standard library. You can install this package from two places: + +1. [MyGet](https://www.myget.org/feed/the-immutable-null/package/nuget/SmoulderingBeachBall): This is the test-bed for the NuGet packages before they make there way over to nuget.org. The packages are less stable but they are where you will the latest bits to test out. If you are unsure how to subscribe to a MyGet feed, click [here](http://docs.myget.org/docs/walkthrough/getting-started-with-nuget). +2. [NuGet](https://www.nuget.org/profiles/Craig.Oates): This is the official host for NuGets. Download Smouldering Beach Ball from this feed for the most stable releases. + +You can add Smouldering Beach Ball to your project via the following commands: + +```powershell +// Using the built-in Package Manager console in Visual Studio. +// Also, remove the "< >" when inserting the package version. + +// MyGet +PM> Install-Package SmoulderingBeachBall -Version -Source https://www.myget.org/F/the-immutable-null/api/v3/index.json  + +// NuGet +PM> Install-Package SmoulderingBeachBall -Version +``` + +For further information about this project, please visit the [wiki](https://github.com/CraigOates/Smouldering-Beach-Ball/wiki). + +## Smouldering Beach Ball CLI + +This project is an F# console program, uses .Net 4.7\. You use it by entering commands and awaiting the result. It uses [Console.Waterworks](https://github.com/CraigOates/Console.Waterworks) to parse the commands so, if you want to extend it, I recommend you read its [wiki](https://github.com/CraigOates/Smouldering-Beach-Ball/wiki). If you want to get going straight away, I recommend using the ``draw-default`` command. All you need to specify is the width and height of the image and it will create an image and save it to your desktop. + +**Tip: Enter ``help`` for a list of available commands or ``cheat`` if you prefer them rendered in a PDF with a nicer layout. The CLI will save the PDF on your desktop.** + +For further information about this project, please visit the [wiki](https://github.com/CraigOates/Smouldering-Beach-Ball/wiki). + +![screenshot-1](.github/Images/screenshot-1.png) + +## Test Centre + +This project holds all the tests for this solution. If uses a combination of unit tests ([xUnit](http://xunit.github.io/)) and property tests ([FsCheck](https://fscheck.github.io/FsCheck/)). If you are unfamiliar with either of them, click on their links for more information. Also, all the tests are accessible in Visual Studio's Test Explorer. This means you can identify failing tests with ease. + +![screenshot-2](.github/Images/screenshot-2.png) + +## How to Contribute + +If you would like to contribute to the project, thank you and here are some useful links for for you to get started. + +* [Contribution page](https://github.com/CraigOates/Smouldering-Beach-Ball/blob/master/CONTRIBUTING.md) +* [Issues](https://github.com/CraigOates/Smouldering-Beach-Ball/tree/master/.github/ISSUE_TEMPLATE) +* [Bug Report Template](https://github.com/CraigOates/Smouldering-Beach-Ball/blob/master/.github/ISSUE_TEMPLATE/bug_report.md) +* [Feature Request Template](https://github.com/CraigOates/Smouldering-Beach-Ball/blob/master/.github/ISSUE_TEMPLATE/feature_request.md) +* [Pull Request Template](https://github.com/CraigOates/Smouldering-Beach-Ball/blob/master/PULL_REQUEST_TEMPLATE.md) +* [Custom Template](https://github.com/CraigOates/Smouldering-Beach-Ball/blob/master/.github/ISSUE_TEMPLATE/custom.md) + +## Code of Conduction + +Please visit the Code of Conduct page for Wet Pancake at: + +* [Code of Conduct page](https://github.com/CraigOates/Smouldering-Beach-Ball/blob/master/CODE_OF_CONDUCT.md) +* [MIT License](https://github.com/CraigOates/Smouldering-Beach-Ball/blob/master/LICENSE) + +## About the Creator + +Hi, my name is Craig and I am the creator of Smouldering Beach Ball. Thanks for checking it out. + +* Email: craig@craigoates.net +* Web: [http://www.craigaotes.net](http://www.craigaotes.net/) +* Project:  [http://www.craigoates.net/Software/project/11](http://www.craigoates.net/Software/project/11) \ No newline at end of file diff --git a/SmoulderingBeachBall/AssemblyInfo.fs b/SmoulderingBeachBall/AssemblyInfo.fs new file mode 100644 index 0000000..e39e1be --- /dev/null +++ b/SmoulderingBeachBall/AssemblyInfo.fs @@ -0,0 +1,42 @@ +namespace SmoulderingBeachBallCLI.AssemblyInfo + +open System.Reflection +open System.Runtime.CompilerServices +open System.Runtime.InteropServices + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[] +[] +[] +[] +[] +[] +[] +[] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [] +[] +[] + +do + () \ No newline at end of file diff --git a/SmoulderingBeachBall/Domain.fs b/SmoulderingBeachBall/Domain.fs index 286c5d8..d1687bc 100644 --- a/SmoulderingBeachBall/Domain.fs +++ b/SmoulderingBeachBall/Domain.fs @@ -1,18 +1,34 @@ namespace SmoulderingBeachBall.Domain [] + /// A collection of types used to describe a Smouldering Beach Ball image. module DomainTypes = open System.Drawing + /// + /// The type of overly the image should have. + /// Border creates a border around the base image. + /// Full creates a border and a 'X' over the base image. + /// type OverlayType = | Border | Full + /// + /// The specification for the overlay. + /// You define the overlays colour and overlay type here. + /// type OverlaySpec = { colour: Brush; overlayType: OverlayType } - + + /// + /// The specification for the whole image. + /// Set the width, height, colour, save location and overlay here. + /// The overlay requires an OverlaySpec if an overlay is desired. + /// To create an image without an overlay, just use 'None'. + /// type ImageSpec = { width: int; height: int; diff --git a/SmoulderingBeachBall/Services.fs b/SmoulderingBeachBall/Services.fs index f394b55..c42b148 100644 --- a/SmoulderingBeachBall/Services.fs +++ b/SmoulderingBeachBall/Services.fs @@ -1,5 +1,6 @@ namespace SmoulderingBeachBall +/// Provides the public facing functions of Smouldering Beach Ball. module Services = open System @@ -7,6 +8,12 @@ module Services = open InternalServices.Validation open InternalServices.Drawing + /// + /// Creates an image using the specification provided by the ImageSpec. + /// + /// + /// The image specification which describes how the image should look. + /// let makeImage (spec: ImageSpec) = async { try diff --git a/SmoulderingBeachBall/SmoulderingBeachBall.fsproj b/SmoulderingBeachBall/SmoulderingBeachBall.fsproj index e6eb3b4..63eb962 100644 --- a/SmoulderingBeachBall/SmoulderingBeachBall.fsproj +++ b/SmoulderingBeachBall/SmoulderingBeachBall.fsproj @@ -5,6 +5,7 @@ + diff --git a/SmoulderingBeachBallCLI/AssemblyInfo.fs b/SmoulderingBeachBallCLI/AssemblyInfo.fs index 3c1b051..7f832e6 100644 --- a/SmoulderingBeachBallCLI/AssemblyInfo.fs +++ b/SmoulderingBeachBallCLI/AssemblyInfo.fs @@ -8,9 +8,15 @@ open System.Runtime.InteropServices // set of attributes. Change these attribute values to modify the information // associated with an assembly. [] -[] +[] [] -[] +[] [] [] [] @@ -34,8 +40,8 @@ open System.Runtime.InteropServices // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [] -[] -[] +[] +[] do () \ No newline at end of file diff --git a/SmoulderingBeachBallCLI/ConsoleCommands.fs b/SmoulderingBeachBallCLI/ConsoleCommands.fs index 9e47ed9..029372f 100644 --- a/SmoulderingBeachBallCLI/ConsoleCommands.fs +++ b/SmoulderingBeachBallCLI/ConsoleCommands.fs @@ -63,17 +63,17 @@ [] [] + ("(image-width: int) (image-height: int) (main-colour: string) " + + "(overlay-colour: string) (overlay-type: string) (file-path: string)")>] [] [] let ``draw-image`` imgWidth imgHeight mainColour oColour oType path = try @@ -87,8 +87,7 @@ [] [] - [] + [] [] let ``list-colours`` () = printfn "[INFO.] Listing available colours..."