docusaurus-plugin-gitbook 0.1.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.
- package/README.md +210 -0
- package/lib/index.d.ts +51 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +39 -0
- package/lib/index.js.map +1 -0
- package/lib/parser/index.d.ts +6 -0
- package/lib/parser/index.d.ts.map +1 -0
- package/lib/parser/index.js +6 -0
- package/lib/parser/index.js.map +1 -0
- package/lib/parser/parser.d.ts +43 -0
- package/lib/parser/parser.d.ts.map +1 -0
- package/lib/parser/parser.js +192 -0
- package/lib/parser/parser.js.map +1 -0
- package/lib/parser/tokenizer.d.ts +37 -0
- package/lib/parser/tokenizer.d.ts.map +1 -0
- package/lib/parser/tokenizer.js +172 -0
- package/lib/parser/tokenizer.js.map +1 -0
- package/lib/rehype/index.d.ts +7 -0
- package/lib/rehype/index.d.ts.map +1 -0
- package/lib/rehype/index.js +6 -0
- package/lib/rehype/index.js.map +1 -0
- package/lib/rehype/plugin.d.ts +18 -0
- package/lib/rehype/plugin.d.ts.map +1 -0
- package/lib/rehype/plugin.js +31 -0
- package/lib/rehype/plugin.js.map +1 -0
- package/lib/rehype/transformers/all.d.ts +8 -0
- package/lib/rehype/transformers/all.d.ts.map +1 -0
- package/lib/rehype/transformers/all.js +10 -0
- package/lib/rehype/transformers/all.js.map +1 -0
- package/lib/rehype/transformers/button.d.ts +17 -0
- package/lib/rehype/transformers/button.d.ts.map +1 -0
- package/lib/rehype/transformers/button.js +46 -0
- package/lib/rehype/transformers/button.js.map +1 -0
- package/lib/rehype/transformers/cards.d.ts +17 -0
- package/lib/rehype/transformers/cards.d.ts.map +1 -0
- package/lib/rehype/transformers/cards.js +111 -0
- package/lib/rehype/transformers/cards.js.map +1 -0
- package/lib/rehype/transformers/expression.d.ts +17 -0
- package/lib/rehype/transformers/expression.d.ts.map +1 -0
- package/lib/rehype/transformers/expression.js +50 -0
- package/lib/rehype/transformers/expression.js.map +1 -0
- package/lib/rehype/transformers/icon.d.ts +18 -0
- package/lib/rehype/transformers/icon.d.ts.map +1 -0
- package/lib/rehype/transformers/icon.js +48 -0
- package/lib/rehype/transformers/icon.js.map +1 -0
- package/lib/rehype/transformers/index.d.ts +26 -0
- package/lib/rehype/transformers/index.d.ts.map +1 -0
- package/lib/rehype/transformers/index.js +31 -0
- package/lib/rehype/transformers/index.js.map +1 -0
- package/lib/remark/index.d.ts +8 -0
- package/lib/remark/index.d.ts.map +1 -0
- package/lib/remark/index.js +7 -0
- package/lib/remark/index.js.map +1 -0
- package/lib/remark/plugin.d.ts +22 -0
- package/lib/remark/plugin.d.ts.map +1 -0
- package/lib/remark/plugin.js +231 -0
- package/lib/remark/plugin.js.map +1 -0
- package/lib/remark/transformers/all.d.ts +14 -0
- package/lib/remark/transformers/all.d.ts.map +1 -0
- package/lib/remark/transformers/all.js +16 -0
- package/lib/remark/transformers/all.js.map +1 -0
- package/lib/remark/transformers/code.d.ts +13 -0
- package/lib/remark/transformers/code.d.ts.map +1 -0
- package/lib/remark/transformers/code.js +35 -0
- package/lib/remark/transformers/code.js.map +1 -0
- package/lib/remark/transformers/columns.d.ts +17 -0
- package/lib/remark/transformers/columns.d.ts.map +1 -0
- package/lib/remark/transformers/columns.js +41 -0
- package/lib/remark/transformers/columns.js.map +1 -0
- package/lib/remark/transformers/embed.d.ts +12 -0
- package/lib/remark/transformers/embed.d.ts.map +1 -0
- package/lib/remark/transformers/embed.js +23 -0
- package/lib/remark/transformers/embed.js.map +1 -0
- package/lib/remark/transformers/file.d.ts +13 -0
- package/lib/remark/transformers/file.d.ts.map +1 -0
- package/lib/remark/transformers/file.js +26 -0
- package/lib/remark/transformers/file.js.map +1 -0
- package/lib/remark/transformers/hint.d.ts +19 -0
- package/lib/remark/transformers/hint.d.ts.map +1 -0
- package/lib/remark/transformers/hint.js +37 -0
- package/lib/remark/transformers/hint.js.map +1 -0
- package/lib/remark/transformers/include.d.ts +16 -0
- package/lib/remark/transformers/include.d.ts.map +1 -0
- package/lib/remark/transformers/include.js +28 -0
- package/lib/remark/transformers/include.js.map +1 -0
- package/lib/remark/transformers/index.d.ts +27 -0
- package/lib/remark/transformers/index.d.ts.map +1 -0
- package/lib/remark/transformers/index.js +32 -0
- package/lib/remark/transformers/index.js.map +1 -0
- package/lib/remark/transformers/openapi.d.ts +17 -0
- package/lib/remark/transformers/openapi.d.ts.map +1 -0
- package/lib/remark/transformers/openapi.js +30 -0
- package/lib/remark/transformers/openapi.js.map +1 -0
- package/lib/remark/transformers/stepper.d.ts +17 -0
- package/lib/remark/transformers/stepper.d.ts.map +1 -0
- package/lib/remark/transformers/stepper.js +44 -0
- package/lib/remark/transformers/stepper.js.map +1 -0
- package/lib/remark/transformers/tabs.d.ts +18 -0
- package/lib/remark/transformers/tabs.d.ts.map +1 -0
- package/lib/remark/transformers/tabs.js +45 -0
- package/lib/remark/transformers/tabs.js.map +1 -0
- package/lib/remark/transformers/updates.d.ts +17 -0
- package/lib/remark/transformers/updates.d.ts.map +1 -0
- package/lib/remark/transformers/updates.js +44 -0
- package/lib/remark/transformers/updates.js.map +1 -0
- package/lib/remark/utils.d.ts +39 -0
- package/lib/remark/utils.d.ts.map +1 -0
- package/lib/remark/utils.js +139 -0
- package/lib/remark/utils.js.map +1 -0
- package/lib/theme/FAIcon/index.d.ts +10 -0
- package/lib/theme/FAIcon/index.d.ts.map +1 -0
- package/lib/theme/FAIcon/index.js +5 -0
- package/lib/theme/FAIcon/index.js.map +1 -0
- package/lib/theme/GitBookButton/index.d.ts +9 -0
- package/lib/theme/GitBookButton/index.d.ts.map +1 -0
- package/lib/theme/GitBookButton/index.js +6 -0
- package/lib/theme/GitBookButton/index.js.map +1 -0
- package/lib/theme/GitBookButton/styles.module.css +66 -0
- package/lib/theme/GitBookCard/index.d.ts +9 -0
- package/lib/theme/GitBookCard/index.d.ts.map +1 -0
- package/lib/theme/GitBookCard/index.js +6 -0
- package/lib/theme/GitBookCard/index.js.map +1 -0
- package/lib/theme/GitBookCard/styles.module.css +51 -0
- package/lib/theme/GitBookCards/index.d.ts +9 -0
- package/lib/theme/GitBookCards/index.d.ts.map +1 -0
- package/lib/theme/GitBookCards/index.js +6 -0
- package/lib/theme/GitBookCards/index.js.map +1 -0
- package/lib/theme/GitBookCards/styles.module.css +16 -0
- package/lib/theme/GitBookCodeBlock/index.d.ts +9 -0
- package/lib/theme/GitBookCodeBlock/index.d.ts.map +1 -0
- package/lib/theme/GitBookCodeBlock/index.js +6 -0
- package/lib/theme/GitBookCodeBlock/index.js.map +1 -0
- package/lib/theme/GitBookCodeBlock/styles.module.css +59 -0
- package/lib/theme/GitBookColumn/index.d.ts +9 -0
- package/lib/theme/GitBookColumn/index.d.ts.map +1 -0
- package/lib/theme/GitBookColumn/index.js +6 -0
- package/lib/theme/GitBookColumn/index.js.map +1 -0
- package/lib/theme/GitBookColumn/styles.module.css +16 -0
- package/lib/theme/GitBookColumns/index.d.ts +9 -0
- package/lib/theme/GitBookColumns/index.d.ts.map +1 -0
- package/lib/theme/GitBookColumns/index.js +6 -0
- package/lib/theme/GitBookColumns/index.js.map +1 -0
- package/lib/theme/GitBookColumns/styles.module.css +17 -0
- package/lib/theme/GitBookEmbed/index.d.ts +9 -0
- package/lib/theme/GitBookEmbed/index.d.ts.map +1 -0
- package/lib/theme/GitBookEmbed/index.js +71 -0
- package/lib/theme/GitBookEmbed/index.js.map +1 -0
- package/lib/theme/GitBookEmbed/styles.module.css +37 -0
- package/lib/theme/GitBookExpression/index.d.ts +13 -0
- package/lib/theme/GitBookExpression/index.d.ts.map +1 -0
- package/lib/theme/GitBookExpression/index.js +12 -0
- package/lib/theme/GitBookExpression/index.js.map +1 -0
- package/lib/theme/GitBookExpression/styles.module.css +16 -0
- package/lib/theme/GitBookFile/index.d.ts +9 -0
- package/lib/theme/GitBookFile/index.d.ts.map +1 -0
- package/lib/theme/GitBookFile/index.js +42 -0
- package/lib/theme/GitBookFile/index.js.map +1 -0
- package/lib/theme/GitBookFile/styles.module.css +61 -0
- package/lib/theme/GitBookInclude/index.d.ts +19 -0
- package/lib/theme/GitBookInclude/index.d.ts.map +1 -0
- package/lib/theme/GitBookInclude/index.js +8 -0
- package/lib/theme/GitBookInclude/index.js.map +1 -0
- package/lib/theme/GitBookInclude/styles.module.css +77 -0
- package/lib/theme/GitBookOpenAPI/index.d.ts +14 -0
- package/lib/theme/GitBookOpenAPI/index.d.ts.map +1 -0
- package/lib/theme/GitBookOpenAPI/index.js +73 -0
- package/lib/theme/GitBookOpenAPI/index.js.map +1 -0
- package/lib/theme/GitBookOpenAPI/styles.module.css +214 -0
- package/lib/theme/GitBookStep/index.d.ts +13 -0
- package/lib/theme/GitBookStep/index.d.ts.map +1 -0
- package/lib/theme/GitBookStep/index.js +6 -0
- package/lib/theme/GitBookStep/index.js.map +1 -0
- package/lib/theme/GitBookStep/styles.module.css +62 -0
- package/lib/theme/GitBookStepper/index.d.ts +9 -0
- package/lib/theme/GitBookStepper/index.d.ts.map +1 -0
- package/lib/theme/GitBookStepper/index.js +6 -0
- package/lib/theme/GitBookStepper/index.js.map +1 -0
- package/lib/theme/GitBookStepper/styles.module.css +7 -0
- package/lib/theme/GitBookTab/index.d.ts +12 -0
- package/lib/theme/GitBookTab/index.d.ts.map +1 -0
- package/lib/theme/GitBookTab/index.js +9 -0
- package/lib/theme/GitBookTab/index.js.map +1 -0
- package/lib/theme/GitBookTab/styles.module.css +15 -0
- package/lib/theme/GitBookTabs/index.d.ts +9 -0
- package/lib/theme/GitBookTabs/index.d.ts.map +1 -0
- package/lib/theme/GitBookTabs/index.js +32 -0
- package/lib/theme/GitBookTabs/index.js.map +1 -0
- package/lib/theme/GitBookTabs/styles.module.css +57 -0
- package/lib/theme/GitBookUpdate/index.d.ts +9 -0
- package/lib/theme/GitBookUpdate/index.d.ts.map +1 -0
- package/lib/theme/GitBookUpdate/index.js +21 -0
- package/lib/theme/GitBookUpdate/index.js.map +1 -0
- package/lib/theme/GitBookUpdate/styles.module.css +68 -0
- package/lib/theme/GitBookUpdates/index.d.ts +9 -0
- package/lib/theme/GitBookUpdates/index.d.ts.map +1 -0
- package/lib/theme/GitBookUpdates/index.js +6 -0
- package/lib/theme/GitBookUpdates/index.js.map +1 -0
- package/lib/theme/GitBookUpdates/styles.module.css +15 -0
- package/lib/theme/gitbook.css +205 -0
- package/lib/theme-types.d.ts +129 -0
- package/lib/theme-types.d.ts.map +1 -0
- package/lib/theme-types.js +5 -0
- package/lib/theme-types.js.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon transformer
|
|
3
|
+
*
|
|
4
|
+
* Transforms <i class="fa-xxx"> into FAIcon component
|
|
5
|
+
* which renders Font Awesome icons via CSS classes.
|
|
6
|
+
*/
|
|
7
|
+
import { registerRehypeTransformer } from './index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Check if element is a font awesome icon
|
|
10
|
+
*/
|
|
11
|
+
function isIconElement(element) {
|
|
12
|
+
if (element.tagName !== 'i')
|
|
13
|
+
return false;
|
|
14
|
+
const className = element.properties?.className;
|
|
15
|
+
if (!className)
|
|
16
|
+
return false;
|
|
17
|
+
const classes = Array.isArray(className) ? className : [className];
|
|
18
|
+
return classes.some((c) => String(c).startsWith('fa-') || String(c) === 'fa');
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Extract icon classes
|
|
22
|
+
*/
|
|
23
|
+
function extractIconClasses(classes) {
|
|
24
|
+
const iconClasses = classes.filter((c) => c.startsWith('fa-') || c === 'fa');
|
|
25
|
+
return iconClasses.join(' ') || 'fa-circle';
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Transform icon element to FAIcon
|
|
29
|
+
*/
|
|
30
|
+
const iconTransformer = (element) => {
|
|
31
|
+
const className = element.properties?.className;
|
|
32
|
+
const classes = Array.isArray(className) ? className.map(String) : [String(className)];
|
|
33
|
+
const icon = extractIconClasses(classes);
|
|
34
|
+
// Create MDX JSX element
|
|
35
|
+
const mdxElement = {
|
|
36
|
+
type: 'element',
|
|
37
|
+
tagName: 'FAIcon',
|
|
38
|
+
properties: {
|
|
39
|
+
icon,
|
|
40
|
+
},
|
|
41
|
+
children: [],
|
|
42
|
+
};
|
|
43
|
+
return mdxElement;
|
|
44
|
+
};
|
|
45
|
+
// Register transformer
|
|
46
|
+
registerRehypeTransformer(isIconElement, iconTransformer);
|
|
47
|
+
export { iconTransformer, isIconElement };
|
|
48
|
+
//# sourceMappingURL=icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/rehype/transformers/icon.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,yBAAyB,EAA0B,MAAM,YAAY,CAAC;AAE/E;;GAEG;AACH,SAAS,aAAa,CAAC,OAAgB;IACrC,IAAI,OAAO,CAAC,OAAO,KAAK,GAAG;QAAE,OAAO,KAAK,CAAC;IAE1C,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC;IAChD,IAAI,CAAC,SAAS;QAAE,OAAO,KAAK,CAAC;IAE7B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACnE,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;AAChF,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,OAAiB;IAC3C,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;IAC7E,OAAO,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,WAAW,CAAC;AAC9C,CAAC;AAED;;GAEG;AACH,MAAM,eAAe,GAAsB,CAAC,OAAgB,EAAkB,EAAE;IAC9E,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC;IAChD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IAEvF,MAAM,IAAI,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAEzC,yBAAyB;IACzB,MAAM,UAAU,GAAY;QAC1B,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,QAAQ;QACjB,UAAU,EAAE;YACV,IAAI;SACL;QACD,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,uBAAuB;AACvB,yBAAyB,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rehype transformer registry
|
|
3
|
+
*/
|
|
4
|
+
import type { Element } from 'hast';
|
|
5
|
+
/**
|
|
6
|
+
* Transformer function type for rehype
|
|
7
|
+
* Takes an HAST element and returns a transformed element or null
|
|
8
|
+
*/
|
|
9
|
+
export type RehypeTransformer = (element: Element) => Element | null;
|
|
10
|
+
/**
|
|
11
|
+
* Matcher function to determine if an element should be transformed
|
|
12
|
+
*/
|
|
13
|
+
export type ElementMatcher = (element: Element) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Register a transformer for matching elements
|
|
16
|
+
*/
|
|
17
|
+
export declare function registerRehypeTransformer(match: ElementMatcher, transform: RehypeTransformer): void;
|
|
18
|
+
/**
|
|
19
|
+
* Get transformer for an element
|
|
20
|
+
*/
|
|
21
|
+
export declare function getTransformerForElement(element: Element): RehypeTransformer | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Check if any transformer matches an element
|
|
24
|
+
*/
|
|
25
|
+
export declare function hasTransformerForElement(element: Element): boolean;
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rehype/transformers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,GAAG,IAAI,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;AAY3D;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,iBAAiB,GAC3B,IAAI,CAEN;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,GACf,iBAAiB,GAAG,SAAS,CAO/B;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAElE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rehype transformer registry
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Registry of rehype transformers
|
|
6
|
+
*/
|
|
7
|
+
const transformers = [];
|
|
8
|
+
/**
|
|
9
|
+
* Register a transformer for matching elements
|
|
10
|
+
*/
|
|
11
|
+
export function registerRehypeTransformer(match, transform) {
|
|
12
|
+
transformers.push({ match, transform });
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get transformer for an element
|
|
16
|
+
*/
|
|
17
|
+
export function getTransformerForElement(element) {
|
|
18
|
+
for (const entry of transformers) {
|
|
19
|
+
if (entry.match(element)) {
|
|
20
|
+
return entry.transform;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Check if any transformer matches an element
|
|
27
|
+
*/
|
|
28
|
+
export function hasTransformerForElement(element) {
|
|
29
|
+
return transformers.some((entry) => entry.match(element));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rehype/transformers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAoBH;;GAEG;AACH,MAAM,YAAY,GAAuB,EAAE,CAAC;AAE5C;;GAEG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAAqB,EACrB,SAA4B;IAE5B,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACtC,OAAgB;IAEhB,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE,CAAC;QACjC,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;YACzB,OAAO,KAAK,CAAC,SAAS,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACvD,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remark plugin exports
|
|
3
|
+
*/
|
|
4
|
+
export { default as remarkGitBook } from './plugin.js';
|
|
5
|
+
export type { RemarkGitBookOptions } from './plugin.js';
|
|
6
|
+
export { registerTransformer, getTransformer, hasTransformer, getRegisteredBlocks, type BlockTransformer, } from './transformers/index.js';
|
|
7
|
+
export * from './utils.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/remark/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,KAAK,gBAAgB,GACtB,MAAM,yBAAyB,CAAC;AACjC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remark plugin exports
|
|
3
|
+
*/
|
|
4
|
+
export { default as remarkGitBook } from './plugin.js';
|
|
5
|
+
export { registerTransformer, getTransformer, hasTransformer, getRegisteredBlocks, } from './transformers/index.js';
|
|
6
|
+
export * from './utils.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/remark/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,mBAAmB,GAEpB,MAAM,yBAAyB,CAAC;AACjC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remark plugin for GitBook syntax
|
|
3
|
+
*/
|
|
4
|
+
import type { Root } from 'mdast';
|
|
5
|
+
import type { Plugin } from 'unified';
|
|
6
|
+
import './transformers/all.js';
|
|
7
|
+
export interface RemarkGitBookOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Enable/disable specific blocks
|
|
10
|
+
*/
|
|
11
|
+
blocks?: Record<string, boolean>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Track component usage
|
|
15
|
+
*/
|
|
16
|
+
export declare function trackComponent(name: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* The remark plugin
|
|
19
|
+
*/
|
|
20
|
+
declare const remarkGitBook: Plugin<[RemarkGitBookOptions?], Root>;
|
|
21
|
+
export default remarkGitBook;
|
|
22
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/remark/plugin.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAUtC,OAAO,uBAAuB,CAAC;AAE/B,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AA0DD;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAIjD;AAoHD;;GAEG;AACH,QAAA,MAAM,aAAa,EAAE,MAAM,CAAC,CAAC,oBAAoB,CAAC,CAAC,EAAE,IAAI,CAsFxD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remark plugin for GitBook syntax
|
|
3
|
+
*/
|
|
4
|
+
import { unified } from 'unified';
|
|
5
|
+
import remarkParse from 'remark-parse';
|
|
6
|
+
import { visit } from 'unist-util-visit';
|
|
7
|
+
import { parse } from '../parser/index.js';
|
|
8
|
+
import { tokenize, isTextSegment } from '../parser/tokenizer.js';
|
|
9
|
+
import { getTransformer, hasTransformer } from './transformers/index.js';
|
|
10
|
+
import { containsGitBookSyntax, getTextContent, nodeToMarkdown } from './utils.js';
|
|
11
|
+
// Import all transformers to register them
|
|
12
|
+
import './transformers/all.js';
|
|
13
|
+
// All components that might be used (GitBook custom + Docusaurus built-ins)
|
|
14
|
+
const ALL_GITBOOK_COMPONENTS = [
|
|
15
|
+
'Admonition',
|
|
16
|
+
'GitBookTabs',
|
|
17
|
+
'GitBookTab',
|
|
18
|
+
'GitBookStepper',
|
|
19
|
+
'GitBookStep',
|
|
20
|
+
'GitBookColumns',
|
|
21
|
+
'GitBookColumn',
|
|
22
|
+
'GitBookCodeBlock',
|
|
23
|
+
'GitBookUpdates',
|
|
24
|
+
'GitBookUpdate',
|
|
25
|
+
'GitBookEmbed',
|
|
26
|
+
'GitBookFile',
|
|
27
|
+
'GitBookInclude',
|
|
28
|
+
'GitBookOpenAPI',
|
|
29
|
+
'GitBookButton',
|
|
30
|
+
'FAIcon',
|
|
31
|
+
'GitBookCards',
|
|
32
|
+
'GitBookCard',
|
|
33
|
+
'GitBookExpression',
|
|
34
|
+
];
|
|
35
|
+
// Set to track which components are used in the current document
|
|
36
|
+
let usedComponents;
|
|
37
|
+
/**
|
|
38
|
+
* Create an mdxjsEsm node for imports
|
|
39
|
+
*/
|
|
40
|
+
function createImportNode(componentNames) {
|
|
41
|
+
const imports = componentNames
|
|
42
|
+
.map((name) => `import ${name} from '@theme/${name}';`)
|
|
43
|
+
.join('\n');
|
|
44
|
+
return {
|
|
45
|
+
type: 'mdxjsEsm',
|
|
46
|
+
value: imports,
|
|
47
|
+
data: {
|
|
48
|
+
estree: {
|
|
49
|
+
type: 'Program',
|
|
50
|
+
body: componentNames.map((name) => ({
|
|
51
|
+
type: 'ImportDeclaration',
|
|
52
|
+
specifiers: [
|
|
53
|
+
{
|
|
54
|
+
type: 'ImportDefaultSpecifier',
|
|
55
|
+
local: { type: 'Identifier', name },
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
source: { type: 'Literal', value: `@theme/${name}` },
|
|
59
|
+
})),
|
|
60
|
+
sourceType: 'module',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Track component usage
|
|
67
|
+
*/
|
|
68
|
+
export function trackComponent(name) {
|
|
69
|
+
if (usedComponents) {
|
|
70
|
+
usedComponents.add(name);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Process a GitBook block into MDAST nodes
|
|
75
|
+
*/
|
|
76
|
+
function processBlock(block, processContent) {
|
|
77
|
+
const transformer = getTransformer(block.name);
|
|
78
|
+
if (!transformer) {
|
|
79
|
+
// No transformer for this block type - return as-is (raw text)
|
|
80
|
+
console.warn(`No transformer for GitBook block: ${block.name}`);
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
return transformer(block, processContent);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Process content string into MDAST nodes by parsing it as real markdown.
|
|
87
|
+
* Any nested GitBook blocks within the parsed content are recursively
|
|
88
|
+
* transformed.
|
|
89
|
+
*/
|
|
90
|
+
function parseMarkdownContent(content) {
|
|
91
|
+
if (!content.trim()) {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
// Parse the content as proper markdown to produce real MDAST nodes
|
|
95
|
+
// (headings, code blocks, lists, inline code, etc.)
|
|
96
|
+
const tree = unified().use(remarkParse).parse(content);
|
|
97
|
+
const children = tree.children;
|
|
98
|
+
// Walk the parsed nodes and transform any that contain GitBook syntax
|
|
99
|
+
const result = [];
|
|
100
|
+
let i = 0;
|
|
101
|
+
while (i < children.length) {
|
|
102
|
+
const node = children[i];
|
|
103
|
+
const nodeText = getTextContent(node);
|
|
104
|
+
if (containsGitBookSyntax(nodeText)) {
|
|
105
|
+
// Collect consecutive nodes forming the GitBook block
|
|
106
|
+
const collected = collectBlockNodes({ children }, i);
|
|
107
|
+
if (collected) {
|
|
108
|
+
const parseResult = parse(collected.text);
|
|
109
|
+
for (const block of parseResult.blocks) {
|
|
110
|
+
const processed = processBlock(block, parseMarkdownContent);
|
|
111
|
+
if (processed) {
|
|
112
|
+
result.push(...processed);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
i = collected.endIndex + 1;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Not GitBook syntax — keep the node as-is
|
|
120
|
+
result.push(node);
|
|
121
|
+
i++;
|
|
122
|
+
}
|
|
123
|
+
return result;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Collect consecutive nodes that form a GitBook block.
|
|
127
|
+
*
|
|
128
|
+
* Uses the actual tokenizer to track depth so that self-closing tags
|
|
129
|
+
* (e.g. {% embed %}, {% include %}) are handled correctly — they don't
|
|
130
|
+
* increment depth and the function stops after consuming just that node.
|
|
131
|
+
*/
|
|
132
|
+
function collectBlockNodes(parent, startIndex) {
|
|
133
|
+
const children = parent.children;
|
|
134
|
+
let text = '';
|
|
135
|
+
let endIndex = startIndex;
|
|
136
|
+
for (let i = startIndex; i < children.length; i++) {
|
|
137
|
+
const node = children[i];
|
|
138
|
+
const nodeText = nodeToMarkdown(node);
|
|
139
|
+
text += (i > startIndex ? '\n' : '') + nodeText;
|
|
140
|
+
endIndex = i;
|
|
141
|
+
// Use the tokenizer to properly track depth —
|
|
142
|
+
// self-closing tokens don't affect depth.
|
|
143
|
+
const segments = tokenize(text);
|
|
144
|
+
let depth = 0;
|
|
145
|
+
let hasTag = false;
|
|
146
|
+
for (const segment of segments) {
|
|
147
|
+
if (!isTextSegment(segment)) {
|
|
148
|
+
hasTag = true;
|
|
149
|
+
if (segment.type === 'open')
|
|
150
|
+
depth++;
|
|
151
|
+
else if (segment.type === 'close')
|
|
152
|
+
depth--;
|
|
153
|
+
// self-closing doesn't change depth
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (hasTag && depth <= 0) {
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// Verify we actually collected GitBook syntax
|
|
161
|
+
const segments = tokenize(text.trim());
|
|
162
|
+
const hasTag = segments.some((s) => !isTextSegment(s));
|
|
163
|
+
if (!hasTag)
|
|
164
|
+
return null;
|
|
165
|
+
return { text: text.trim(), endIndex };
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* The remark plugin
|
|
169
|
+
*/
|
|
170
|
+
const remarkGitBook = (options = {}) => {
|
|
171
|
+
const { blocks: enabledBlocks } = options;
|
|
172
|
+
return (tree) => {
|
|
173
|
+
// Initialize component tracking for this document
|
|
174
|
+
usedComponents = new Set();
|
|
175
|
+
// First pass: find and mark nodes containing GitBook syntax
|
|
176
|
+
const nodesToProcess = [];
|
|
177
|
+
visit(tree, 'paragraph', (node, index, parent) => {
|
|
178
|
+
if (index === undefined || !parent)
|
|
179
|
+
return;
|
|
180
|
+
const text = getTextContent(node);
|
|
181
|
+
if (containsGitBookSyntax(text)) {
|
|
182
|
+
// Collect all consecutive nodes that might be part of this block
|
|
183
|
+
const collected = collectBlockNodes(parent, index);
|
|
184
|
+
if (collected) {
|
|
185
|
+
nodesToProcess.push({
|
|
186
|
+
parent: parent,
|
|
187
|
+
startIndex: index,
|
|
188
|
+
endIndex: collected.endIndex,
|
|
189
|
+
text: collected.text,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
// Second pass: transform collected nodes (in reverse order to preserve indices)
|
|
195
|
+
for (let i = nodesToProcess.length - 1; i >= 0; i--) {
|
|
196
|
+
const { parent, startIndex, endIndex, text } = nodesToProcess[i];
|
|
197
|
+
if (!('children' in parent))
|
|
198
|
+
continue;
|
|
199
|
+
const parseResult = parse(text);
|
|
200
|
+
if (parseResult.blocks.length === 0)
|
|
201
|
+
continue;
|
|
202
|
+
const newNodes = [];
|
|
203
|
+
for (const block of parseResult.blocks) {
|
|
204
|
+
// Check if block is enabled
|
|
205
|
+
if (enabledBlocks && enabledBlocks[block.name] === false) {
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
// Check if we have a transformer
|
|
209
|
+
if (!hasTransformer(block.name)) {
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
const processed = processBlock(block, parseMarkdownContent);
|
|
213
|
+
if (processed) {
|
|
214
|
+
newNodes.push(...processed);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (newNodes.length > 0) {
|
|
218
|
+
// Replace nodes
|
|
219
|
+
const deleteCount = endIndex - startIndex + 1;
|
|
220
|
+
parent.children.splice(startIndex, deleteCount, ...newNodes);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
// Add imports for all GitBook components at the beginning of the document
|
|
224
|
+
// This ensures components from both remark and rehype transformations are available
|
|
225
|
+
// Tree-shaking will remove unused imports in production
|
|
226
|
+
const importNode = createImportNode(ALL_GITBOOK_COMPONENTS);
|
|
227
|
+
tree.children.unshift(importNode);
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
export default remarkGitBook;
|
|
231
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/remark/plugin.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEnF,2CAA2C;AAC3C,OAAO,u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,EAAE,CAAC;gBACxB,gBAAgB;gBAChB,MAAM,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,CAAC,CAAC;gBAC7C,MAAM,CAAC,QAAsB,CAAC,MAAM,CACnC,UAAU,EACV,WAAW,EACX,GAAG,QAAQ,CACZ,CAAC;YACJ,CAAC;QACH,CAAC;QAED,0EAA0E;QAC1E,oFAAoF;QACpF,wDAAwD;QACxD,MAAM,UAAU,GAAG,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;QAC5D,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Import all transformers to register them
|
|
3
|
+
*/
|
|
4
|
+
import './hint.js';
|
|
5
|
+
import './tabs.js';
|
|
6
|
+
import './stepper.js';
|
|
7
|
+
import './columns.js';
|
|
8
|
+
import './updates.js';
|
|
9
|
+
import './code.js';
|
|
10
|
+
import './embed.js';
|
|
11
|
+
import './file.js';
|
|
12
|
+
import './include.js';
|
|
13
|
+
import './openapi.js';
|
|
14
|
+
//# sourceMappingURL=all.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../../../src/remark/transformers/all.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,WAAW,CAAC;AACnB,OAAO,WAAW,CAAC;AACnB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC;AACtB,OAAO,WAAW,CAAC;AACnB,OAAO,YAAY,CAAC;AACpB,OAAO,WAAW,CAAC;AACnB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Import all transformers to register them
|
|
3
|
+
*/
|
|
4
|
+
// This file imports all transformers to ensure they get registered
|
|
5
|
+
// when the remark plugin is loaded
|
|
6
|
+
import './hint.js';
|
|
7
|
+
import './tabs.js';
|
|
8
|
+
import './stepper.js';
|
|
9
|
+
import './columns.js';
|
|
10
|
+
import './updates.js';
|
|
11
|
+
import './code.js';
|
|
12
|
+
import './embed.js';
|
|
13
|
+
import './file.js';
|
|
14
|
+
import './include.js';
|
|
15
|
+
import './openapi.js';
|
|
16
|
+
//# sourceMappingURL=all.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all.js","sourceRoot":"","sources":["../../../src/remark/transformers/all.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,mEAAmE;AACnE,mCAAmC;AAEnC,OAAO,WAAW,CAAC;AACnB,OAAO,WAAW,CAAC;AACnB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC;AACtB,OAAO,WAAW,CAAC;AACnB,OAAO,YAAY,CAAC;AACpB,OAAO,WAAW,CAAC;AACnB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code block transformer
|
|
3
|
+
*
|
|
4
|
+
* Transforms {% code title="filename.js" %}```js...```{% endcode %}
|
|
5
|
+
* into GitBookCodeBlock component
|
|
6
|
+
*/
|
|
7
|
+
import { type BlockTransformer } from './index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Transform a code block into MDX JSX element
|
|
10
|
+
*/
|
|
11
|
+
declare const codeTransformer: BlockTransformer;
|
|
12
|
+
export { codeTransformer };
|
|
13
|
+
//# sourceMappingURL=code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../src/remark/transformers/code.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAExE;;GAEG;AACH,QAAA,MAAM,eAAe,EAAE,gBA4BtB,CAAC;AAKF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code block transformer
|
|
3
|
+
*
|
|
4
|
+
* Transforms {% code title="filename.js" %}```js...```{% endcode %}
|
|
5
|
+
* into GitBookCodeBlock component
|
|
6
|
+
*/
|
|
7
|
+
import { createMdxJsxElement } from '../utils.js';
|
|
8
|
+
import { registerTransformer } from './index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Transform a code block into MDX JSX element
|
|
11
|
+
*/
|
|
12
|
+
const codeTransformer = (block, transformContent) => {
|
|
13
|
+
const title = block.attributes.title || '';
|
|
14
|
+
const lineNumbers = block.attributes.lineNumbers === 'true';
|
|
15
|
+
const overflow = block.attributes.overflow || 'scroll';
|
|
16
|
+
// Modify content to add showLineNumbers to code fence if needed
|
|
17
|
+
let content = block.content;
|
|
18
|
+
if (lineNumbers) {
|
|
19
|
+
// Add showLineNumbers to the code fence language identifier
|
|
20
|
+
// Match ```language or ```language some-meta
|
|
21
|
+
content = content.replace(/^```(\w+)(\s|$)/m, '```$1 showLineNumbers$2');
|
|
22
|
+
}
|
|
23
|
+
// Transform the content
|
|
24
|
+
const children = transformContent(content);
|
|
25
|
+
const attributes = { title };
|
|
26
|
+
if (overflow !== 'scroll') {
|
|
27
|
+
attributes.overflow = overflow;
|
|
28
|
+
}
|
|
29
|
+
const element = createMdxJsxElement('GitBookCodeBlock', attributes, children);
|
|
30
|
+
return [element];
|
|
31
|
+
};
|
|
32
|
+
// Register transformer
|
|
33
|
+
registerTransformer('code', codeTransformer);
|
|
34
|
+
export { codeTransformer };
|
|
35
|
+
//# sourceMappingURL=code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.js","sourceRoot":"","sources":["../../../src/remark/transformers/code.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAA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BookColumn components
|
|
6
|
+
*/
|
|
7
|
+
import { type BlockTransformer } from './index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Transform a columns block into MDX JSX elements
|
|
10
|
+
*/
|
|
11
|
+
declare const columnsTransformer: BlockTransformer;
|
|
12
|
+
/**
|
|
13
|
+
* Column blocks are handled as children of columns
|
|
14
|
+
*/
|
|
15
|
+
declare const columnTransformer: BlockTransformer;
|
|
16
|
+
export { columnsTransformer, columnTransformer };
|
|
17
|
+
//# sourceMappingURL=columns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columns.d.ts","sourceRoot":"","sources":["../../../src/remark/transformers/columns.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAExE;;GAEG;AACH,QAAA,MAAM,kBAAkB,EAAE,gBA4BzB,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,iBAAiB,EAAE,gBAQxB,CAAC;AAMF,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Columns block transformer
|
|
3
|
+
*
|
|
4
|
+
* Transforms {% columns %}{% column %}content{% endcolumn %}{% endcolumns %}
|
|
5
|
+
* into GitBookColumns/GitBookColumn components
|
|
6
|
+
*/
|
|
7
|
+
import { createMdxJsxElement } from '../utils.js';
|
|
8
|
+
import { registerTransformer } from './index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Transform a columns block into MDX JSX elements
|
|
11
|
+
*/
|
|
12
|
+
const columnsTransformer = (block, transformContent) => {
|
|
13
|
+
// Process child column blocks
|
|
14
|
+
const columnElements = [];
|
|
15
|
+
for (const child of block.children) {
|
|
16
|
+
if (child.name === 'column') {
|
|
17
|
+
const columnContent = transformContent(child.content);
|
|
18
|
+
const columnElement = createMdxJsxElement('GitBookColumn', {}, columnContent);
|
|
19
|
+
columnElements.push(columnElement);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (columnElements.length === 0) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
// Create the columns container
|
|
26
|
+
const element = createMdxJsxElement('GitBookColumns', {}, columnElements);
|
|
27
|
+
return [element];
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Column blocks are handled as children of columns
|
|
31
|
+
*/
|
|
32
|
+
const columnTransformer = (block, transformContent) => {
|
|
33
|
+
const children = transformContent(block.content);
|
|
34
|
+
const element = createMdxJsxElement('GitBookColumn', {}, children);
|
|
35
|
+
return [element];
|
|
36
|
+
};
|
|
37
|
+
// Register transformers
|
|
38
|
+
registerTransformer('columns', columnsTransformer);
|
|
39
|
+
registerTransformer('column', columnTransformer);
|
|
40
|
+
export { columnsTransformer, columnTransformer };
|
|
41
|
+
//# sourceMappingURL=columns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columns.js","sourceRoot":"","sources":["../../../src/remark/transformers/columns.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAyB,MAAM,YAAY,CAAC;AAExE;;GAEG;AACH,MAAM,kBAAkB,GAAqB,CAC3C,KAAmB,EACnB,gBAAgD,EAC9B,EAAE;IACpB,8BAA8B;IAC9B,MAAM,cAAc,GAAc,EAAE,CAAC;IAErC,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACnC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC5B,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAEtD,MAAM,aAAa,GAAG,mBAAmB,CACvC,eAAe,EACf,EAAE,EACF,aAAa,CACd,CAAC;YACF,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,+BAA+B;IAC/B,MAAM,OAAO,GAAG,mBAAmB,CAAC,gBAAgB,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC;IAE1E,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,iBAAiB,GAAqB,CAC1C,KAAmB,EACnB,gBAAgD,EAC9B,EAAE;IACpB,MAAM,QAAQ,GAAG,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,mBAAmB,CAAC,eAAe,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC;IAEnE,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAC;AAEF,wBAAwB;AACxB,mBAAmB,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;AACnD,mBAAmB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Embed block transformer
|
|
3
|
+
*
|
|
4
|
+
* Transforms {% embed url="..." %} into GitBookEmbed component
|
|
5
|
+
*/
|
|
6
|
+
import { type BlockTransformer } from './index.js';
|
|
7
|
+
/**
|
|
8
|
+
* Transform an embed block into MDX JSX element
|
|
9
|
+
*/
|
|
10
|
+
declare const embedTransformer: BlockTransformer;
|
|
11
|
+
export { embedTransformer };
|
|
12
|
+
//# sourceMappingURL=embed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.d.ts","sourceRoot":"","sources":["../../../src/remark/transformers/embed.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAExE;;GAEG;AACH,QAAA,MAAM,gBAAgB,EAAE,gBAcvB,CAAC;AAKF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Embed block transformer
|
|
3
|
+
*
|
|
4
|
+
* Transforms {% embed url="..." %} into GitBookEmbed component
|
|
5
|
+
*/
|
|
6
|
+
import { createMdxJsxElement } from '../utils.js';
|
|
7
|
+
import { registerTransformer } from './index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Transform an embed block into MDX JSX element
|
|
10
|
+
*/
|
|
11
|
+
const embedTransformer = (block, _transformContent) => {
|
|
12
|
+
const url = block.attributes.url || '';
|
|
13
|
+
if (!url) {
|
|
14
|
+
console.warn('Embed block missing url attribute');
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const element = createMdxJsxElement('GitBookEmbed', { url }, []);
|
|
18
|
+
return [element];
|
|
19
|
+
};
|
|
20
|
+
// Register transformer
|
|
21
|
+
registerTransformer('embed', embedTransformer);
|
|
22
|
+
export { embedTransformer };
|
|
23
|
+
//# sourceMappingURL=embed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.js","sourceRoot":"","sources":["../../../src/remark/transformers/embed.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAyB,MAAM,YAAY,CAAC;AAExE;;GAEG;AACH,MAAM,gBAAgB,GAAqB,CACzC,KAAmB,EACnB,iBAAiD,EAC/B,EAAE;IACpB,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,EAAE,CAAC;IAEvC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,OAAO,GAAG,mBAAmB,CAAC,cAAc,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IAEjE,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAC;AAEF,uBAAuB;AACvB,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File block transformer
|
|
3
|
+
*
|
|
4
|
+
* Transforms {% file src="..." %}description{% endfile %}
|
|
5
|
+
* into GitBookFile component
|
|
6
|
+
*/
|
|
7
|
+
import { type BlockTransformer } from './index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Transform a file block into MDX JSX element
|
|
10
|
+
*/
|
|
11
|
+
declare const fileTransformer: BlockTransformer;
|
|
12
|
+
export { fileTransformer };
|
|
13
|
+
//# sourceMappingURL=file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/remark/transformers/file.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAExE;;GAEG;AACH,QAAA,MAAM,eAAe,EAAE,gBAiBtB,CAAC;AAKF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|