Skip to content

Commit

Permalink
feat: docusaurus v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Desdaemon committed Jan 3, 2024
1 parent 67c014b commit dfe0a3b
Show file tree
Hide file tree
Showing 6 changed files with 3,294 additions and 2,719 deletions.
4 changes: 4 additions & 0 deletions docs/docs/howto/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ function MyComponent({ children }) {
}
```

If your frontend library injects its own JSX types, you'll need to augment it.
See the [example project](https://github.com/Desdaemon/typed-htmx/tree/main/example)
for a demo. typed-html and React are supported out of the box.

### As a JSX templating engine

If you prefer to use JSX only for its templating capabilities in the vein of
Expand Down
65 changes: 14 additions & 51 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,19 @@ const config = {
favicon: "img/favicon.ico",

url: "https://desdaemon.github.io",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/typed-htmx/",

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "Desdaemon", // Usually your GitHub org/user name.
projectName: "typed-htmx", // Usually your repo name.

markdown: {
format: 'md'
},
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "ignore",

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
locales: ["en"],
Expand Down Expand Up @@ -57,42 +55,37 @@ const config = {
({
docs: {
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
// editUrl:
// 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
},
// blog: {
// showReadingTime: true,
// // Please change this to your repo.
// // Remove this to remove the "edit this page" links.
// editUrl:
// 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
// },
theme: {
customCss: require.resolve("./src/css/custom.css"),
},

}),
],
[
"docusaurus-preset-shiki-twoslash",
{
/** @type {Partial<import('remark-shiki-twoslash').Options>} */
({
themes: ["min-light", "nord"],
tsModule: require("typescript"),
defaultOptions: {
noErrors: false,
},
/** @type {import('typescript').CompilerOptions} */
defaultCompilerOptions: {
types: ["typed-htmx"],
jsx: "react-jsx",
jsx: 4, // react-jsx
jsxImportSource: "typed-htmx/typed-html",
target: "esnext",
target: 99, // esnext,
strict: true,
noImplicitAny: false,
module: 199, // nodenext,
moduleResolution: 99, // nodenext
},
includeJSDocInHover: true,
},
wrapFragments: true,
alwayRaiseForTwoslashExceptions: true,
disableImplicitReactImport: true,
}),
],
],

Expand Down Expand Up @@ -143,36 +136,6 @@ const config = {
},
],
},
// {
// title: 'Community',
// items: [
// {
// label: 'Stack Overflow',
// href: 'https://stackoverflow.com/questions/tagged/docusaurus',
// },
// {
// label: 'Discord',
// href: 'https://discordapp.com/invite/docusaurus',
// },
// {
// label: 'Twitter',
// href: 'https://twitter.com/docusaurus',
// },
// ],
// },
// {
// title: 'More',
// items: [
// {
// label: 'Blog',
// to: '/blog',
// },
// {
// label: 'GitHub',
// href: 'https://github.com/facebook/docusaurus',
// },
// ],
// },
],
},
prism: {
Expand Down
24 changes: 13 additions & 11 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,28 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.4.1",
"@docusaurus/plugin-content-docs": "^2.4.1",
"@docusaurus/preset-classic": "2.4.1",
"@mdx-js/react": "^1.6.22",
"@docusaurus/core": "3.0.1",
"@docusaurus/plugin-content-docs": "^3.0.1",
"@docusaurus/preset-classic": "3.0.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^1.2.1",
"docusaurus-plugin-typedoc": "next",
"docusaurus-preset-shiki-twoslash": "^1.1.41",
"object-assign": "^4.1.1",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rehype-raw": "^7.0.0",
"typed-htmx": "link:..",
"typedoc": "^0.24.8",
"typedoc": "^0.25.6",
"typedoc-plugin-markdown": "next",
"typedoc-plugin-mdn-links": "^3.0.3",
"typescript": "^5.1.6"
"typedoc-plugin-mdn-links": "^3.1.10",
"typescript": "^5.3.3"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.4.1",
"@docusaurus/types": "^2.4.1"
"@docusaurus/module-type-aliases": "3.0.1",
"@docusaurus/types": "^3.0.1",
"remark-shiki-twoslash": "^3.1.3"
},
"browserslist": {
"production": [
Expand Down
Loading

0 comments on commit dfe0a3b

Please sign in to comment.