Skip to content

Commit 90690c2

Browse files
committed
Added fsdocs
1 parent f9db94f commit 90690c2

File tree

10 files changed

+162
-213
lines changed

10 files changed

+162
-213
lines changed

.config/dotnet-tools.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
"fsharp-analyzers"
2323
],
2424
"rollForward": false
25+
},
26+
"fsdocs-tool": {
27+
"version": "20.0.1",
28+
"commands": [
29+
"fsdocs"
30+
],
31+
"rollForward": false
2532
}
2633
}
2734
}

.github/workflows/docs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Docs
2+
3+
# Trigger this Action when new code is pushed to the main branch
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
# We need some permissions to publish to Github Pages
10+
permissions:
11+
contents: write
12+
pages: write
13+
id-token: write
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
# Checkout the source code
20+
- uses: actions/checkout@v4
21+
# Setup dotnet, please use a global.json to ensure the right SDK is used!
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v3
24+
# Restore the local tools
25+
- name: Restore tools
26+
run: dotnet tool restore
27+
# Build the code for the API documentation
28+
- name: Build code
29+
run: dotnet build -c Release Fs.Units.sln
30+
# Generate the documentation files
31+
- name: Generate the documentation'
32+
run: dotnet fsdocs build --properties Configuration=Release
33+
# Upload the static files
34+
- name: Upload documentation
35+
uses: actions/upload-pages-artifact@v2
36+
with:
37+
path: ./output
38+
39+
# GitHub Actions recommends deploying in a separate job.
40+
deploy:
41+
runs-on: ubuntu-latest
42+
needs: build
43+
steps:
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v2

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,4 +365,9 @@ MigrationBackup/
365365
.ionide/
366366

367367
# Fody - auto-generated XML schema
368-
FodyWeavers.xsd
368+
FodyWeavers.xsd
369+
370+
# FSharp.Formatting
371+
.fsdocs/
372+
output/
373+
tmp/

Directory.Build.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
<PropertyGroup>
3+
<RepositoryUrl>https://github.com/1eyewonder/Fs.Units</RepositoryUrl>
4+
<FsDocsLicenseLink>https://github.com/1eyewonder/Fs.Units/blob/main/LICENSE.md</FsDocsLicenseLink>
5+
<FsDocsReleaseNotesLink>https://github.com/1eyewonder/Fs.Units/blob/main/RELEASE_NOTES.md</FsDocsReleaseNotesLink>
6+
<PackageProjectUrl>https://1eyewonder.github.io/Fs.Units</PackageProjectUrl>
7+
</PropertyGroup>
8+
</Project>

README.md

Lines changed: 14 additions & 212 deletions
Original file line numberDiff line numberDiff line change
@@ -6,70 +6,34 @@ The goal of this library is to assist developers with quick proof of concepts as
66

77
Feedback and assistance are welcome!
88

9+
## Documentation
10+
11+
View our docs at https://1eyewonder.github.io/Fs.Units to see the full list of supported units of measure and how to use them.
12+
913
## NuGet
1014

