Skip to content

Commit 2ed25c0

Browse files
committed
style: README のコードブロックをフォーマット
1 parent 265d8a8 commit 2ed25c0

File tree

3 files changed

+25
-30
lines changed

3 files changed

+25
-30
lines changed

packages/ast/README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,13 @@ bun add @wdprlib/ast
1111
## Usage
1212

1313
```ts
14-
import type { SyntaxTree, Element } from '@wdprlib/ast'
15-
import { text, paragraph, bold } from '@wdprlib/ast'
14+
import type { SyntaxTree, Element } from "@wdprlib/ast";
15+
import { text, paragraph, bold } from "@wdprlib/ast";
1616

1717
// Create AST nodes
1818
const tree: SyntaxTree = {
19-
elements: [
20-
paragraph([
21-
bold([text('Hello')]),
22-
text(' world'),
23-
]),
24-
],
25-
}
19+
elements: [paragraph([bold([text("Hello")]), text(" world")])],
20+
};
2621
```
2722

2823
## Exports

packages/render/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,31 @@ bun add @wdprlib/render
1111
## Usage
1212

1313
```ts
14-
import { parse } from '@wdprlib/parser'
15-
import { renderToHtml } from '@wdprlib/render'
16-
import type { PageContext, RenderOptions } from '@wdprlib/render'
14+
import { parse } from "@wdprlib/parser";
15+
import { renderToHtml } from "@wdprlib/render";
16+
import type { PageContext, RenderOptions } from "@wdprlib/render";
1717

18-
const ast = parse('**Hello** world')
18+
const ast = parse("**Hello** world");
1919

2020
// Basic rendering
21-
const html = renderToHtml(ast)
21+
const html = renderToHtml(ast);
2222

2323
// With page context and resolvers
2424
const pageContext: PageContext = {
25-
pageName: 'main',
26-
site: 'mysite',
27-
domain: 'mysite.example.com',
25+
pageName: "main",
26+
site: "mysite",
27+
domain: "mysite.example.com",
2828
pageExists: (name) => checkPageExists(name),
29-
}
29+
};
3030

3131
const html = renderToHtml(ast, {
3232
page: pageContext,
3333
footnotes: ast.footnotes,
3434
resolvers: {
35-
user: (username) => ({ name: username, displayName: 'Display Name' }),
35+
user: (username) => ({ name: username, displayName: "Display Name" }),
3636
htmlBlockUrl: (index) => `/local--html/page/${index}`,
3737
},
38-
})
38+
});
3939
```
4040

4141
## Features

packages/runtime/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@ bun add @wdprlib/runtime
1111
## Usage
1212

1313
```ts
14-
import { initWdprRuntime } from '@wdprlib/runtime'
15-
import type { WdprRuntime, RuntimeOptions } from '@wdprlib/runtime'
14+
import { initWdprRuntime } from "@wdprlib/runtime";
15+
import type { WdprRuntime, RuntimeOptions } from "@wdprlib/runtime";
1616

1717
// Initialize after DOM is ready
1818
const runtime: WdprRuntime = initWdprRuntime({
19-
root: document.getElementById('page-content') as HTMLElement,
19+
root: document.getElementById("page-content") as HTMLElement,
2020
onRate: async (pageId, points) => {
21-
const res = await fetch('/api/rate', {
22-
method: 'POST',
23-
headers: { 'Content-Type': 'application/json' },
21+
const res = await fetch("/api/rate", {
22+
method: "POST",
23+
headers: { "Content-Type": "application/json" },
2424
body: JSON.stringify({ page_id: pageId, points }),
25-
})
26-
return res.json()
25+
});
26+
return res.json();
2727
},
28-
})
28+
});
2929

3030
// Cleanup when navigating away or re-rendering
31-
runtime.destroy()
31+
runtime.destroy();
3232
```
3333

3434
## Features

0 commit comments

Comments
 (0)