Skip to content

Commit f23ed02

Browse files
committed
API docs.
1 parent ad1e908 commit f23ed02

File tree

7 files changed

+207
-0
lines changed

7 files changed

+207
-0
lines changed

.github/workflows/typedoc.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: API docs
2+
on:
3+
pull_request:
4+
push:
5+
6+
jobs:
7+
# The main documentation is built by readthedocs.
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- run: corepack enable
12+
- uses: actions/checkout@v5
13+
- uses: actions/setup-node@v6
14+
with:
15+
cache: "pnpm"
16+
- name: Build
17+
run: |
18+
pnpm install
19+
pnpm exec typedoc
20+
- name: Upload
21+
id: deployment
22+
uses: actions/upload-pages-artifact@v3
23+
with:
24+
path: ./typedoc
25+
deploy:
26+
permissions:
27+
contents: read
28+
pages: write
29+
id-token: write
30+
environment:
31+
name: github-pages
32+
url: ${{ steps.deployment.outputs.page_url }}
33+
runs-on: ubuntu-latest
34+
needs: build
35+
steps:
36+
- name: Deploy to GitHub Pages
37+
id: deployment
38+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ dist
33

44
.nyc_output
55
coverage
6+
7+
typedoc

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"sinon": "^21.0.1",
5555
"sinon-chai": "^4.0.1",
5656
"tsx": "^4.21.0",
57+
"typedoc": "^0.28.15",
5758
"typescript": "^5.9.3",
5859
"typescript-eslint": "^8.52.0"
5960
},

pnpm-lock.yaml

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

src/element/index.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@ import { CeresElement } from "./element";
22
import type { Children, Tag } from "./types";
33

44
export { CeresElement } from "./element";
5+
6+
/**
7+
* Creates a ceres element.
8+
* Shorthand for `new CeresElement()`.
9+
* @see {@link CeresElement}
10+
*
11+
* @example
12+
* ```typescript
13+
* $element("span", {}, ceres)
14+
* .mount(root);
15+
* ```
16+
*
17+
* @param tag The HTML tag.
18+
* @param props Element attributes.
19+
* @param children A single string or a list of child elements.
20+
* @returns A new CeresElement.
21+
*/
522
export function $element<const ElementTag extends Tag>(
623
tag: ElementTag,
724
props: unknown,

0 commit comments

Comments
 (0)