11-
| Package | Release | Pre-Release | License |
12-
| ------- |--------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
13-
| Fs.Units | [![NuGet version (Fs.Units)](https://buildstats.info/nuget/Fs.Units)](https://www.nuget.org/packages/Fs.Units/) | [![NuGet](https://buildstats.info/nuget/Fs.Units?includePreReleases=true)](https://www.nuget.org/packages/Fs.Units/absoluteLatest) | [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/1eyewonder/Fs.Units/blob/main/LICENSE.md) |
14-
| Fs.Units.CSharp | [![NuGet version (Fs.Units.CSharp)](https://buildstats.info/nuget/Fs.Units.CSharp)](https://www.nuget.org/packages/Fs.Units.CSharp/) | [![NuGet](https://buildstats.info/nuget/Fs.Units.CSharp?includePreReleases=true)](https://www.nuget.org/packages/Fs.Units.CSharp/absoluteLatest) | [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/1eyewonder/Fs.Units/blob/main/LICENSE.md) |
15+
| Package | Release | Pre-Release | License |
16+
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
17+
| Fs.Units | [![NuGet version (Fs.Units)](https://buildstats.info/nuget/Fs.Units)](https://www.nuget.org/packages/Fs.Units/) | [![NuGet](https://buildstats.info/nuget/Fs.Units?includePreReleases=true)](https://www.nuget.org/packages/Fs.Units/absoluteLatest) | [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/1eyewonder/Fs.Units/blob/main/LICENSE.md) |
18+
| Fs.Units.CSharp | [![NuGet version (Fs.Units.CSharp)](https://buildstats.info/nuget/Fs.Units.CSharp)](https://www.nuget.org/packages/Fs.Units.CSharp/) | [![NuGet](https://buildstats.info/nuget/Fs.Units.CSharp?includePreReleases=true)](https://www.nuget.org/packages/Fs.Units.CSharp/absoluteLatest) | [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/1eyewonder/Fs.Units/blob/main/LICENSE.md) |
1519

1620
## Builds
1721

1822
| GitHub Actions |
19-
|:----------------------------------------------------------------------------------------------------------------------------------------------------------------:|
23+
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------: |
2024
| [![GitHub Actions](https://github.com/1eyewonder/Fs.Units/workflows/Build%20main/badge.svg)](https://github.com/1eyewonder/Fs.Units/actions?query=branch%3Amain) |
2125
| [![Build History](https://buildstats.info/github/chart/1eyewonder/Fs.Units?branch=main)](https://github.com/1eyewonder/Fs.Units/actions?query=branch%3Amain) |
2226

23-
## Table of Contents
24-
25-
- [Fs.Units](#fsunits)
26-
- [NuGet](#nuget)
27-
- [Builds](#builds)
28-
- [Table of Contents](#table-of-contents)
29-
- [Unit Types](#unit-types)
30-
- [Examples](#examples)
31-
- [F#](#f)
32-
- [Explicit Conversion Example](#explicit-conversion-example)
33-
- [Implicit Conversion Example](#implicit-conversion-example)
34-
- [C#](#c)
35-
- [Example](#example)
36-
- [Supported Unit Categories](#supported-unit-categories)
37-
- [Simple](#simple)
38-
- [Length](#length)
39-
- [Time](#time)
40-
- [Mass](#mass)
41-
- [Temperature](#temperature)
42-
- [Angle](#angle)
43-
- [DataStorage](#datastorage)
44-
- [Frequency](#frequency)
45-
- [Illuminance](#illuminance)
46-
- [Current](#current)
47-
- [Compound](#compound)
48-
- [Area](#area)
49-
- [Volume](#volume)
50-
- [FuelEconomy](#fueleconomy)
51-
- [Inertia](#inertia)
52-
- [Speed](#speed)
53-
- [Force](#force)
54-
- [DataTransferRate](#datatransferrate)
55-
- [Density](#density)
56-
- [Pressure](#pressure)
57-
- [Power](#power)
58-
- [Energy](#energy)
59-
- [ElectricCharge](#electriccharge)
60-
- [ElectromotiveForce](#electromotiveforce)
61-
- [Capacitance](#capacitance)
62-
- [Inductance](#inductance)
6327

6428
## Unit Types
6529

6630
- **Simple Units:** A basic unit of measure
6731
```fsharp
68-
[<Measure>] type inch
32+
[<Measure>] type inch
6933
```
7034
- **Compound Units:** Derived units of measure consisting of combinations of two or more units of measure
7135
```fsharp
72-
[<Measure>] type in2 = inch * inch
36+
[<Measure>] type in2 = inch * inch
7337
```
7438

7539
## Examples
@@ -86,7 +50,7 @@ let valueInFeet = Inch.create 1.0 |> Inch.toFeet // float<ft>
8650

8751
#### Implicit Conversion Example
8852

89-
For some compound units, implicit conversion is supported. This allows for a more natural syntax.
53+
For some compound units, implicit conversion is supported. This allows for a more natural syntax in certain instances.
9054

9155
```fsharp
9256
open Fs.Units
@@ -117,6 +81,7 @@ open Fs.Units.Helpers
11781
let value1 = Foot.create 1.0 // float<ft>
11882
let value2 = Foot.create 2.0 // float<ft>
11983
let maxValue = max value1 value2 // float<ft>
84+
let plainValue = Foot.create 1. |> removeUnits // float
12085
```
12186

12287
### C#
@@ -126,167 +91,4 @@ let maxValue = max value1 value2 // float<ft>
12691
using Fs.Units.CSharp;
12792

12893
var valueInFeet = 1d.InchToFeet(); // double
129-
```
130-
131-
## Supported Unit Categories
132-
133-
### Simple
134-
135-
#### Length
136-
- Inch
137-
- Foot
138-
- Yard
139-
- Mile
140-
- Millimeter
141-
- Centimeter
142-
- Decimeter
143-
- Meter
144-
- Kilometer
145-
- NauticalMile
146-
- Chain
147-
- Furlong
148-
- League
149-
- Hand
150-
- Rod
151-
#### Time
152-
- Nanosecond
153-
- Microsecond
154-
- Millisecond
155-
- Second
156-
- Minute
157-
- Hour
158-
- Day
159-
- Week
160-
- Fortnight
161-
- Month
162-
- Year
163-
- Decade
164-
- Century
165-
- Millenium
166-
- Eon
167-
#### Mass
168-
- Milligram
169-
- Gram
170-
- Kilogram
171-
- Pound mass
172-
#### Temperature
173-
- Kelvin
174-
- Celsius
175-
- Fahrenheit
176-
- Rankine
177-
#### Angle
178-
- Degree
179-
- Radian
180-
- Gradian
181-
- Revolution
182-
- Arcminute
183-
- Arcsecond
184-
#### DataStorage
185-
- Bit
186-
- Kilobit
187-
- Megabit
188-
- Gigabit
189-
- Terabit
190-
- Petabit
191-
- Byte
192-
- Kilobyte
193-
- Megabyte
194-
- Gigabyte
195-
- Terabyte
196-
- Petabyte
197-
#### Frequency
198-
- Hertz
199-
- Kilohertz
200-
- Megahertz
201-
- Gigahertz
202-
#### Illuminance
203-
- Footcandle
204-
- Lux
205-
- Phot
206-
- Nox
207-
#### Current
208-
- Microampere
209-
- Milliampere
210-
- Ampere
211-
- Biot
212-
213-
### Compound
214-
215-
#### Area
216-
- SquareInch
217-
- SquareFoot
218-
- SquareCentimeter
219-
- SquareMeter
220-
#### Volume
221-
- CubicInch
222-
- CubicFoot
223-
- CubicCentimeter
224-
- CubicMeter
225-
- Liter
226-
- Gallon
227-
#### FuelEconomy
228-
- MilesPerGallon
229-
- KilometersPerLiter
230-
#### Inertia
231-
- QuarticInch
232-
- QuarticCentimeter
233-
#### Speed
234-
- FeetPerSecond
235-
- MetersPerSecond
236-
- MilesPerHour
237-
- KilometersPerHour
238-
#### Force
239-
- Newton
240-
- PoundForce
241-
- Dyne
242-
- Kip
243-
#### DataTransferRate
244-
- Baud
245-
- BitsPerSecond
246-
- KilobitsPerSecond
247-
- MegabitsPerSecond
248-
- GigabitsPerSecond
249-
- TerabitsPerSecond
250-
- PetabitsPerSecond
251-
- BytesPerSecond
252-
- KilobytesPerSecond
253-
- MegabytesPerSecond
254-
- GigabytesPerSecond
255-
- TerabytesPerSecond
256-
- PetabytesPerSecond
257-
#### Density
258-
- KilogramsPerCubicMeter
259-
- GramsPerCubicCentimeter
260-
- PoundMassPerCubicFoot
261-
- PoundMassPerCubicInch
262-
#### Pressure
263-
- Pascal
264-
- PoundsPerSquareInch
265-
#### Power
266-
- Watt
267-
- KiloWatt
268-
- ImperialHorsepower
269-
- TonOfRefrigeration
270-
#### Energy
271-
- Joules
272-
- KiloJoules
273-
- BritishThermalUnits
274-
- calories
275-
- Quads
276-
- Q
277-
#### ElectricCharge
278-
- Coulomb
279-
- AmpereHour
280-
- AmpereSecond
281-
#### ElectromotiveForce
282-
- Microvolts
283-
- Millivolts
284-
- Volts
285-
- Kilovolts
286-
- Megavolts
287-
#### Capacitance
288-
- Farads
289-
#### Inductance
290-
- MicroHenrys
291-
- MilliHenrys
292-
- Henrys
94+
```

docs/img/logo.png

158 KB
Loading

0 commit comments

Comments
 (0)