Setting up Docusaurus
Sidebars
typedoc-to-mdx
will generate api documents in designated directory.
You can easily create sidebar with Docusaurus's autogenerated
type sidebars.
sidebars.js
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
api: [{ type: "autogenerated", dirName: "api" }],
// ...Other entries...
};
module.exports = sidebars;
docusaurus.config.js
Styles
typedoc-to-mdx
provides one styles file that you can use with Docusaurus.
You can enable it by importing it in presets/classic/theme/customCss
.
CSS
docusaurus.config.js
plugins: [
"docusaurus-plugin-sass"
],
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
theme: {
customCss: [
require.resolve("typedoc-to-mdx/css/theme.css") // theme.min.css is also available
// Other global CSS files...
]
}
})
]
]
Or, with docusaurus-plugin-sass
docusaurus.config.js
plugins: [
"docusaurus-plugin-sass"
],
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
theme: {
customCss: [
require.resolve("typedoc-to-mdx/sass/theme.sass")
// Other global CSS files...
]
}
})
]
]
info
You can also use clientModules
option.
Markdown plugins
Using the remark-breaks plugin is highly recommended.
docusaurus.config.js
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
remarkPlugins: [require("remark-breaks")],
// ...Other entries...
}
})
]
]