@mintlify/common 1.0.1211 → 1.0.1212
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/dist/mdx/plugins/remark/index.d.ts +1 -0
- package/dist/mdx/plugins/remark/index.js +1 -0
- package/dist/mdx/plugins/remark/remarkWrapCodeBlocks.d.ts +2 -0
- package/dist/mdx/plugins/remark/remarkWrapCodeBlocks.js +9 -0
- package/dist/mdx/server-only/getMdx.js +8 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -14,6 +14,7 @@ export * from './remarkMdxRemoveJs.js';
|
|
|
14
14
|
export * from './remarkExtractChangelogFilters.js';
|
|
15
15
|
export * from './remarkExpandContent.js';
|
|
16
16
|
export * from './remarkSplitCodeGroup.js';
|
|
17
|
+
export * from './remarkWrapCodeBlocks.js';
|
|
17
18
|
export * from './remarkSplitTabs.js';
|
|
18
19
|
export * from './remarkComponentIds.js';
|
|
19
20
|
export * from './remarkMdxExtractPanel.js';
|
|
@@ -14,6 +14,7 @@ export * from './remarkMdxRemoveJs.js';
|
|
|
14
14
|
export * from './remarkExtractChangelogFilters.js';
|
|
15
15
|
export * from './remarkExpandContent.js';
|
|
16
16
|
export * from './remarkSplitCodeGroup.js';
|
|
17
|
+
export * from './remarkWrapCodeBlocks.js';
|
|
17
18
|
export * from './remarkSplitTabs.js';
|
|
18
19
|
export * from './remarkComponentIds.js';
|
|
19
20
|
export * from './remarkMdxExtractPanel.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { visit } from 'unist-util-visit';
|
|
2
|
+
import { parseMetaString } from '../rehype/rehypeCodeBlocks/parseMetaString.js';
|
|
3
|
+
export const remarkWrapCodeBlocks = () => (tree) => {
|
|
4
|
+
visit(tree, 'code', (node) => {
|
|
5
|
+
if (node.meta && parseMetaString(node.meta).wrap === true)
|
|
6
|
+
return;
|
|
7
|
+
node.meta = node.meta ? `${node.meta} wrap` : 'wrap';
|
|
8
|
+
});
|
|
9
|
+
};
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { serialize } from '@mintlify/mdx/server';
|
|
11
11
|
import { getTailwindSelectors } from '../../css/tailwind.js';
|
|
12
|
-
import { getMDXOptions, remarkMdxRemoveJs, remarkExpandContent, remarkSplitCodeGroup, remarkSplitTabs, remarkValidateAccordions, remarkValidateSteps, remarkValidateVisibility, remarkValidateTabs, remarkValidateApiExamples, } from '../../index.js';
|
|
12
|
+
import { getMDXOptions, remarkMdxRemoveJs, remarkExpandContent, remarkSplitCodeGroup, remarkSplitTabs, remarkWrapCodeBlocks, remarkValidateAccordions, remarkValidateSteps, remarkValidateVisibility, remarkValidateTabs, remarkValidateApiExamples, } from '../../index.js';
|
|
13
13
|
import { codeStylingToThemeOrThemes } from '../getCodeStyling.js';
|
|
14
14
|
import { preprocessCustomHeadingIds } from '../preprocessCustomHeadingIds.js';
|
|
15
15
|
import { preprocessMdxFragmentCode } from '../preprocessMdxFragmentCode.js';
|
|
@@ -43,7 +43,13 @@ export function getMdx(_a) {
|
|
|
43
43
|
...remarkPlugins,
|
|
44
44
|
];
|
|
45
45
|
if (pageType === 'pdf') {
|
|
46
|
-
plugins = [
|
|
46
|
+
plugins = [
|
|
47
|
+
...plugins,
|
|
48
|
+
remarkExpandContent,
|
|
49
|
+
remarkSplitCodeGroup,
|
|
50
|
+
remarkSplitTabs,
|
|
51
|
+
remarkWrapCodeBlocks,
|
|
52
|
+
];
|
|
47
53
|
}
|
|
48
54
|
const syntaxHighlightingOptions = Object.assign(Object.assign({}, codeStylingToThemeOrThemes(codeStyling)), { customLanguages });
|
|
49
55
|
// detector sits exactly where remarkMdxRemoveJs sits in the no-js pass, so it
|