Skip to content

Commit fa6b3c1

Browse files
committed
Change format docs from md to svelte
1 parent 523c609 commit fa6b3c1

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

packages/svelte-ux/src/routes/docs/utils/format/+page.md renamed to packages/svelte-ux/src/routes/docs/utils/format/+page.svelte

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
<script lang="ts">
2-
import Preview from '$lib/components/Preview.svelte';
3-
import { format } from '$lib/utils/format';
4-
import { PeriodType } from '$lib/utils/date';
2+
import Preview from '$lib/components/Preview.svelte';
3+
import { format } from '$lib/utils/format';
4+
import { PeriodType } from '$lib/utils/date';
5+
import Code from '$lib/components/Code.svelte';
56
67
const date = new Date('1982-03-30T00:00:00');
78
</script>
89

910
<h1>Usage</h1>
1011

11-
```svelte
12-
<script>
13-
import { format } from 'svelte-ux';
14-
</script>
15-
```
12+
<Code source={`import { format } from 'svelte-ux';`} language="javascript" class="mb-4" />
1613

1714
<h1>Examples</h1>
1815

@@ -22,11 +19,11 @@
2219
<div>{format(1234.56, 'integer')}</div>
2320
<div>{format(1234.56, 'decimal')}</div>
2421
<div>{format(1234.56, 'currency')}</div>
25-
<div>{format(.5678, 'percent')}</div>
26-
<div>{format(.5678, 'percentRound')}</div>
22+
<div>{format(0.5678, 'percent')}</div>
23+
<div>{format(0.5678, 'percentRound')}</div>
2724
<div>{format(1_234_567, 'metric')}</div>
2825
<div>{format(1_200_000, 'metric')}</div>
29-
<div>{format(.5678, 'percent', 1)}</div>
26+
<div>{format(0.5678, 'percent', 1)}</div>
3027
</Preview>
3128

3229
<h2>Period formats</h2>

packages/svelte-ux/src/routes/docs/utils/format/+page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import source from '$lib/utils/format.ts?raw';
2-
import pageSource from './+page.md?raw';
2+
import pageSource from './+page.svelte?raw';
33

44
export async function load() {
55
return {

0 commit comments

Comments
 (0)