Skip to content

Commit c95ec58

Browse files
authored
feat(docs): Fixed Markdownlint, added cspell words and slight sample Readme improvement (#1563)
Added files: - markdownlint - cSpell fixed lintings accordingly: - root Readme - samples Readme(s) - Contributing.md Improved also sample explanation by embedding a codeblock from the linked file to enable also showing this md file in future maybe docfx created web docs
1 parent a4477c8 commit c95ec58

File tree

7 files changed

+156
-42
lines changed

7 files changed

+156
-42
lines changed

.markdownlint.jsonc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"default": true,
3+
"line-length": false,
4+
"no-inline-html": false,
5+
"no-bare-urls": false,
6+
"no-emphasis-as-heading": false,
7+
"code-block-style": {
8+
"style": "fenced"
9+
},
10+
// Headers must start at the beginning of the line - false positive in some cases where it makes sense.
11+
"MD023": false,
12+
// First line in a file should be a top-level heading - false positive for include files.
13+
"MD041": false,
14+
// Link fragments should be valid - false positive for DocFx tabs
15+
"MD051": false
16+
}

CONTRIBUTING.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Contributing to Units.NET
22

33
Guidelines for contributing to the repo.
4-
4+
<!--markdownlint-disable MD026 -->
55
## We want your help and we are friendly to first-time contributors!
6+
67
Adding a new unit or a new quantity is easy! We have detailed the steps here and if you need any assistance we are happy to help!
78

89
https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit
@@ -11,20 +12,24 @@ We also want the person with the idea, suggestion or bug report to implement the
1112
This is to help grow the number of people that can contribute to the project and after someone new lands that first PR we often see more PRs from that person later.
1213

1314
## Coding Conventions
15+
1416
* Match the existing code style, we generally stick to "Visual Studio defaults" and [.NET Foundation Coding Guidelines](https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md)
1517
* If you use ReSharper there is a [settings file](https://github.com/angularsen/UnitsNet/blob/master/UnitsNet.sln.DotSettings) that will take effect automatically
1618
* There is an [.editorconfig](https://github.com/angularsen/UnitsNet/blob/master/.editorconfig) to help configure whitespace and C# syntax for your editor if it supports it
1719
* Add the file header to new files you create
1820

1921
### Test Code
22+
2023
* Test class: Use `Tests` suffix for the type you are testing, such as `UnitSystemTests`
2124
* Test method: `<method>_<condition>_<result>` (`Parse_AmbiguousUnits_ThrowsException`)
2225
* If there are many tests for a single method, you can wrap those in an inner class named the same as the method and then you can skip that part of the test method names
2326

2427
## Unit definitions (.JSON)
28+
2529
For a fairly complete summary of the unit definition JSON schema, see [Meter of Length](https://github.com/angularsen/UnitsNet/blob/master/Common/UnitDefinitions/Length.json). It has prefix units and multiple cultures.
2630

2731
### Conversion functions
32+
2833
Converting from unit A to B is achieved by first converting from unit A to the base unit, then from the base unit to unit B. To achieve this, each unit defines two conversion functions.
2934

3035
* Prefer multiplication for `FromUnitToBaseFunc` (`{x} * 2.54e-2` for `Inch` to `Meter`)
@@ -34,13 +39,15 @@ Converting from unit A to B is achieved by first converting from unit A to the b
3439
* Prefer a calculation if the conversion factor is infinite (`({x} / 72.27)*2.54e-2` for `PrinterPoint`)
3540

3641
### Units
42+
3743
Generally we try to name the units as what is the most widely used.
3844

3945
* Use prefix for country variants, such as `ImperialGallon` and `UsGallon`
4046

4147
**Note:** We should really consider switching variant prefix to suffix, since that plays better with kilo, mega etc.. Currently we have units named `KilousGallon` and `KiloimperialGallon`, these would be better named `KilogallonUs` and `KilogallonImperial`.
4248

4349
### Unit abbreviations
50+
4451
A unit can have multiple abbreviations per culture/language, the first one is used by `ToString()` while all of them are used by `Parse()`.
4552

4653
* Prefer the most widely used abbreviation in the domain, but try to adapt to our conventions

Docs/top-dependencies.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
| url | stars |
1+
# Top Dependencies by GitHub Stars
2+
3+
The following table lists the top public repositories using Units.NET, along with their GitHub star counts (as of May 2025):
4+
5+
| Repo | Stars |
26
|-----------------------------------------------------------------|---------|
3-
| https://github.com/microsoft/PowerToys | 93K |
4-
| https://github.com/dotnet/iot | 2.0K |
5-
| https://github.com/angularsen/UnitsNet | 1.9K |
6-
| https://github.com/genielabs/HomeGenie | 367 |
7-
| https://github.com/raspberry-sharp/raspberry-sharp-io | 337 |
7+
| https://github.com/microsoft/PowerToys | 120K |
8+
| https://github.com/dotnet/iot | 2.3K |
9+
| https://github.com/genielabs/HomeGenie | 410 |
10+
| https://github.com/raspberry-sharp/raspberry-sharp-io | 340 |
11+
| https://github.com/nanoframework/nanoFramework.IoT.Device | 258 |
12+
| https://github.com/porrey/Virtual-ZPL-Printer | 240 |
813
| https://github.com/chino-os/chino-os | 147 |
9-
| https://github.com/BriefFiniteElementNet/BriefFiniteElement.Net | 128 |
10-
| https://github.com/porrey/Virtual-ZPL-Printer | 95 |
11-
| https://github.com/WhiteBlackGoose/UnitsOfMeasure | 56 |
12-
| https://github.com/pi-top/pi-top-4-.NET-SDK | 47 |
13-
found 451 repositories others repositories are private
14-
found 154 repositories with more than zero star
14+
| https://github.com/BriefFiniteElementNet/BriefFiniteElement.Net | 156 |
15+
| https://github.com/WhiteBlackGoose/UnitsOfMeasure | 59 |
16+
| https://github.com/pi-top/pi-top-4-.NET-SDK | 50 |
17+
18+
_Total repositories listed: 10_
1519

20+
_Star counts are based on the latest data in the main README and may change over time._

0 commit comments

Comments
 (0)