@docusaurus/types 3.0.0-alpha.0 → 3.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/config.d.ts +29 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/types",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-beta.0",
4
4
  "description": "Common types for Docusaurus packages.",
5
5
  "types": "./src/index.d.ts",
6
6
  "publishConfig": {
@@ -16,15 +16,15 @@
16
16
  "@types/history": "^4.7.11",
17
17
  "@types/react": "*",
18
18
  "commander": "^5.1.0",
19
- "joi": "^17.8.3",
19
+ "joi": "^17.9.2",
20
20
  "react-helmet-async": "^1.3.0",
21
21
  "utility-types": "^3.10.0",
22
- "webpack": "^5.76.0",
23
- "webpack-merge": "^5.8.0"
22
+ "webpack": "^5.88.1",
23
+ "webpack-merge": "^5.9.0"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": "^18.0.0",
27
27
  "react-dom": "^18.0.0"
28
28
  },
29
- "gitHead": "7327f7ff880ed97ad7855744e59c9c55d467a950"
29
+ "gitHead": "27a1e90d9fff88af90ecad35bea16d4d7230482a"
30
30
  }
package/src/config.d.ts CHANGED
@@ -16,7 +16,34 @@ export type ThemeConfig = {
16
16
  [key: string]: unknown;
17
17
  };
18
18
 
19
+ export type MarkdownPreprocessor = (args: {
20
+ filePath: string;
21
+ fileContent: string;
22
+ }) => string;
23
+
24
+ export type MDX1CompatOptions = {
25
+ comments: boolean;
26
+ admonitions: boolean;
27
+ headingIds: boolean;
28
+ };
29
+
19
30
  export type MarkdownConfig = {
31
+ /**
32
+ * The Markdown format to use by default.
33
+ *
34
+ * This is the format passed down to the MDX compiler, impacting the way the
35
+ * content is parsed.
36
+ *
37
+ * Possible values:
38
+ * - `'mdx'`: use the MDX format (JSX support)
39
+ * - `'md'`: use the CommonMark format (no JSX support)
40
+ * - `'detect'`: select the format based on file extension (.md / .mdx)
41
+ *
42
+ * @see https://mdxjs.com/packages/mdx/#optionsformat
43
+ * @default 'mdx'
44
+ */
45
+ format: 'mdx' | 'md' | 'detect';
46
+
20
47
  /**
21
48
  * Allow mermaid language code blocks to be rendered into Mermaid diagrams:
22
49
  *
@@ -35,17 +62,13 @@ export type MarkdownConfig = {
35
62
  *
36
63
  * @param args
37
64
  */
38
- preprocessor?: (args: {filePath: string; fileContent: string}) => string;
65
+ preprocessor?: MarkdownPreprocessor;
39
66
 
40
67
  /**
41
68
  * Set of flags make it easier to upgrade from MDX 1 to MDX 2
42
69
  * See also https://github.com/facebook/docusaurus/issues/4029
43
70
  */
44
- mdx1Compat: {
45
- comments: boolean;
46
- admonitions: boolean;
47
- headingIds: boolean;
48
- };
71
+ mdx1Compat: MDX1CompatOptions;
49
72
  };
50
73
 
51
74
  /**