@xyd-js/content 0.1.0-xyd.13 → 0.1.0-xyd.16
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.
- package/CHANGELOG.md +34 -0
- package/ISSUES.md +1 -0
- package/TODO.md +2 -0
- package/dist/index.d.ts +24 -5
- package/dist/index.js +1411 -21776
- package/dist/index.js.map +1 -1
- package/dist/md.d.ts +62 -7
- package/dist/md.js +18071 -15085
- package/dist/md.js.map +1 -1
- package/dist/{mdToc-CYxzibVZ.d.ts → mdToc-NBBxMJ4l.d.ts} +1 -0
- package/dist/vite.d.ts +81 -2
- package/dist/vite.js +9716 -10090
- package/dist/vite.js.map +1 -1
- package/example.txt +0 -0
- package/package.json +24 -6
- package/packages/md/index.ts +17 -8
- package/packages/md/plugins/component-directives/index.ts +3 -0
- package/packages/md/plugins/component-directives/mdComponentDirective.ts +524 -0
- package/packages/md/plugins/component-directives/types.ts +1 -0
- package/packages/md/plugins/component-directives/utils.ts +27 -0
- package/packages/md/plugins/composer/__fixtures__/1.single-example/input.md +7 -0
- package/packages/md/plugins/composer/__fixtures__/1.single-example/output.json +63 -0
- package/packages/md/plugins/composer/__fixtures__/2.single-example-with-name/input.md +7 -0
- package/packages/md/plugins/composer/__fixtures__/2.single-example-with-name/output.json +63 -0
- package/packages/md/plugins/composer/__fixtures__/3.multiple-examples/input.md +15 -0
- package/packages/md/plugins/composer/__fixtures__/3.multiple-examples/output.json +122 -0
- package/packages/md/plugins/composer/__fixtures__/4.example-groups/input.md +23 -0
- package/packages/md/plugins/composer/__fixtures__/4.example-groups/output.json +184 -0
- package/packages/md/plugins/composer/__tests__/mdComposer.test.ts +41 -0
- package/packages/md/plugins/composer/__tests__/testHelpers.ts +48 -0
- package/packages/md/plugins/composer/index.ts +1 -0
- package/packages/md/plugins/composer/mdComposer.ts +146 -0
- package/packages/md/plugins/developer-writing/index.ts +3 -0
- package/packages/md/plugins/developer-writing/mdCodeRehype.ts +78 -0
- package/packages/md/plugins/functions/__fixtures__/external.ts +4 -0
- package/packages/md/plugins/functions/__fixtures__/test.js +11 -0
- package/packages/md/plugins/functions/__fixtures__/test.py +9 -0
- package/packages/md/plugins/functions/__fixtures__/test.ts +18 -0
- package/packages/md/plugins/functions/__tests__/mdFunctionImportCode.test.ts +295 -0
- package/packages/md/plugins/functions/__tests__/parseFunctionCall.test.ts +47 -0
- package/packages/md/plugins/functions/__tests__/testHelpers.ts +71 -0
- package/packages/md/plugins/functions/index.ts +11 -0
- package/packages/md/plugins/functions/mdFunctionChangelog.ts +124 -0
- package/packages/md/plugins/functions/mdFunctionImportCode.ts +83 -0
- package/packages/md/plugins/functions/mdFunctionUniform.ts +79 -0
- package/packages/md/plugins/functions/types.ts +6 -0
- package/packages/md/plugins/functions/uniformProcessor.ts +349 -0
- package/packages/md/plugins/functions/utils.ts +423 -0
- package/packages/md/plugins/index.ts +56 -11
- package/packages/md/plugins/mdCode.ts +52 -4
- package/packages/md/plugins/mdHeadingId.ts +47 -0
- package/packages/md/plugins/mdPage.ts +3 -0
- package/packages/md/plugins/mdThemeSettings.ts +4 -0
- package/packages/md/plugins/mdToc.ts +108 -17
- package/packages/md/plugins/meta/index.ts +1 -0
- package/packages/md/plugins/meta/mdMeta.ts +189 -0
- package/packages/md/plugins/output-variables/__fixtures__/1.simple/input.md +22 -0
- package/packages/md/plugins/output-variables/__fixtures__/1.simple/output.json +191 -0
- package/packages/md/plugins/output-variables/__fixtures__/2.multiple-vars/input.md +21 -0
- package/packages/md/plugins/output-variables/__fixtures__/2.multiple-vars/output.json +127 -0
- package/packages/md/plugins/output-variables/__tests__/index.test.ts +28 -0
- package/packages/md/plugins/output-variables/__tests__/testHelpers.ts +36 -0
- package/packages/md/plugins/output-variables/index.ts +1 -0
- package/packages/md/plugins/output-variables/lib/const.ts +4 -0
- package/packages/md/plugins/output-variables/lib/factoryAttributes.ts +350 -0
- package/packages/md/plugins/output-variables/lib/factoryLabel.ts +135 -0
- package/packages/md/plugins/output-variables/lib/factoryName.ts +59 -0
- package/packages/md/plugins/output-variables/lib/index.ts +21 -0
- package/packages/md/plugins/output-variables/lib/outputVarsContainer.ts +328 -0
- package/packages/md/plugins/output-variables/lib/util.ts +494 -0
- package/packages/md/plugins/output-variables/remarkOutputVars.ts +22 -0
- package/packages/md/plugins/rehypeHeading.ts +50 -0
- package/packages/md/plugins/types.ts +15 -0
- package/packages/md/plugins/utils/componentLike.ts +72 -0
- package/packages/md/plugins/utils/index.ts +2 -0
- package/packages/md/plugins/utils/mdParameters.test.ts +114 -0
- package/packages/md/plugins/utils/mdParameters.ts +249 -0
- package/packages/md/plugins/utils/mdastTypes.ts +42 -0
- package/packages/md/search/index.ts +251 -0
- package/packages/md/search/types.ts +36 -0
- package/packages/vite/index.ts +8 -2
- package/src/fs.ts +51 -36
- package/src/index.ts +4 -4
- package/src/navigation.ts +50 -38
- package/src/types.ts +8 -0
- package/tsconfig.json +31 -8
- package/vitest.config.ts +17 -0
- package/packages/md/plugins/mdCodeGroup.ts +0 -40
- package/packages/md/plugins/mdComponentDirective.ts +0 -141
package/dist/md.d.ts
CHANGED
|
@@ -1,14 +1,69 @@
|
|
|
1
|
+
import * as hast from 'hast';
|
|
2
|
+
import * as vfile from 'vfile';
|
|
3
|
+
import { VFile } from 'vfile';
|
|
4
|
+
import * as unist from 'unist';
|
|
1
5
|
import * as remark_gfm from 'remark-gfm';
|
|
6
|
+
import * as unified from 'unified';
|
|
2
7
|
import * as mdast from 'mdast';
|
|
3
8
|
import * as remark_mdx_frontmatter from 'remark-mdx-frontmatter';
|
|
4
9
|
import * as remark_frontmatter from 'remark-frontmatter';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
10
|
+
import { Settings } from '@xyd-js/core';
|
|
11
|
+
import { R as RemarkMdxTocOptions } from './mdToc-NBBxMJ4l.js';
|
|
12
|
+
|
|
13
|
+
type OutputVars<T extends Record<string, any>> = {
|
|
14
|
+
[K in keyof T]: T[K];
|
|
15
|
+
};
|
|
16
|
+
interface SymbolxVfile<T extends Record<string, any>> extends VFile {
|
|
17
|
+
data: {
|
|
18
|
+
outputVars?: OutputVars<T>;
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Common options for all function plugins
|
|
25
|
+
*/
|
|
26
|
+
interface FunctionOptions {
|
|
27
|
+
resolveFrom?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface DocSectionSchema {
|
|
31
|
+
/**
|
|
32
|
+
* Id of the page e.g. "getting-started"
|
|
33
|
+
*/
|
|
34
|
+
pageId: string;
|
|
35
|
+
/**
|
|
36
|
+
* URL of the page e.g. "/getting-started"
|
|
37
|
+
*/
|
|
38
|
+
pageUrl: string;
|
|
39
|
+
/**
|
|
40
|
+
* Title of the page e.g. "Getting Started"
|
|
41
|
+
*/
|
|
42
|
+
pageTitle: string;
|
|
43
|
+
/**
|
|
44
|
+
* Level of the heading e.g. 1, 2
|
|
45
|
+
*/
|
|
46
|
+
headingLevel: number;
|
|
47
|
+
/**
|
|
48
|
+
* Title of the heading e.g. "Making a new project"
|
|
49
|
+
*/
|
|
50
|
+
headingTitle: string;
|
|
51
|
+
/**
|
|
52
|
+
* Summary of the page e.g. "This is the summary of the page"
|
|
53
|
+
*/
|
|
54
|
+
summary: string;
|
|
55
|
+
/**
|
|
56
|
+
* Content of the section
|
|
57
|
+
*/
|
|
58
|
+
content: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare function mapSettingsToDocSections(xydSettings: Settings): Promise<DocSectionSchema[]>;
|
|
8
62
|
|
|
9
|
-
declare function
|
|
10
|
-
|
|
11
|
-
|
|
63
|
+
declare function markdownPlugins(toc: RemarkMdxTocOptions, // TODO: unify this cuz it should come from core -global settings and toc options?
|
|
64
|
+
settings?: Settings): {
|
|
65
|
+
remarkPlugins: (typeof remark_frontmatter.default | unified.Plugin<[(remark_mdx_frontmatter.RemarkMdxFrontmatterOptions | undefined)?], mdast.Root, mdast.Root> | typeof remark_gfm.default | unified.Plugin<[], unist.Node, unist.Node> | ((options?: FunctionOptions) => (tree: any, file: vfile.VFile) => Promise<void>) | (() => (tree: mdast.Root, file: SymbolxVfile<any>) => Promise<void>))[];
|
|
66
|
+
rehypePlugins: unified.Plugin<[], hast.Root, hast.Root>[];
|
|
12
67
|
};
|
|
13
68
|
|
|
14
|
-
export { RemarkMdxTocOptions,
|
|
69
|
+
export { type DocSectionSchema, RemarkMdxTocOptions, mapSettingsToDocSections, markdownPlugins };
|