Skip to content

Commit 4e8645d

Browse files
authored
Merge pull request #13 from jakeboone02/typedoc-docs
Migrate docs to typedoc
2 parents f1ceda6 + a42413a commit 4e8645d

29 files changed

+2601
-60
lines changed

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"prettier.prettierPath": "./node_modules/prettier",
32
"editor.formatOnSave": true
4-
}
3+
}

README.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# format-quantity
2-
31
[![npm][badge-npm]](https://www.npmjs.com/package/format-quantity)
42
![workflow status](https://github.com/jakeboone02/format-quantity/actions/workflows/main.yml/badge.svg)
53
[![codecov.io](https://codecov.io/github/jakeboone02/format-quantity/coverage.svg?branch=main)](https://codecov.io/github/jakeboone02/format-quantity?branch=main)
@@ -8,11 +6,13 @@
86

97
Formats a number (or string that appears to be a number) as one would see it written in imperial measurements, e.g. "1 1/2" instead of "1.5".
108

9+
**[Full documentation](https://jakeboone02.github.io/format-quantity/)**
10+
1111
Features:
1212

13-
- To use vulgar fraction characters like "⅞", pass `true` as the second argument (see other [options](#options), like Roman numerals, below).
13+
- To use vulgar fraction characters like "⅞", pass `true` as the second argument. Other options like Roman numerals are described below.
1414
- The return value will be `null` if the first argument is neither a number nor a string that evaluates to a number using `parseFloat`.
15-
- The return value will be an empty string (`""`) if the first argument is `0` or `"0"`, which is done to fit the primary use case of formatting recipe ingredient quantities.
15+
- The return value will be an empty string (`""`) if the first argument is `0` or `"0"`, which fits the primary use case of formatting recipe ingredient quantities.
1616

1717
> _For the inverse operation—converting a string to a `number`—check out [numeric-quantity](https://www.npmjs.com/package/numeric-quantity). It handles mixed numbers, vulgar fractions, comma/underscore separators, and Roman numerals._
1818
>
@@ -118,18 +118,4 @@ formatQuantity(1214, { romanNumerals: true }); // "MCCXIV"
118118
formatQuantity(12.14, { romanNumerals: true, vulgarFractions: true }); // "XII"
119119
```
120120

121-
## Other exports
122-
123-
| Name | Type | Description |
124-
| ------------------------ | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
125-
| `defaultTolerance` | `number` | `0.0075` |
126-
| `defaultOptions` | `type` | Object representing the default options |
127-
| `fractionDecimalMatches` | <code>[number, VulgarFraction \| Sixteenth][]</code> | List of decimal values that are close enough to match the associated fraction (inputs are evaluated against the decimal values in the order of this array) |
128-
| `vulgarToAsciiMap` | `object` | Map of vulgar fraction characters to their equivalent ASCII strings (`"⅓"` to `"1/3"`, `"⅞"` to `"7/8"`, etc.) |
129-
| `formatRomanNumerals` | `function` | Formats a number as Roman numerals (used internally by `formatQuantity` when the `romanNumerals` option is `true`) |
130-
| `FormatQuantityOptions` | `interface` | Shape of `formatQuantity`'s second parameter (if not a `boolean` value) |
131-
| `SimpleFraction` | `type` | String template type for valid (positive, no division by zero) ASCII fraction strings with either one or two digits in the numerator and denominator each |
132-
| `VulgarFraction` | `type` | The set of [vulgar fraction characters](https://en.wikipedia.org/wiki/Number_Forms) (`"\u00bc"`, `"\u00bd"`, `"\u00be"`, and `"\u2150"` through `"\u215e"`) |
133-
| `Sixteenth` | `type` | Union type of all ASCII representations of odd-numbered sixteenth fractions less than one, (`"1/16"`, `"3/16"`, etc.) |
134-
135121
[badge-npm]: https://img.shields.io/npm/v/numeric-quantity.svg?cacheSeconds=3600&logo=npm

_config.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

bun.lockb

3.99 KB
Binary file not shown.

docs/.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.

docs/assets/highlight.css

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
:root {
2+
--light-hl-0: #AF00DB;
3+
--dark-hl-0: #C586C0;
4+
--light-hl-1: #000000;
5+
--dark-hl-1: #D4D4D4;
6+
--light-hl-2: #001080;
7+
--dark-hl-2: #9CDCFE;
8+
--light-hl-3: #A31515;
9+
--dark-hl-3: #CE9178;
10+
--light-hl-4: #795E26;
11+
--dark-hl-4: #DCDCAA;
12+
--light-hl-5: #098658;
13+
--dark-hl-5: #B5CEA8;
14+
--light-hl-6: #008000;
15+
--dark-hl-6: #6A9955;
16+
--light-hl-7: #0000FF;
17+
--dark-hl-7: #569CD6;
18+
--light-hl-8: #800000;
19+
--dark-hl-8: #808080;
20+
--light-hl-9: #800000;
21+
--dark-hl-9: #569CD6;
22+
--light-hl-10: #000000FF;
23+
--dark-hl-10: #D4D4D4;
24+
--light-hl-11: #E50000;
25+
--dark-hl-11: #9CDCFE;
26+
--light-hl-12: #0000FF;
27+
--dark-hl-12: #CE9178;
28+
--light-code-background: #FFFFFF;
29+
--dark-code-background: #1E1E1E;
30+
}
31+
32+
@media (prefers-color-scheme: light) { :root {
33+
--hl-0: var(--light-hl-0);
34+
--hl-1: var(--light-hl-1);
35+
--hl-2: var(--light-hl-2);
36+
--hl-3: var(--light-hl-3);
37+
--hl-4: var(--light-hl-4);
38+
--hl-5: var(--light-hl-5);
39+
--hl-6: var(--light-hl-6);
40+
--hl-7: var(--light-hl-7);
41+
--hl-8: var(--light-hl-8);
42+
--hl-9: var(--light-hl-9);
43+
--hl-10: var(--light-hl-10);
44+
--hl-11: var(--light-hl-11);
45+
--hl-12: var(--light-hl-12);
46+
--code-background: var(--light-code-background);
47+
} }
48+
49+
@media (prefers-color-scheme: dark) { :root {
50+
--hl-0: var(--dark-hl-0);
51+
--hl-1: var(--dark-hl-1);
52+
--hl-2: var(--dark-hl-2);
53+
--hl-3: var(--dark-hl-3);
54+
--hl-4: var(--dark-hl-4);
55+
--hl-5: var(--dark-hl-5);
56+
--hl-6: var(--dark-hl-6);
57+
--hl-7: var(--dark-hl-7);
58+
--hl-8: var(--dark-hl-8);
59+
--hl-9: var(--dark-hl-9);
60+
--hl-10: var(--dark-hl-10);
61+
--hl-11: var(--dark-hl-11);
62+
--hl-12: var(--dark-hl-12);
63+
--code-background: var(--dark-code-background);
64+
} }
65+
66+
:root[data-theme='light'] {
67+
--hl-0: var(--light-hl-0);
68+
--hl-1: var(--light-hl-1);
69+
--hl-2: var(--light-hl-2);
70+
--hl-3: var(--light-hl-3);
71+
--hl-4: var(--light-hl-4);
72+
--hl-5: var(--light-hl-5);
73+
--hl-6: var(--light-hl-6);
74+
--hl-7: var(--light-hl-7);
75+
--hl-8: var(--light-hl-8);
76+
--hl-9: var(--light-hl-9);
77+
--hl-10: var(--light-hl-10);
78+
--hl-11: var(--light-hl-11);
79+
--hl-12: var(--light-hl-12);
80+
--code-background: var(--light-code-background);
81+
}
82+
83+
:root[data-theme='dark'] {
84+
--hl-0: var(--dark-hl-0);
85+
--hl-1: var(--dark-hl-1);
86+
--hl-2: var(--dark-hl-2);
87+
--hl-3: var(--dark-hl-3);
88+
--hl-4: var(--dark-hl-4);
89+
--hl-5: var(--dark-hl-5);
90+
--hl-6: var(--dark-hl-6);
91+
--hl-7: var(--dark-hl-7);
92+
--hl-8: var(--dark-hl-8);
93+
--hl-9: var(--dark-hl-9);
94+
--hl-10: var(--dark-hl-10);
95+
--hl-11: var(--dark-hl-11);
96+
--hl-12: var(--dark-hl-12);
97+
--code-background: var(--dark-code-background);
98+
}
99+
100+
.hl-0 { color: var(--hl-0); }
101+
.hl-1 { color: var(--hl-1); }
102+
.hl-2 { color: var(--hl-2); }
103+
.hl-3 { color: var(--hl-3); }
104+
.hl-4 { color: var(--hl-4); }
105+
.hl-5 { color: var(--hl-5); }
106+
.hl-6 { color: var(--hl-6); }
107+
.hl-7 { color: var(--hl-7); }
108+
.hl-8 { color: var(--hl-8); }
109+
.hl-9 { color: var(--hl-9); }
110+
.hl-10 { color: var(--hl-10); }
111+
.hl-11 { color: var(--hl-11); }
112+
.hl-12 { color: var(--hl-12); }
113+
pre, code { background: var(--code-background); }

docs/assets/main.js

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/search.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)