* remove webpackConfig.resolve.symlinks: true
* Add docs-test docs plugin instance to validate using a symlink folder as docs source is possible
* comment
* useful comments
This was likely a typo, and resulted in the following error when using Typescript strict mode:
node_modules/@docusaurus/types/src/index.d.ts(250,14): error TS7031: Binding element 'Content' implicitly has an 'any' type.
* fix(v2): avoid slowdown transition with huge sidebar items
* move useCollapsible to theme-common
* @docusaurus/theme-classic => watch mode should include type-checking
* refactor useCollapsible => encapsulate more behavior / state / ref inside it, making code simpler for component using it
* useCollapseAnimation => animate DOM properties directly instead of using React inline styles => optimize perf from 4 render per click to 1 render per click
* add missing items in deps array
* rename ref to collapsibleRef
* lint
Co-authored-by: slorber <lorber.sebastien@gmail.com>
* Rewrite markdown images section
Before it looked like we have two ways to display images, now it's three ways. Each syntax has a separate example.
This way it's clear, I see each method and the code example.
Before there were 2 methods in a single code block.
* fix typo in `markdown-features/markdown-features-assets`
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
* Rewrite image display section using CommonJS require
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
* Rewrite image display section using ES imports
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
* prettier doc
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
* never apply trailingSlash to site root ('/baseUrl/') => only subroutes
* add deprecation comment for loadContext.baseUrl in favor of loadContext.siteConfig.baseUrl
* commit typo
* useless code
* Sitemap should respect the global trailingSlash config option.
* improve tests for createSitemap / trailingSlash
Co-authored-by: slorber <lorber.sebastien@gmail.com>
In some cases, negative sidebar positions can be useful for reversing
the sorting order with minimal maintenance overhead. For example, a docs
folder with changelogs for historical versions should be sorted in
reverse chronological order. This is easy to do for semantic version
numbers by converting them into a negative numerical representation,
e.g. 11.5.1 -> -110501.
The alternative is to make the first version start with a large position
number (e.g. 9999) and decrement it for each version. However, this
requires referring to older versions to get the current sequence number,
thus increasing maintenance overhead. It also makes the number less
intuitive and more prone to error.
Negative sidebar positions work great for this purpose, so make the
front matter validator allow them again as #4796 broke this use case.
* Divide `markdown-features/code-blocks` to smaller sections
This PR adds few more heading to split the content to small topics.
This way users like me will be able to scroll directly to the specific section, instead of reading all the documentation.
I add to read the entire section because It was not divided into sections. Not a great user experience.
* Use `<h3>` heading
* fix(types): type `LoadedPlugin` is not generic
`LoadedPlugin` referenced line 201 is not generic, causing typescript errors on
end-user builds.
* chore(types): add typescript dev dep, tsconfig and a test script
Contributors will no longer inadvertently dump type errors since any IDE should
check types now.
* add missing plugins generic types
Co-authored-by: slorber <lorber.sebastien@gmail.com>
* refactor DocVersionBanner => versionMetadata prop should be forwarded instead of using "useActiveVersion" + global data
* docs version banner configuration
* add doc for versions.banner
* fix tests
* improve docs plugin option api doc