mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 08:07:26 +02:00
feat(v2): markdown pages (#3158)
* markdown pages POC * add remark admonition, mdx provider, yarn2npm... * pluginContentPages md/mdx tests * pluginContentPages md/mdx tests * add relative file path test link to showcase link problem * fix Markdown pages issues after merge * fix broken links found in markdown pages * fix tests * factorize common validation in @docusaurus/utils-validation * add some documentation * add using plugins doc * minor md pages fixes
This commit is contained in:
parent
53b28d2bb2
commit
7cceee7e38
30 changed files with 570 additions and 93 deletions
|
@ -22,6 +22,7 @@
|
|||
"@docusaurus/mdx-loader": "2.0.0-alpha.60",
|
||||
"@docusaurus/types": "2.0.0-alpha.60",
|
||||
"@docusaurus/utils": "2.0.0-alpha.60",
|
||||
"@docusaurus/utils-validation": "2.0.0-alpha.60",
|
||||
"@hapi/joi": "17.1.1",
|
||||
"execa": "^3.4.0",
|
||||
"fs-extra": "^8.1.0",
|
||||
|
|
|
@ -6,6 +6,11 @@
|
|||
*/
|
||||
import * as Joi from '@hapi/joi';
|
||||
import {PluginOptions} from './types';
|
||||
import {
|
||||
RemarkPluginsSchema,
|
||||
RehypePluginsSchema,
|
||||
AdmonitionsSchema,
|
||||
} from '@docusaurus/utils-validation';
|
||||
|
||||
const REVERSED_DOCS_HOME_PAGE_ID = '_index';
|
||||
|
||||
|
@ -35,27 +40,13 @@ export const PluginOptionSchema = Joi.object({
|
|||
sidebarPath: Joi.string().default(DEFAULT_OPTIONS.sidebarPath),
|
||||
docLayoutComponent: Joi.string().default(DEFAULT_OPTIONS.docLayoutComponent),
|
||||
docItemComponent: Joi.string().default(DEFAULT_OPTIONS.docItemComponent),
|
||||
remarkPlugins: Joi.array()
|
||||
.items(
|
||||
Joi.array()
|
||||
.items(Joi.function().required(), Joi.object().required())
|
||||
.length(2),
|
||||
Joi.function(),
|
||||
)
|
||||
.default(DEFAULT_OPTIONS.remarkPlugins),
|
||||
rehypePlugins: Joi.array()
|
||||
.items(
|
||||
Joi.array()
|
||||
.items(Joi.function().required(), Joi.object().required())
|
||||
.length(2),
|
||||
Joi.function(),
|
||||
)
|
||||
.default(DEFAULT_OPTIONS.rehypePlugins),
|
||||
remarkPlugins: RemarkPluginsSchema.default(DEFAULT_OPTIONS.remarkPlugins),
|
||||
rehypePlugins: RehypePluginsSchema.default(DEFAULT_OPTIONS.rehypePlugins),
|
||||
admonitions: AdmonitionsSchema.default(DEFAULT_OPTIONS.admonitions),
|
||||
showLastUpdateTime: Joi.bool().default(DEFAULT_OPTIONS.showLastUpdateTime),
|
||||
showLastUpdateAuthor: Joi.bool().default(
|
||||
DEFAULT_OPTIONS.showLastUpdateAuthor,
|
||||
),
|
||||
admonitions: Joi.object().default(DEFAULT_OPTIONS.admonitions),
|
||||
excludeNextVersionDocs: Joi.bool().default(
|
||||
DEFAULT_OPTIONS.excludeNextVersionDocs,
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue