├── .editorconfig
├── .github
└── workflows
│ ├── docs.yml
│ └── test.yml
├── .gitignore
├── .prettierignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── dist
└── .gitkeep
├── docs
├── .gitignore
├── README.md
├── babel.config.js
├── docs
│ ├── .nojekyll
│ └── howto
│ │ ├── intro.md
│ │ └── xternal.md
├── docusaurus.config.js
├── package.json
├── pnpm-lock.yaml
├── sidebars.js
├── src
│ ├── components
│ │ └── HomepageFeatures
│ │ │ ├── index.js
│ │ │ └── styles.module.css
│ ├── css
│ │ └── custom.css
│ └── pages
│ │ ├── index.js
│ │ └── index.module.css
├── static
│ ├── .nojekyll
│ ├── demo.gif
│ └── img
│ │ ├── docusaurus-social-card.jpg
│ │ ├── docusaurus.png
│ │ ├── favicon.ico
│ │ ├── logo.svg
│ │ ├── undraw_docusaurus_mountain.svg
│ │ ├── undraw_docusaurus_react.svg
│ │ └── undraw_docusaurus_tree.svg
└── typedoc.json
├── example
├── README.md
├── package.json
├── pnpm-lock.yaml
├── src
│ ├── index.jsx
│ └── types.d.ts
├── tsconfig.hono.json
└── tsconfig.json
├── mkdocs.yml
├── package.json
├── pnpm-lock.yaml
├── rules
└── no-extensionless-relative-import.yml
├── scripts
├── dist.sh
└── release.sh
├── sgconfig.yml
├── src
├── index.ts
├── jsx.d.ts
└── typed-html
│ ├── jsx-dev-runtime.ts
│ └── jsx-runtime.ts
├── static
└── demo.gif
├── tests
└── static-jsx
│ ├── jest.config.js
│ ├── main.test.jsx
│ ├── package.json
│ ├── pnpm-lock.yaml
│ └── tsconfig.json
├── tsconfig.esm.json
└── tsconfig.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*]
2 | indent_style = tab
3 | indent_size = 2
4 | max_line_length = 120
5 |
6 | [*.{md,yml,yaml}]
7 | indent_style = space
8 | indent_size = 2
9 | max_line_length = 80
10 |
11 | [*.{js,jsx,ts,tsx}]
12 | quote_type = double
13 |
--------------------------------------------------------------------------------
/.github/workflows/docs.yml:
--------------------------------------------------------------------------------
1 | name: docs
2 |
3 | on:
4 | pull_request:
5 | branches: [main]
6 | push:
7 | branches: [main]
8 |
9 | concurrency:
10 | group: docs-${{ github.ref }}
11 | cancel-in-progress: true
12 |
13 | defaults:
14 | run:
15 | working-directory: docs
16 |
17 | jobs:
18 | build:
19 | runs-on: ubuntu-latest
20 | steps:
21 | - uses: actions/checkout@v3
22 | - uses: pnpm/action-setup@v2
23 | with:
24 | version: 8
25 | - uses: actions/setup-node@v3
26 | with:
27 | cache: pnpm
28 | cache-dependency-path: docs/pnpm-lock.yaml
29 |
30 | - run: pnpm install
31 | working-directory: .
32 | - name: Build library
33 | run: pnpm dist
34 | working-directory: .
35 |
36 | - run: pnpm install
37 | - run: pnpm docusaurus generate-typedoc
38 | - name: Build website
39 | run: pnpm build
40 | - name: Upload artifacts
41 | uses: actions/upload-pages-artifact@v1
42 | with:
43 | path: docs/build
44 | deploy:
45 | needs: build
46 | permissions:
47 | pages: write
48 | id-token: write
49 | environment:
50 | name: github-pages
51 | url: ${{ steps.deployment.outputs.page_url }}
52 | runs-on: ubuntu-latest
53 | steps:
54 | - name: Deploy to GitHub Pages
55 | uses: actions/deploy-pages@v1
56 | id: deployment
57 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3 |
4 | name: tests
5 |
6 | on:
7 | push:
8 | branches: ["main"]
9 | paths-ignore: ["**.md"]
10 | pull_request:
11 | branches: ["main"]
12 | paths-ignore: ["**.md"]
13 |
14 | env:
15 | CARGO_TERM_COLOR: always
16 |
17 | jobs:
18 | static-jsx:
19 | concurrency:
20 | group: ci-test-static-jsx-${{ github.ref }}-${{ matrix.node-version }}
21 | cancel-in-progress: true
22 | runs-on: ubuntu-latest
23 | defaults:
24 | run:
25 | working-directory: tests/static-jsx
26 |
27 | strategy:
28 | matrix:
29 | node-version: [16.x, 18.x, 20.x]
30 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
31 |
32 | steps:
33 | - uses: actions/checkout@v3
34 | - uses: pnpm/action-setup@v2
35 | with:
36 | version: 8
37 | - name: Use Node.js ${{ matrix.node-version }}
38 | uses: actions/setup-node@v3
39 | with:
40 | node-version: ${{ matrix.node-version }}
41 | cache: "pnpm"
42 | cache-dependency-path: tests/static-jsx/pnpm-lock.yaml
43 | - run: pnpm install
44 | - name: Install dependencies (typed-htmx)
45 | run: pnpm install
46 | working-directory: .
47 | - name: Build library
48 | run: pnpm dist
49 | working-directory: .
50 | - run: pnpm test
51 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
3 | docs/reference
4 | website
5 | .swc
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | pnpm-lock.yaml
2 | docs
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## 0.3.1
4 |
5 | - Fix bug introduced in last version, which disallowed ambient type imports
6 | - More completions for `hx-on-` and `hx-target`
7 |
8 | ## 0.3.0
9 |
10 | - Update definitions for htmx 1.9.10
11 |
12 | ## 0.2.3
13 |
14 | - Fix bug introduced in previous version that breaks the built-in HTML renderer
15 |
16 | ## 0.2.2
17 |
18 | - Fix ESM imports when not using bundlers
19 |
20 | ## 0.2.1
21 |
22 | - Fix types when not using typed-html
23 |
24 | ## 0.2.0
25 |
26 | - _(Breaking)_ `jsxConfig.jsonAttributes` changed to be a Set
27 | - New template function `html` for compatibility with swc-plugin-static-jsx
28 |
29 | ## 0.1.4
30 |
31 | - Do not doubly sanitize fragment children
32 |
33 | ## 0.1.3
34 |
35 | - Rename `config` to `jsxConfig`; imported directly from `typed-htmx`
36 | - When `jsxConfig.trusted` is false (default) and `jsxConfig.sanitize` is
37 | defined, plain text and interpolated values are sanitized
38 | - Slight reduction in performance, dependent on the sanitizer supplied
39 |
40 | ## 0.1.2
41 |
42 | - Fix `Fragment` not accepting non-array children and not sanitizing children
43 | - Increase jsx robustness against falsy values
44 | - Fix the value 0 not being rendered
45 |
46 | ## 0.1.1
47 |
48 | - Allow `jsx` to process arrays of children, unblocks Bun
49 |
50 | ## 0.1.0
51 |
52 | - Initialize package
53 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | ISC License
2 |
3 | Copyright (c) 2023 Viet Dinh
4 |
5 | Permission to use, copy, modify, and/or distribute this software for any purpose
6 | with or without fee is hereby granted, provided that the above copyright notice
7 | and this permission notice appear in all copies.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
11 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
13 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
14 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
15 | THIS SOFTWARE.
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # typed-htmx
2 |
3 | [](https://www.npmjs.com/package/typed-htmx)
4 | [](https://github.com/Desdaemon/typed-htmx/actions/workflows/docs.yml)
5 | [](https://github.com/Desdaemon/typed-htmx/actions/workflows/test.yml)
6 |
7 | [](https://asciinema.org/a/598553)
8 |
9 | Definitions for htmx attributes in JSX.
10 |
11 | ## Usage
12 |
13 | You can configure `typed-htmx` either as pure type declarations, or as a JSX
14 | templating engine.
15 |
16 | ### As type declarations
17 |
18 | Configure your `tsconfig.json` as follows:
19 |
20 | ```jsonc
21 | {
22 | "compilerOptions": {
23 | "jsx": "react",
24 | "moduleResolution": "node16", // or "nodenext"
25 | "types": ["typed-htmx" /** and any other types you need */]
26 | }
27 | }
28 | ```
29 |
30 | An alternative is to include a _[triple-slash directive]_ wherever you need
31 | completions for htmx attributes:
32 |
33 | ```jsx
34 | ///
35 |
36 | function MyComponent({ children }) {
37 | return
{children}
;
38 | // ^?: string | undefined
39 | }
40 | ```
41 |
42 | If your frontend library injects its own JSX types, you'll need to augment it.
43 | See the [example project](https://github.com/Desdaemon/typed-htmx/tree/main/example)
44 | for a demo. typed-html and React are supported out of the box.
45 |
46 | ### As a JSX templating engine
47 |
48 | If you prefer to use JSX only for its templating capabilities in the vein of
49 | [typed-html], you can use `typed-htmx/typed-html` which is included with this
50 | library and optimized for htmx usage:
51 |
52 | - Attributes such as [`hx-vals`](https://htmx.org/attributes/hx-vals/) and
53 | [`hx-headers`](https://htmx.org/attributes/hx-headers/) may also accept an object
54 | literal, which will be stringified on demand.
55 | - Configurable options for sanitization, defaults to a no-op.
56 |
57 | Configure your `tsconfig.json` as follows:
58 |
59 | ```jsonc
60 | {
61 | "compilerOptions": {
62 | "jsx": "react-jsx",
63 | "jsxImportSource": "typed-htmx/typed-html",
64 | "moduleResolution": "node16" // or "nodenext"
65 | }
66 | }
67 | ```
68 |
69 | [typed-html]: https://github.com/nicojs/typed-html
70 | [triple-slash directive]: https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html
71 |
--------------------------------------------------------------------------------
/dist/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Desdaemon/typed-htmx/aa7f1336d5ee1a915c98329aba6b0e2debed132a/dist/.gitkeep
--------------------------------------------------------------------------------
/docs/.gitignore:
--------------------------------------------------------------------------------
1 | # Dependencies
2 | /node_modules
3 |
4 | # Production
5 | /build
6 |
7 | # Generated files
8 | .docusaurus
9 | .cache-loader
10 | docs/api
11 |
12 | # Misc
13 | .DS_Store
14 | .env.local
15 | .env.development.local
16 | .env.test.local
17 | .env.production.local
18 |
19 | npm-debug.log*
20 | yarn-debug.log*
21 | yarn-error.log*
22 |
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # Website
2 |
3 | This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4 |
5 | ### Installation
6 |
7 | ```
8 | $ yarn
9 | ```
10 |
11 | ### Local Development
12 |
13 | ```
14 | $ yarn start
15 | ```
16 |
17 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18 |
19 | ### Build
20 |
21 | ```
22 | $ yarn build
23 | ```
24 |
25 | This command generates static content into the `build` directory and can be served using any static contents hosting service.
26 |
27 | ### Deployment
28 |
29 | Using SSH:
30 |
31 | ```
32 | $ USE_SSH=true yarn deploy
33 | ```
34 |
35 | Not using SSH:
36 |
37 | ```
38 | $ GIT_USER= yarn deploy
39 | ```
40 |
41 | If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
42 |
--------------------------------------------------------------------------------
/docs/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
3 | };
4 |
--------------------------------------------------------------------------------
/docs/docs/.nojekyll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Desdaemon/typed-htmx/aa7f1336d5ee1a915c98329aba6b0e2debed132a/docs/docs/.nojekyll
--------------------------------------------------------------------------------
/docs/docs/howto/intro.md:
--------------------------------------------------------------------------------
1 | # Intro
2 |
3 | ## Demo
4 |
5 | ```jsx twoslash
6 | // @errors: 2322
7 |
8 | function MyComponent({ children }) {
9 | return (
10 | "" +
11 | (
12 |
13 |
14 | My Website
15 |
16 |
17 |
18 | {children}
19 |
26 |
27 |
28 |
29 | )
30 | );
31 | }
32 | ```
33 |
34 | ## Install
35 |
36 | ```shell
37 | npm i typed-htmx
38 | ```
39 |
40 | You can also install as a dev dependency if you're only using the type definitions.
41 |
42 | ## Usage
43 |
44 | You can configure typed-htmx either as pure type declarations, or as a JSX
45 | templating engine.
46 |
47 | ### As type declarations
48 |
49 | Configure your `tsconfig.json` as follows:
50 |
51 | ```jsonc
52 | {
53 | "compilerOptions": {
54 | "jsx": "react",
55 | "moduleResolution": "node16", // or "nodenext"
56 | "types": ["typed-htmx" /** and any other types you need */]
57 | }
58 | }
59 | ```
60 |
61 | An alternative is to include a _[triple-slash directive]_ wherever you need
62 | completions for htmx attributes:
63 |
64 | ```jsx twoslash
65 | ///
66 |
67 | function MyComponent({ children }) {
68 | return
{children}
;
69 | // ^?
70 | }
71 | ```
72 |
73 | If your frontend library injects its own JSX types, you'll need to augment it.
74 | See the [example project](https://github.com/Desdaemon/typed-htmx/tree/main/example)
75 | for a demo. typed-html and React are supported out of the box.
76 |
77 | ### As a JSX templating engine
78 |
79 | If you prefer to use JSX only for its templating capabilities in the vein of
80 | [typed-html], you can use `typed-htmx/typed-html` which is included with this
81 | library and optimized for htmx usage:
82 |
83 | - Attributes such as [`hx-vals`](https://htmx.org/attributes/hx-vals/) and
84 | [`hx-headers`](https://htmx.org/attributes/hx-headers/) may also accept an object
85 | literal, which will be stringified on demand.
86 | - Configurable [options](#configuring-the-jsx-runtime) for sanitization, defaults to a no-op.
87 |
88 | Configure your `tsconfig.json` as follows:
89 |
90 | ```jsonc
91 | {
92 | "compilerOptions": {
93 | "jsx": "react-jsx",
94 | "jsxImportSource": "typed-htmx/typed-html",
95 | "moduleResolution": "node16" // or "nodenext"
96 | }
97 | }
98 | ```
99 |
100 | ## Tips
101 |
102 | ### Configuring the JSX runtime
103 |
104 | If you don't have any other JSX runtimes like React or Preact set up, you can use
105 | `typed-htmx/typed-html`, which will convert JSX into strings at runtime.
106 | You can configure the runtime using [`jsxConfig`](/typed-htmx/docs/api/index/variables/jsxConfig):
107 |
108 | ```js twoslash
109 | import { jsxConfig } from "typed-htmx";
110 | // Set to true to allow all text and skip sanitization
111 | jsxConfig.trusted = true;
112 | // Bring your own sanitizer
113 | jsxConfig.sanitize = (raw, originalType) => `..`;
114 | ```
115 |
116 | ### Compiling JSX templates
117 |
118 | JSX functions are fairly fast and will unlikely to be a bottleneck in your server.
119 | However, it is possible to achieve higher performance via techniques such as code transformations à la Babel.
120 | For example, you can use [`swc-plugin-static-jsx`](https://github.com/Desdaemon/swc-plugin-static-jsx)
121 | which will transform the demo snippet into pure string interpolation:
122 |
123 | ```ts twoslash
124 | // Use typed-htmx's template function
125 | import { html } from "typed-htmx";
126 |
127 | // Or provide your own
128 | function myHtml(raw: TemplateStringsArray, ...args: unknown[]): string {
129 | return `..`;
130 | }
131 |
132 | function MyComponent({ children }) {
133 | return (
134 | "" +
135 | html`
136 |
137 | My Website
138 |
139 |
140 |
141 | ${{ $$child: children }}
142 |
149 |
150 |
151 | `
152 | );
153 | }
154 | ```
155 |
156 | [typed-html]: https://github.com/nicojs/typed-html
157 | [triple-slash directive]: https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html
158 |
--------------------------------------------------------------------------------
/docs/docs/howto/xternal.md:
--------------------------------------------------------------------------------
1 | # Augmenting external JSX libraries
2 |
3 | typed-htmx is extremely minimal and requires the user to manually augment external JSX libraries that provide their own types.
4 |
5 | ## Common guidance
6 |
7 | - Create a `types.d.ts` (any name is fine, as long as it ends in `.d.ts`) at the top of your src/ folder,
8 | or anywhere within the configured `include` of your tsconfig.json
9 | - Write a JSX element, e.g. ``, and inspect its type
10 | - If you see React-related types, you are good to go
11 | - If not, try to discover the common namespace under which all HTML attributes go.
12 |
13 | Let's use [Hono](https://hono.dev/top) as an example.
14 |
15 | ```tsx twoslash
16 | // @jsxImportSource: hono/jsx
17 | // In tsconfig.json, jsxImportSource = "hono/jsx"
18 |
19 | // The type we are augmenting in this case is `Hono.HTMLAttributes`.
20 | // hx-boost is not recognized as a proper attribute yet.
21 |
22 | //^?
23 | ```
24 |
25 | With this knowledge, we can now augment the type of `Hono.HTMLAttributes` assuming it is an interface:
26 |
27 | ```tsx twoslash
28 | // @errors: 2322
29 | // @jsxImportSource: hono/jsx
30 | ///
31 |
32 | declare global {
33 | namespace Hono {
34 | interface HTMLAttributes extends HtmxAttributes {}
35 | }
36 | }
37 |
38 |
41 | ```
42 |
43 | ## Hono
44 |
45 | ```ts twoslash
46 | import 'typed-htmx';
47 |
48 | declare global {
49 | namespace Hono {
50 | interface HTMLAttributes extends HtmxAttributes {}
51 | }
52 | }
53 | ```
54 |
55 | ## Astro
56 |
57 | ```ts twoslash
58 | import 'typed-htmx';
59 |
60 | declare global {
61 | namespace astroHTML.JSX {
62 | interface IntrinsicAttributes extends HtmxAttributes {}
63 | }
64 | }
65 | ```
66 |
--------------------------------------------------------------------------------
/docs/docusaurus.config.js:
--------------------------------------------------------------------------------
1 | // @ts-check
2 | // Note: type annotations allow type checking and IDEs autocompletion
3 |
4 | const lightCodeTheme = require("prism-react-renderer/themes/github");
5 | const darkCodeTheme = require("prism-react-renderer/themes/dracula");
6 |
7 | /** @type {import('@docusaurus/types').Config} */
8 | const config = {
9 | title: "typed-htmx",
10 | tagline: "JSX definitions for htmx",
11 | favicon: "img/favicon.ico",
12 |
13 | url: "https://desdaemon.github.io",
14 | baseUrl: "/typed-htmx/",
15 |
16 | // GitHub pages deployment config.
17 | // If you aren't using GitHub pages, you don't need these.
18 | organizationName: "Desdaemon", // Usually your GitHub org/user name.
19 | projectName: "typed-htmx", // Usually your repo name.
20 |
21 | markdown: {
22 | format: 'md'
23 | },
24 | onBrokenLinks: "warn",
25 | onBrokenMarkdownLinks: "warn",
26 |
27 | i18n: {
28 | defaultLocale: "en",
29 | locales: ["en"],
30 | },
31 |
32 | plugins: [
33 | [
34 | "docusaurus-plugin-typedoc",
35 | /** @type {Partial} */
36 | ({
37 | entryPoints: ["../src/index.ts", "../src/jsx.d.ts"],
38 | tsconfig: "../tsconfig.json",
39 | hidePageTitle: true,
40 | readme: 'none',
41 | watch: process.env.npm_lifecycle_event === "start",
42 | cleanOutputDir: true,
43 | externalPattern: ["node_modules/**/*"],
44 | plugin: ["typedoc-plugin-mdn-links"],
45 | categoryOrder: ["Core", "*", "Extensions"],
46 | }),
47 | ],
48 | ],
49 |
50 | presets: [
51 | [
52 | "classic",
53 | /** @type {import('@docusaurus/preset-classic').Options} */
54 | ({
55 | docs: {
56 | sidebarPath: require.resolve("./sidebars.js"),
57 | },
58 | theme: {
59 | customCss: require.resolve("./src/css/custom.css"),
60 | },
61 |
62 | }),
63 | ],
64 | [
65 | "docusaurus-preset-shiki-twoslash",
66 | /** @type {Partial} */
67 | ({
68 | themes: ["min-light", "nord"],
69 | defaultOptions: {
70 | noErrors: false,
71 | },
72 | defaultCompilerOptions: {
73 | jsx: 4, // react-jsx
74 | jsxImportSource: 'typed-htmx/typed-html',
75 | target: 99, // esnext,
76 | strict: true,
77 | checkJs: true,
78 | noImplicitAny: false,
79 | module: 199, // nodenext,
80 | moduleResolution: 99, // nodenext
81 | },
82 | includeJSDocInHover: true,
83 | alwayRaiseForTwoslashExceptions: true,
84 | disableImplicitReactImport: true,
85 | }),
86 | ],
87 | ],
88 |
89 | themeConfig:
90 | /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
91 | ({
92 | // Replace with your project's social card
93 | image: "img/docusaurus-social-card.jpg",
94 | navbar: {
95 | title: "typed-htmx",
96 | logo: {
97 | alt: "My Site Logo",
98 | src: "img/logo.svg",
99 | },
100 | items: [
101 | {
102 | type: "docSidebar",
103 | sidebarId: "docsSidebar",
104 | position: "left",
105 | label: "Usage",
106 | },
107 | {
108 | type: "docSidebar",
109 | sidebarId: "referenceSidebar",
110 | position: "left",
111 | label: "Reference",
112 | },
113 | {
114 | href: "https://github.com/Desdaemon/typed-htmx",
115 | label: "GitHub",
116 | position: "right",
117 | },
118 | ],
119 | },
120 | footer: {
121 | style: "dark",
122 | links: [
123 | {
124 | title: "Docs",
125 | items: [
126 | {
127 | label: "Usage",
128 | to: "/docs/howto/intro",
129 | },
130 | {
131 | label: "Reference",
132 | to: "/docs/api",
133 | },
134 | ],
135 | },
136 | ],
137 | },
138 | prism: {
139 | theme: lightCodeTheme,
140 | darkTheme: darkCodeTheme,
141 | },
142 | }),
143 | };
144 |
145 | module.exports = config;
146 |
--------------------------------------------------------------------------------
/docs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "docs",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "docusaurus": "docusaurus",
7 | "start": "docusaurus start",
8 | "build": "docusaurus build",
9 | "swizzle": "docusaurus swizzle",
10 | "deploy": "docusaurus deploy",
11 | "clear": "docusaurus clear",
12 | "serve": "docusaurus serve",
13 | "write-translations": "docusaurus write-translations",
14 | "write-heading-ids": "docusaurus write-heading-ids"
15 | },
16 | "dependencies": {
17 | "@docusaurus/core": "3.3.2",
18 | "@docusaurus/plugin-content-docs": "^3.3.2",
19 | "@docusaurus/preset-classic": "3.3.2",
20 | "@mdx-js/react": "^3.0.1",
21 | "clsx": "^1.2.1",
22 | "docusaurus-plugin-typedoc": "next",
23 | "docusaurus-preset-shiki-twoslash": "^1.1.41",
24 | "hono": "^3.12.12",
25 | "object-assign": "^4.1.1",
26 | "prism-react-renderer": "^1.3.5",
27 | "react": "^18.3.1",
28 | "react-dom": "^18.3.1",
29 | "typed-htmx": "link:..",
30 | "typedoc": "^0.25.13",
31 | "typedoc-plugin-markdown": "^4.0.1",
32 | "typedoc-plugin-mdn-links": "^3.1.24",
33 | "typescript": "^5.4.5"
34 | },
35 | "devDependencies": {
36 | "@docusaurus/module-type-aliases": "3.3.2",
37 | "@docusaurus/types": "^3.3.2"
38 | },
39 | "browserslist": {
40 | "production": [
41 | ">0.5%",
42 | "not dead",
43 | "not op_mini all"
44 | ],
45 | "development": [
46 | "last 1 chrome version",
47 | "last 1 firefox version",
48 | "last 1 safari version"
49 | ]
50 | },
51 | "engines": {
52 | "node": ">=16.14"
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/docs/sidebars.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Creating a sidebar enables you to:
3 | - create an ordered group of docs
4 | - render a sidebar for each doc of that group
5 | - provide next/previous navigation
6 |
7 | The sidebars can be generated from the filesystem, or explicitly defined here.
8 |
9 | Create as many sidebars as you want.
10 | */
11 |
12 | // @ts-check
13 |
14 | /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
15 | const sidebars = {
16 | // By default, Docusaurus generates a sidebar from the docs folder structure
17 | referenceSidebar: [{ type: "autogenerated", dirName: "api" }],
18 | docsSidebar: [{ type: "autogenerated", dirName: "howto" }],
19 |
20 | // But you can create a sidebar manually
21 | /*
22 | tutorialSidebar: [
23 | 'intro',
24 | 'hello',
25 | {
26 | type: 'category',
27 | label: 'Tutorial',
28 | items: ['tutorial-basics/create-a-document'],
29 | },
30 | ],
31 | */
32 | };
33 |
34 | module.exports = sidebars;
35 |
--------------------------------------------------------------------------------
/docs/src/components/HomepageFeatures/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | // import clsx from 'clsx';
3 | import styles from "./styles.module.css";
4 |
5 | /*
6 | const FeatureList = [
7 | {
8 | title: 'Easy to Use',
9 | Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default,
10 | description: (
11 | <>
12 | Docusaurus was designed from the ground up to be easily installed and
13 | used to get your website up and running quickly.
14 | >
15 | ),
16 | },
17 | {
18 | title: 'Focus on What Matters',
19 | Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default,
20 | description: (
21 | <>
22 | Docusaurus lets you focus on your docs, and we'll do the chores. Go
23 | ahead and move your docs into the docs directory.
24 | >
25 | ),
26 | },
27 | {
28 | title: 'Powered by React',
29 | Svg: require('@site/static/img/undraw_docusaurus_react.svg').default,
30 | description: (
31 | <>
32 | Extend or customize your website layout by reusing React. Docusaurus can
33 | be extended while reusing the same header and footer.
34 | >
35 | ),
36 | },
37 | ];
38 |
39 | function Feature({Svg, title, description}) {
40 | return (
41 |