@alauda/doom 1.0.0-next.0 → 1.0.0-next.2
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/lib/cli/load-config.js +2 -2
- package/lib/plugins/shiki/index.d.ts +1 -0
- package/lib/plugins/shiki/index.js +1 -0
- package/lib/plugins/shiki/rehype-fix.d.ts +9 -0
- package/lib/plugins/shiki/rehype-fix.js +25 -0
- package/lib/plugins/shiki/transformers/index.d.ts +0 -1
- package/lib/plugins/shiki/transformers/index.js +0 -1
- package/lib/runtime/components/JsonViewer.js +2 -4
- package/lib/runtime/components/K8sCrd.js +2 -2
- package/lib/runtime/components/K8sPermissionTable.js +2 -4
- package/lib/runtime/components/OpenAPIPath.js +3 -5
- package/lib/runtime/components/OpenAPIRef.js +2 -3
- package/lib/runtime/components/TermsTable.js +1 -3
- package/lib/runtime/components/_HeadingTitle.js +2 -3
- package/lib/runtime/components/_Markdown.js +3 -4
- package/lib/runtime/components/_RefLink.js +1 -3
- package/lib/runtime/components/_X.d.ts +23 -0
- package/lib/runtime/components/_X.js +2 -0
- package/package.json +5 -6
- package/lib/plugins/shiki/transformers/line-number.d.ts +0 -7
- package/lib/plugins/shiki/transformers/line-number.js +0 -13
package/lib/cli/load-config.js
CHANGED
|
@@ -10,7 +10,7 @@ import { difference } from 'es-toolkit';
|
|
|
10
10
|
import rehypeRaw from 'rehype-raw';
|
|
11
11
|
import { cyan } from 'yoctocolors';
|
|
12
12
|
import { autoTocPlugin } from '../plugins/auto-toc/index.js';
|
|
13
|
-
import { apiPlugin, autoSidebarPlugin, createTransformerCallouts, directivesPlugin, globalPlugin, mermaidPlugin, permissionPlugin, replacePlugin, } from '../plugins/index.js';
|
|
13
|
+
import { apiPlugin, autoSidebarPlugin, createTransformerCallouts, directivesPlugin, globalPlugin, mermaidPlugin, permissionPlugin, rehypeFix, replacePlugin, } from '../plugins/index.js';
|
|
14
14
|
import { isExplicitlyUnversioned, UNVERSIONED, } from '../shared/index.js';
|
|
15
15
|
import { pathExists, pkgResolve, resolveStaticConfig } from '../utils/index.js';
|
|
16
16
|
import { CWD, DEFAULT_CONFIG_NAME, DEFAULT_EXTENSIONS, I18N_FILE, SITES_FILE, YAML_EXTENSIONS, } from './constants.js';
|
|
@@ -126,7 +126,7 @@ const getCommonConfig = async ({ config, root, configFilePath, base, version, do
|
|
|
126
126
|
},
|
|
127
127
|
markdown: {
|
|
128
128
|
checkDeadLinks: true,
|
|
129
|
-
rehypePlugins: [[rehypeRaw, { passThrough: nodeTypes }]],
|
|
129
|
+
rehypePlugins: [[rehypeRaw, { passThrough: nodeTypes }], rehypeFix],
|
|
130
130
|
shiki: {
|
|
131
131
|
transformers: [
|
|
132
132
|
// builtin transformers
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Root } from 'hast';
|
|
2
|
+
import type { Plugin } from 'unified';
|
|
3
|
+
/**
|
|
4
|
+
* Restores metadata (e.g., titles) for code blocks that `rehype-raw` removes unexpectedly.
|
|
5
|
+
* This function addresses a compatibility issue where `rehype-raw` strips metadata from code blocks.
|
|
6
|
+
* @see https://github.com/syntax-tree/hast-util-raw/issues/29
|
|
7
|
+
* @see https://github.com/web-infra-dev/rspress/blob/ab7567460e63712300b64d7ab46065a2f1c1e069/packages/core/src/node/mdx/rehypePlugins/codeMeta.ts#L5-L22
|
|
8
|
+
*/
|
|
9
|
+
export declare const rehypeFix: Plugin<[], Root>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { visit } from 'unist-util-visit';
|
|
2
|
+
/**
|
|
3
|
+
* Restores metadata (e.g., titles) for code blocks that `rehype-raw` removes unexpectedly.
|
|
4
|
+
* This function addresses a compatibility issue where `rehype-raw` strips metadata from code blocks.
|
|
5
|
+
* @see https://github.com/syntax-tree/hast-util-raw/issues/29
|
|
6
|
+
* @see https://github.com/web-infra-dev/rspress/blob/ab7567460e63712300b64d7ab46065a2f1c1e069/packages/core/src/node/mdx/rehypePlugins/codeMeta.ts#L5-L22
|
|
7
|
+
*/
|
|
8
|
+
export const rehypeFix = function () {
|
|
9
|
+
return (ast) => {
|
|
10
|
+
visit(ast, 'element', (node) => {
|
|
11
|
+
// <pre><code>...</code></pre>
|
|
12
|
+
// 1. Find pre element
|
|
13
|
+
const childNode = node.children.at(0);
|
|
14
|
+
if (node.tagName === 'pre' &&
|
|
15
|
+
childNode?.type === 'element' &&
|
|
16
|
+
childNode.tagName === 'code') {
|
|
17
|
+
if (!childNode.data?.meta &&
|
|
18
|
+
typeof childNode.properties.meta === 'string') {
|
|
19
|
+
;
|
|
20
|
+
(childNode.data ??= {}).meta ??= childNode.properties.meta;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useState } from 'react';
|
|
2
|
+
import { CodeBlockRuntime, Tab, Tabs } from '@rspress/core/theme';
|
|
4
3
|
import { stringify } from 'yaml';
|
|
5
4
|
export const JsonViewer = ({ value }) => {
|
|
6
|
-
|
|
7
|
-
return (_jsxs(Tabs, { children: [_jsx(Tab, { label: "yaml", children: _jsx(X.pre, { children: _jsx(X.code, { className: "language-yaml", children: stringify(value) }) }) }), _jsx(Tab, { label: "json", children: _jsx(X.pre, { children: _jsx(X.code, { className: "language-json", children: JSON.stringify(value, null, 2) }) }) })] }));
|
|
5
|
+
return (_jsxs(Tabs, { children: [_jsx(Tab, { label: "yaml", children: _jsx(CodeBlockRuntime, { lang: "yaml", code: stringify(value) }) }), _jsx(Tab, { label: "json", children: _jsx(CodeBlockRuntime, { lang: "json", code: JSON.stringify(value, null, 2) }) })] }));
|
|
8
6
|
};
|
|
9
7
|
export default JsonViewer;
|
|
@@ -2,12 +2,13 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
/**
|
|
3
3
|
* modified based on @see https://github.com/crdsdev/doc/blob/main/template/doc.html
|
|
4
4
|
*/
|
|
5
|
-
import { Badge, Button
|
|
5
|
+
import { Badge, Button } from '@rspress/core/theme';
|
|
6
6
|
import crdsMap from 'doom-@api-crdsMap';
|
|
7
7
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
8
8
|
import { useIsPrint, useTranslation } from '../hooks/index.js';
|
|
9
9
|
import { Directive } from './Directive.js';
|
|
10
10
|
import { Markdown } from './_Markdown.js';
|
|
11
|
+
import { X } from './_X.js';
|
|
11
12
|
export const K8sCrdSchemaPart = ({ name, parent, schema: property, expandAll, }) => {
|
|
12
13
|
const [open, setOpen] = useState(expandAll);
|
|
13
14
|
const onToggle = useCallback((open) => {
|
|
@@ -52,7 +53,6 @@ export const K8sCrdSchema = ({ schema, version, }) => {
|
|
|
52
53
|
return (_jsxs(_Fragment, { children: [_jsx(Markdown, { children: description }), _jsxs("div", { className: "flex items-center", children: [_jsxs("span", { children: [_jsx("code", { children: version }), _jsx(Badge, { children: "version" })] }), !isPrint && properties != null && (_jsx(Button, { className: "ml-auto doom-btn", type: "button", text: _jsxs("span", { onClick: toggleExpandAll, children: [expandAll ? '-' : '+', ' ', t(expandAll ? 'collapse_all' : 'expand_all')] }), size: "medium", theme: "alt" }))] }), properties == null ? (_jsx(Directive, { type: "warning", children: t('crd_no_schema') })) : (_jsx("div", { className: "doom-collapse-group", children: Object.entries(properties).map(([name, subSchema]) => SKIPPED_PROPERTIES.includes(name) || (_jsx(K8sCrdSchemaPart, { name: name, parent: schema, schema: subSchema, expandAll: expandAll }, name))) }))] }));
|
|
53
54
|
};
|
|
54
55
|
export const K8sCrd = ({ name, crdPath }) => {
|
|
55
|
-
const [X] = useState(getCustomMDXComponent);
|
|
56
56
|
const [, crd] = useMemo(() => Object.entries(crdsMap).find(([pathname, crd]) => {
|
|
57
57
|
if (crdPath && pathname !== crdPath) {
|
|
58
58
|
return false;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useLang } from '@rspress/core/runtime';
|
|
3
|
-
import { getCustomMDXComponent } from '@rspress/core/theme';
|
|
4
3
|
import functionResourcesMap from 'doom-@permission-functionResourcesMap';
|
|
5
4
|
import roleTemplatesMap from 'doom-@permission-roleTemplatesMap';
|
|
6
5
|
import { intersection, sortBy } from 'es-toolkit';
|
|
7
|
-
import { Fragment, useMemo
|
|
6
|
+
import { Fragment, useMemo } from 'react';
|
|
8
7
|
import { useTranslation } from '../hooks/index.js';
|
|
8
|
+
import { X } from './_X.js';
|
|
9
9
|
export const VerbsMap = {
|
|
10
10
|
view: ['get', 'list', 'watch'],
|
|
11
11
|
create: ['create'],
|
|
@@ -20,7 +20,6 @@ const DISPLAY_NAME_EN = 'cpaas.io/display-name.en';
|
|
|
20
20
|
const TEXT_CENTER_STYLE = { textAlign: 'center' };
|
|
21
21
|
const TEXT_NO_WRAP_STYLE = { whiteSpace: 'nowrap' };
|
|
22
22
|
const RolesPermission = ({ functionResource, roleTemplates, verb, }) => {
|
|
23
|
-
const [X] = useState(getCustomMDXComponent);
|
|
24
23
|
const functionResourceName = functionResource.metadata.name;
|
|
25
24
|
const actions = functionResource.metadata.annotations['auth.cpaas.io/actions'];
|
|
26
25
|
return roleTemplates.map(({ metadata: { name }, spec: { rules } }) => {
|
|
@@ -49,7 +48,6 @@ const RolesPermission = ({ functionResource, roleTemplates, verb, }) => {
|
|
|
49
48
|
});
|
|
50
49
|
};
|
|
51
50
|
export const K8sPermissionTable = ({ functions }) => {
|
|
52
|
-
const [X] = useState(getCustomMDXComponent);
|
|
53
51
|
const allFunctionResources = useMemo(() => Object.values(functionResourcesMap).reduce((acc, curr) => Object.assign(acc, ...curr.map((fr) => ({ [fr.metadata.name]: fr }))), {}), []);
|
|
54
52
|
const functionResources = useMemo(() => {
|
|
55
53
|
return functions.flatMap((name) => {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { usePageData } from '@rspress/core/runtime';
|
|
3
|
-
import { Badge
|
|
3
|
+
import { Badge } from '@rspress/core/theme';
|
|
4
4
|
import openapisMap from 'doom-@api-openapisMap';
|
|
5
5
|
import virtual from 'doom-@api-virtual';
|
|
6
6
|
import BananaSlug from 'github-slugger';
|
|
7
7
|
import { OpenAPIV3 } from 'openapi-types';
|
|
8
|
-
import { Fragment, useMemo
|
|
8
|
+
import { Fragment, useMemo } from 'react';
|
|
9
9
|
import { omitRoutePathRefs, resolveRef } from '../utils.js';
|
|
10
10
|
import { OpenAPIProperties, OpenAPIProperty, OpenAPIRef } from './OpenAPIRef.js';
|
|
11
11
|
import { HeadingTitle } from './_HeadingTitle.js';
|
|
12
12
|
import { Markdown } from './_Markdown.js';
|
|
13
13
|
import { RefLink } from './_RefLink.js';
|
|
14
|
+
import { X } from './_X.js';
|
|
14
15
|
export const OpenAPIParameters = ({ parameters, openapi, }) => {
|
|
15
|
-
const [X] = useState(getCustomMDXComponent);
|
|
16
16
|
return (_jsx(X.ul, { children: parameters.map((param, index) => {
|
|
17
17
|
const paramObj = '$ref' in param
|
|
18
18
|
? resolveRef(openapi, param.$ref)
|
|
@@ -30,7 +30,6 @@ export const OpenAPIParameters = ({ parameters, openapi, }) => {
|
|
|
30
30
|
}) }));
|
|
31
31
|
};
|
|
32
32
|
export const OpenAPIResponses = ({ responses, openapi, }) => {
|
|
33
|
-
const [X] = useState(getCustomMDXComponent);
|
|
34
33
|
return (_jsx(X.ul, { children: Object.entries(responses).map(([code, response]) => {
|
|
35
34
|
const responseObj = '$ref' in response
|
|
36
35
|
? resolveRef(openapi, response.$ref)
|
|
@@ -90,7 +89,6 @@ const getRefsForPath = (openapi, path, knownRefs) => {
|
|
|
90
89
|
return Array.from(refs);
|
|
91
90
|
};
|
|
92
91
|
export const OpenAPIPath = ({ path, openapiPath: openapiPath_, pathPrefix: pathPrefix_, }) => {
|
|
93
|
-
const [X] = useState(getCustomMDXComponent);
|
|
94
92
|
const { page } = usePageData();
|
|
95
93
|
const pathPrefix = pathPrefix_ ?? (virtual.pathPrefix || '');
|
|
96
94
|
const slugger = useMemo(() => new BananaSlug(), []);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { usePageData } from '@rspress/core/runtime';
|
|
3
|
-
import { getCustomMDXComponent } from '@rspress/core/theme';
|
|
4
3
|
import openapisMap from 'doom-@api-openapisMap';
|
|
5
|
-
import { useMemo
|
|
4
|
+
import { useMemo } from 'react';
|
|
6
5
|
import { modelName, omitRoutePathRefs, resolveRef } from '../utils.js';
|
|
7
6
|
import { HeadingTitle } from './_HeadingTitle.js';
|
|
8
7
|
import { Markdown } from './_Markdown.js';
|
|
9
8
|
import { RefLink } from './_RefLink.js';
|
|
9
|
+
import { X } from './_X.js';
|
|
10
10
|
export const OpenAPIProperty = ({ name, property, openapi, }) => {
|
|
11
11
|
const propObj = '$ref' in property ? resolveRef(openapi, property.$ref) : property;
|
|
12
12
|
const type = propObj.type;
|
|
@@ -43,7 +43,6 @@ export const OpenAPIProperty = ({ name, property, openapi, }) => {
|
|
|
43
43
|
return (_jsxs(_Fragment, { children: [name && (_jsxs(_Fragment, { children: [_jsx("code", { children: name }), ":", ' '] })), typeNode, _jsx(Markdown, { children: propObj.description }), extraNode] }));
|
|
44
44
|
};
|
|
45
45
|
export const OpenAPIProperties = ({ properties, openapi, }) => {
|
|
46
|
-
const [X] = useState(getCustomMDXComponent);
|
|
47
46
|
return (_jsx(X.ul, { children: Object.entries(properties).map(([name, property], index) => (_jsx(X.li, { children: _jsx(OpenAPIProperty, { name: name, property: property, openapi: openapi }) }, index))) }));
|
|
48
47
|
};
|
|
49
48
|
const getRefsForSchema = (openapi, schema, knownRefs) => {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getCustomMDXComponent } from '@rspress/core/theme';
|
|
3
|
-
import { useState } from 'react';
|
|
4
2
|
import { namedTermItems } from '../../terms.js';
|
|
5
3
|
import { useTranslation } from '../hooks/index.js';
|
|
4
|
+
import { X } from './_X.js';
|
|
6
5
|
export const TermsTable = ({ terms }) => {
|
|
7
|
-
const [X] = useState(getCustomMDXComponent);
|
|
8
6
|
const t = useTranslation();
|
|
9
7
|
const normalized = terms ?? namedTermItems;
|
|
10
8
|
const withName = normalized.some(({ name }) => name);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getCustomMDXComponent } from '@rspress/core/theme';
|
|
3
2
|
import BananaSlug from 'github-slugger';
|
|
4
|
-
import { Children, useMemo
|
|
3
|
+
import { Children, useMemo } from 'react';
|
|
4
|
+
import { X } from './_X.js';
|
|
5
5
|
export const HeadingTitle = ({ slug, slugger, level, children, }) => {
|
|
6
|
-
const [X] = useState(getCustomMDXComponent);
|
|
7
6
|
const HeadingComponents = useMemo(() => {
|
|
8
7
|
return [null, X.h1, X.h2, X.h3, X.h4, X.h5, X.h6];
|
|
9
8
|
}, [X]);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useState } from 'react';
|
|
2
|
+
import {} from 'react';
|
|
4
3
|
import ReactMarkdown from 'react-markdown';
|
|
5
4
|
import remarkGfm from 'remark-gfm';
|
|
5
|
+
import { X } from './_X.js';
|
|
6
6
|
export const Markdown = ({ children }) => {
|
|
7
|
-
|
|
8
|
-
return (children && (_jsx(ReactMarkdown, { remarkPlugins: [[remarkGfm]], components: components, skipHtml: true, children: children })));
|
|
7
|
+
return (children && (_jsx(ReactMarkdown, { remarkPlugins: [[remarkGfm]], components: X, skipHtml: true, children: children })));
|
|
9
8
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { getCustomMDXComponent } from '@rspress/core/theme';
|
|
3
|
-
import { useState } from 'react';
|
|
4
2
|
import { COMMON_REFS, modelName } from '../utils.js';
|
|
3
|
+
import { X } from './_X.js';
|
|
5
4
|
export const RefLink = ({ $ref }) => {
|
|
6
|
-
const [X] = useState(getCustomMDXComponent);
|
|
7
5
|
if (!$ref) {
|
|
8
6
|
return null;
|
|
9
7
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const X: {
|
|
2
|
+
h1: (props: React.ComponentProps<"h1">) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
h2: (props: React.ComponentProps<"h2">) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
h3: (props: React.ComponentProps<"h3">) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
h4: (props: React.ComponentProps<"h4">) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
h5: (props: React.ComponentProps<"h5">) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
h6: (props: React.ComponentProps<"h6">) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
ul: (props: import("react").ComponentProps<"ul">) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
ol: (props: import("react").ComponentProps<"ol">) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
li: (props: import("react").ComponentProps<"li">) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
table: (props: import("react").ComponentProps<"table">) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
td: (props: import("react").ComponentProps<"td">) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
th: (props: import("react").ComponentProps<"th">) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
tr: (props: import("react").ComponentProps<"tr">) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
hr: (props: import("react").ComponentProps<"hr">) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
p: (props: import("react").ComponentProps<"p">) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
blockquote: (props: import("react").ComponentProps<"blockquote">) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
strong: (props: import("react").ComponentProps<"strong">) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
a: (props: import("react").ComponentProps<"a">) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
code: (props: import("react").HTMLProps<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
pre: ({ containerElementClassName, children, className, title, codeButtonGroupProps, ...otherProps }: import("@rspress/theme-default").PreWithCodeButtonGroupProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
22
|
+
img: (props: import("react").ComponentProps<"img">) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alauda/doom",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Doctor Doom making docs.",
|
|
6
6
|
"repository": "git+https://github.com/alauda/doom.git",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@cspell/eslint-plugin": "^9.0.2",
|
|
37
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
38
|
-
"@inquirer/prompts": "^7.5.
|
|
37
|
+
"@eslint-react/eslint-plugin": "^1.50.0",
|
|
38
|
+
"@inquirer/prompts": "^7.5.3",
|
|
39
39
|
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
|
|
40
40
|
"@playwright/browser-chromium": "^1.52.0",
|
|
41
41
|
"@rsbuild/plugin-sass": "^1.3.1",
|
|
42
42
|
"@rsbuild/plugin-yaml": "^1.0.2",
|
|
43
|
-
"@rspress/core": "2.0.0-beta.
|
|
43
|
+
"@rspress/core": "2.0.0-beta.8",
|
|
44
44
|
"@shikijs/transformers": "^3.4.2",
|
|
45
45
|
"chokidar": "^4.0.3",
|
|
46
46
|
"cli-progress": "^3.12.0",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"shiki": "^3.4.2",
|
|
72
72
|
"simple-git": "^3.27.0",
|
|
73
73
|
"swagger2openapi": "^7.0.8",
|
|
74
|
-
"tinyglobby": "^0.2.
|
|
74
|
+
"tinyglobby": "^0.2.14",
|
|
75
75
|
"type-fest": "^4.41.0",
|
|
76
76
|
"typescript-eslint": "^8.32.1",
|
|
77
77
|
"x-fetch": "^0.2.6",
|
|
@@ -79,7 +79,6 @@
|
|
|
79
79
|
"yoctocolors": "^2.1.1"
|
|
80
80
|
},
|
|
81
81
|
"publishConfig": {
|
|
82
|
-
"access": "public",
|
|
83
82
|
"registry": "https://registry.npmjs.org"
|
|
84
83
|
}
|
|
85
84
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ShikiTransformer } from 'shiki';
|
|
2
|
-
export interface ITransformerLineNumberOptions {
|
|
3
|
-
classActivePre?: string;
|
|
4
|
-
classActiveLine?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const SHIKI_TRANSFORMER_LINE_NUMBER = "shiki-transformer:line-number";
|
|
7
|
-
export declare function createTransformerLineNumber(options?: ITransformerLineNumberOptions): ShikiTransformer;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const SHIKI_TRANSFORMER_LINE_NUMBER = 'shiki-transformer:line-number';
|
|
2
|
-
export function createTransformerLineNumber(options = {}) {
|
|
3
|
-
const { classActiveLine = 'line-number', classActivePre = 'has-line-number', } = options;
|
|
4
|
-
return {
|
|
5
|
-
name: SHIKI_TRANSFORMER_LINE_NUMBER,
|
|
6
|
-
pre(pre) {
|
|
7
|
-
return this.addClassToHast(pre, classActivePre);
|
|
8
|
-
},
|
|
9
|
-
line(node) {
|
|
10
|
-
this.addClassToHast(node, classActiveLine);
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
}
|