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.
Files changed (204) hide show
  1. package/README.md +210 -0
  2. package/lib/index.d.ts +51 -0
  3. package/lib/index.d.ts.map +1 -0
  4. package/lib/index.js +39 -0
  5. package/lib/index.js.map +1 -0
  6. package/lib/parser/index.d.ts +6 -0
  7. package/lib/parser/index.d.ts.map +1 -0
  8. package/lib/parser/index.js +6 -0
  9. package/lib/parser/index.js.map +1 -0
  10. package/lib/parser/parser.d.ts +43 -0
  11. package/lib/parser/parser.d.ts.map +1 -0
  12. package/lib/parser/parser.js +192 -0
  13. package/lib/parser/parser.js.map +1 -0
  14. package/lib/parser/tokenizer.d.ts +37 -0
  15. package/lib/parser/tokenizer.d.ts.map +1 -0
  16. package/lib/parser/tokenizer.js +172 -0
  17. package/lib/parser/tokenizer.js.map +1 -0
  18. package/lib/rehype/index.d.ts +7 -0
  19. package/lib/rehype/index.d.ts.map +1 -0
  20. package/lib/rehype/index.js +6 -0
  21. package/lib/rehype/index.js.map +1 -0
  22. package/lib/rehype/plugin.d.ts +18 -0
  23. package/lib/rehype/plugin.d.ts.map +1 -0
  24. package/lib/rehype/plugin.js +31 -0
  25. package/lib/rehype/plugin.js.map +1 -0
  26. package/lib/rehype/transformers/all.d.ts +8 -0
  27. package/lib/rehype/transformers/all.d.ts.map +1 -0
  28. package/lib/rehype/transformers/all.js +10 -0
  29. package/lib/rehype/transformers/all.js.map +1 -0
  30. package/lib/rehype/transformers/button.d.ts +17 -0
  31. package/lib/rehype/transformers/button.d.ts.map +1 -0
  32. package/lib/rehype/transformers/button.js +46 -0
  33. package/lib/rehype/transformers/button.js.map +1 -0
  34. package/lib/rehype/transformers/cards.d.ts +17 -0
  35. package/lib/rehype/transformers/cards.d.ts.map +1 -0
  36. package/lib/rehype/transformers/cards.js +111 -0
  37. package/lib/rehype/transformers/cards.js.map +1 -0
  38. package/lib/rehype/transformers/expression.d.ts +17 -0
  39. package/lib/rehype/transformers/expression.d.ts.map +1 -0
  40. package/lib/rehype/transformers/expression.js +50 -0
  41. package/lib/rehype/transformers/expression.js.map +1 -0
  42. package/lib/rehype/transformers/icon.d.ts +18 -0
  43. package/lib/rehype/transformers/icon.d.ts.map +1 -0
  44. package/lib/rehype/transformers/icon.js +48 -0
  45. package/lib/rehype/transformers/icon.js.map +1 -0
  46. package/lib/rehype/transformers/index.d.ts +26 -0
  47. package/lib/rehype/transformers/index.d.ts.map +1 -0
  48. package/lib/rehype/transformers/index.js +31 -0
  49. package/lib/rehype/transformers/index.js.map +1 -0
  50. package/lib/remark/index.d.ts +8 -0
  51. package/lib/remark/index.d.ts.map +1 -0
  52. package/lib/remark/index.js +7 -0
  53. package/lib/remark/index.js.map +1 -0
  54. package/lib/remark/plugin.d.ts +22 -0
  55. package/lib/remark/plugin.d.ts.map +1 -0
  56. package/lib/remark/plugin.js +231 -0
  57. package/lib/remark/plugin.js.map +1 -0
  58. package/lib/remark/transformers/all.d.ts +14 -0
  59. package/lib/remark/transformers/all.d.ts.map +1 -0
  60. package/lib/remark/transformers/all.js +16 -0
  61. package/lib/remark/transformers/all.js.map +1 -0
  62. package/lib/remark/transformers/code.d.ts +13 -0
  63. package/lib/remark/transformers/code.d.ts.map +1 -0
  64. package/lib/remark/transformers/code.js +35 -0
  65. package/lib/remark/transformers/code.js.map +1 -0
  66. package/lib/remark/transformers/columns.d.ts +17 -0
  67. package/lib/remark/transformers/columns.d.ts.map +1 -0
  68. package/lib/remark/transformers/columns.js +41 -0
  69. package/lib/remark/transformers/columns.js.map +1 -0
  70. package/lib/remark/transformers/embed.d.ts +12 -0
  71. package/lib/remark/transformers/embed.d.ts.map +1 -0
  72. package/lib/remark/transformers/embed.js +23 -0
  73. package/lib/remark/transformers/embed.js.map +1 -0
  74. package/lib/remark/transformers/file.d.ts +13 -0
  75. package/lib/remark/transformers/file.d.ts.map +1 -0
  76. package/lib/remark/transformers/file.js +26 -0
  77. package/lib/remark/transformers/file.js.map +1 -0
  78. package/lib/remark/transformers/hint.d.ts +19 -0
  79. package/lib/remark/transformers/hint.d.ts.map +1 -0
  80. package/lib/remark/transformers/hint.js +37 -0
  81. package/lib/remark/transformers/hint.js.map +1 -0
  82. package/lib/remark/transformers/include.d.ts +16 -0
  83. package/lib/remark/transformers/include.d.ts.map +1 -0
  84. package/lib/remark/transformers/include.js +28 -0
  85. package/lib/remark/transformers/include.js.map +1 -0
  86. package/lib/remark/transformers/index.d.ts +27 -0
  87. package/lib/remark/transformers/index.d.ts.map +1 -0
  88. package/lib/remark/transformers/index.js +32 -0
  89. package/lib/remark/transformers/index.js.map +1 -0
  90. package/lib/remark/transformers/openapi.d.ts +17 -0
  91. package/lib/remark/transformers/openapi.d.ts.map +1 -0
  92. package/lib/remark/transformers/openapi.js +30 -0
  93. package/lib/remark/transformers/openapi.js.map +1 -0
  94. package/lib/remark/transformers/stepper.d.ts +17 -0
  95. package/lib/remark/transformers/stepper.d.ts.map +1 -0
  96. package/lib/remark/transformers/stepper.js +44 -0
  97. package/lib/remark/transformers/stepper.js.map +1 -0
  98. package/lib/remark/transformers/tabs.d.ts +18 -0
  99. package/lib/remark/transformers/tabs.d.ts.map +1 -0
  100. package/lib/remark/transformers/tabs.js +45 -0
  101. package/lib/remark/transformers/tabs.js.map +1 -0
  102. package/lib/remark/transformers/updates.d.ts +17 -0
  103. package/lib/remark/transformers/updates.d.ts.map +1 -0
  104. package/lib/remark/transformers/updates.js +44 -0
  105. package/lib/remark/transformers/updates.js.map +1 -0
  106. package/lib/remark/utils.d.ts +39 -0
  107. package/lib/remark/utils.d.ts.map +1 -0
  108. package/lib/remark/utils.js +139 -0
  109. package/lib/remark/utils.js.map +1 -0
  110. package/lib/theme/FAIcon/index.d.ts +10 -0
  111. package/lib/theme/FAIcon/index.d.ts.map +1 -0
  112. package/lib/theme/FAIcon/index.js +5 -0
  113. package/lib/theme/FAIcon/index.js.map +1 -0
  114. package/lib/theme/GitBookButton/index.d.ts +9 -0
  115. package/lib/theme/GitBookButton/index.d.ts.map +1 -0
  116. package/lib/theme/GitBookButton/index.js +6 -0
  117. package/lib/theme/GitBookButton/index.js.map +1 -0
  118. package/lib/theme/GitBookButton/styles.module.css +66 -0
  119. package/lib/theme/GitBookCard/index.d.ts +9 -0
  120. package/lib/theme/GitBookCard/index.d.ts.map +1 -0
  121. package/lib/theme/GitBookCard/index.js +6 -0
  122. package/lib/theme/GitBookCard/index.js.map +1 -0
  123. package/lib/theme/GitBookCard/styles.module.css +51 -0
  124. package/lib/theme/GitBookCards/index.d.ts +9 -0
  125. package/lib/theme/GitBookCards/index.d.ts.map +1 -0
  126. package/lib/theme/GitBookCards/index.js +6 -0
  127. package/lib/theme/GitBookCards/index.js.map +1 -0
  128. package/lib/theme/GitBookCards/styles.module.css +16 -0
  129. package/lib/theme/GitBookCodeBlock/index.d.ts +9 -0
  130. package/lib/theme/GitBookCodeBlock/index.d.ts.map +1 -0
  131. package/lib/theme/GitBookCodeBlock/index.js +6 -0
  132. package/lib/theme/GitBookCodeBlock/index.js.map +1 -0
  133. package/lib/theme/GitBookCodeBlock/styles.module.css +59 -0
  134. package/lib/theme/GitBookColumn/index.d.ts +9 -0
  135. package/lib/theme/GitBookColumn/index.d.ts.map +1 -0
  136. package/lib/theme/GitBookColumn/index.js +6 -0
  137. package/lib/theme/GitBookColumn/index.js.map +1 -0
  138. package/lib/theme/GitBookColumn/styles.module.css +16 -0
  139. package/lib/theme/GitBookColumns/index.d.ts +9 -0
  140. package/lib/theme/GitBookColumns/index.d.ts.map +1 -0
  141. package/lib/theme/GitBookColumns/index.js +6 -0
  142. package/lib/theme/GitBookColumns/index.js.map +1 -0
  143. package/lib/theme/GitBookColumns/styles.module.css +17 -0
  144. package/lib/theme/GitBookEmbed/index.d.ts +9 -0
  145. package/lib/theme/GitBookEmbed/index.d.ts.map +1 -0
  146. package/lib/theme/GitBookEmbed/index.js +71 -0
  147. package/lib/theme/GitBookEmbed/index.js.map +1 -0
  148. package/lib/theme/GitBookEmbed/styles.module.css +37 -0
  149. package/lib/theme/GitBookExpression/index.d.ts +13 -0
  150. package/lib/theme/GitBookExpression/index.d.ts.map +1 -0
  151. package/lib/theme/GitBookExpression/index.js +12 -0
  152. package/lib/theme/GitBookExpression/index.js.map +1 -0
  153. package/lib/theme/GitBookExpression/styles.module.css +16 -0
  154. package/lib/theme/GitBookFile/index.d.ts +9 -0
  155. package/lib/theme/GitBookFile/index.d.ts.map +1 -0
  156. package/lib/theme/GitBookFile/index.js +42 -0
  157. package/lib/theme/GitBookFile/index.js.map +1 -0
  158. package/lib/theme/GitBookFile/styles.module.css +61 -0
  159. package/lib/theme/GitBookInclude/index.d.ts +19 -0
  160. package/lib/theme/GitBookInclude/index.d.ts.map +1 -0
  161. package/lib/theme/GitBookInclude/index.js +8 -0
  162. package/lib/theme/GitBookInclude/index.js.map +1 -0
  163. package/lib/theme/GitBookInclude/styles.module.css +77 -0
  164. package/lib/theme/GitBookOpenAPI/index.d.ts +14 -0
  165. package/lib/theme/GitBookOpenAPI/index.d.ts.map +1 -0
  166. package/lib/theme/GitBookOpenAPI/index.js +73 -0
  167. package/lib/theme/GitBookOpenAPI/index.js.map +1 -0
  168. package/lib/theme/GitBookOpenAPI/styles.module.css +214 -0
  169. package/lib/theme/GitBookStep/index.d.ts +13 -0
  170. package/lib/theme/GitBookStep/index.d.ts.map +1 -0
  171. package/lib/theme/GitBookStep/index.js +6 -0
  172. package/lib/theme/GitBookStep/index.js.map +1 -0
  173. package/lib/theme/GitBookStep/styles.module.css +62 -0
  174. package/lib/theme/GitBookStepper/index.d.ts +9 -0
  175. package/lib/theme/GitBookStepper/index.d.ts.map +1 -0
  176. package/lib/theme/GitBookStepper/index.js +6 -0
  177. package/lib/theme/GitBookStepper/index.js.map +1 -0
  178. package/lib/theme/GitBookStepper/styles.module.css +7 -0
  179. package/lib/theme/GitBookTab/index.d.ts +12 -0
  180. package/lib/theme/GitBookTab/index.d.ts.map +1 -0
  181. package/lib/theme/GitBookTab/index.js +9 -0
  182. package/lib/theme/GitBookTab/index.js.map +1 -0
  183. package/lib/theme/GitBookTab/styles.module.css +15 -0
  184. package/lib/theme/GitBookTabs/index.d.ts +9 -0
  185. package/lib/theme/GitBookTabs/index.d.ts.map +1 -0
  186. package/lib/theme/GitBookTabs/index.js +32 -0
  187. package/lib/theme/GitBookTabs/index.js.map +1 -0
  188. package/lib/theme/GitBookTabs/styles.module.css +57 -0
  189. package/lib/theme/GitBookUpdate/index.d.ts +9 -0
  190. package/lib/theme/GitBookUpdate/index.d.ts.map +1 -0
  191. package/lib/theme/GitBookUpdate/index.js +21 -0
  192. package/lib/theme/GitBookUpdate/index.js.map +1 -0
  193. package/lib/theme/GitBookUpdate/styles.module.css +68 -0
  194. package/lib/theme/GitBookUpdates/index.d.ts +9 -0
  195. package/lib/theme/GitBookUpdates/index.d.ts.map +1 -0
  196. package/lib/theme/GitBookUpdates/index.js +6 -0
  197. package/lib/theme/GitBookUpdates/index.js.map +1 -0
  198. package/lib/theme/GitBookUpdates/styles.module.css +15 -0
  199. package/lib/theme/gitbook.css +205 -0
  200. package/lib/theme-types.d.ts +129 -0
  201. package/lib/theme-types.d.ts.map +1 -0
  202. package/lib/theme-types.js +5 -0
  203. package/lib/theme-types.js.map +1 -0
  204. package/package.json +69 -0
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Shared types for GitBook theme components
3
+ */
4
+ import type { ReactNode } from 'react';
5
+ /**
6
+ * Tabs component props
7
+ */
8
+ export interface TabsProps {
9
+ children: ReactNode;
10
+ }
11
+ /**
12
+ * Tab component props
13
+ */
14
+ export interface TabProps {
15
+ title: string;
16
+ children: ReactNode;
17
+ }
18
+ /**
19
+ * Stepper component props
20
+ */
21
+ export interface StepperProps {
22
+ children: ReactNode;
23
+ }
24
+ /**
25
+ * Step component props
26
+ */
27
+ export interface StepProps {
28
+ stepNumber?: number;
29
+ children: ReactNode;
30
+ }
31
+ /**
32
+ * Columns component props
33
+ */
34
+ export interface ColumnsProps {
35
+ children: ReactNode;
36
+ }
37
+ /**
38
+ * Column component props
39
+ */
40
+ export interface ColumnProps {
41
+ children: ReactNode;
42
+ }
43
+ /**
44
+ * Updates component props
45
+ */
46
+ export interface UpdatesProps {
47
+ format?: 'full' | 'compact';
48
+ children: ReactNode;
49
+ }
50
+ /**
51
+ * Update component props
52
+ */
53
+ export interface UpdateProps {
54
+ date: string;
55
+ children: ReactNode;
56
+ }
57
+ /**
58
+ * CodeBlock component props
59
+ */
60
+ export interface CodeBlockProps {
61
+ title: string;
62
+ lineNumbers?: boolean;
63
+ overflow?: 'wrap' | 'scroll';
64
+ children: ReactNode;
65
+ }
66
+ /**
67
+ * Embed component props
68
+ */
69
+ export interface EmbedProps {
70
+ url: string;
71
+ }
72
+ /**
73
+ * File component props
74
+ */
75
+ export interface FileProps {
76
+ src: string;
77
+ children?: ReactNode;
78
+ }
79
+ /**
80
+ * Cards component props
81
+ */
82
+ export interface CardsProps {
83
+ children: ReactNode;
84
+ }
85
+ /**
86
+ * Card component props
87
+ */
88
+ export interface CardProps {
89
+ title: string;
90
+ href: string;
91
+ children?: ReactNode;
92
+ }
93
+ /**
94
+ * Button component props
95
+ */
96
+ export interface ButtonProps {
97
+ href: string;
98
+ variant?: 'primary' | 'secondary';
99
+ icon?: string;
100
+ children: ReactNode;
101
+ }
102
+ /**
103
+ * FAIcon component props
104
+ */
105
+ export interface FAIconProps {
106
+ icon: string;
107
+ }
108
+ /**
109
+ * Expression component props
110
+ */
111
+ export interface ExpressionProps {
112
+ expression: string;
113
+ value?: string;
114
+ }
115
+ /**
116
+ * Include component props
117
+ */
118
+ export interface IncludeProps {
119
+ src: string;
120
+ }
121
+ /**
122
+ * OpenAPI component props
123
+ */
124
+ export interface OpenAPIProps {
125
+ src: string;
126
+ path: string;
127
+ method: string;
128
+ }
129
+ //# sourceMappingURL=theme-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-types.d.ts","sourceRoot":"","sources":["../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,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Shared types for GitBook theme components
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=theme-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-types.js","sourceRoot":"","sources":["../src/theme-types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "docusaurus-plugin-gitbook",
3
+ "version": "0.1.0",
4
+ "description": "Docusaurus plugin for MDX that adds support for GitBook-specific blocks",
5
+ "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
7
+ "files": [
8
+ "lib"
9
+ ],
10
+ "scripts": {
11
+ "build": "tsc && yarn copy-assets",
12
+ "copy-assets": "find src -name '*.css' -exec sh -c 'mkdir -p lib/$(dirname ${1#src/}) && cp $1 lib/${1#src/}' _ {} \\;",
13
+ "watch": "tsc --watch",
14
+ "clean": "rm -rf lib",
15
+ "prepublishOnly": "yarn clean && yarn build",
16
+ "test": "vitest",
17
+ "test:watch": "vitest --watch",
18
+ "lint": "eslint src",
19
+ "lint:fix": "eslint src --fix",
20
+ "typecheck": "tsc --noEmit"
21
+ },
22
+ "keywords": [
23
+ "docusaurus",
24
+ "plugin",
25
+ "gitbook",
26
+ "mdx",
27
+ "remark"
28
+ ],
29
+ "license": "MIT",
30
+ "packageManager": "yarn@4.12.0",
31
+ "workspaces": [
32
+ "docs"
33
+ ],
34
+ "peerDependencies": {
35
+ "@docusaurus/core": "^3.0.0",
36
+ "docusaurus-theme-openapi-docs": "^4.0.0 || ^3.0.0"
37
+ },
38
+ "peerDependenciesMeta": {
39
+ "docusaurus-theme-openapi-docs": {
40
+ "optional": true
41
+ }
42
+ },
43
+ "type": "module",
44
+ "devDependencies": {
45
+ "@docusaurus/core": "^3.7.0",
46
+ "@docusaurus/types": "^3.7.0",
47
+ "@eslint/js": "^10.0.1",
48
+ "@types/hast": "^3.0.4",
49
+ "@types/node": "^22.0.0",
50
+ "@types/react": "^19.2.13",
51
+ "@types/react-dom": "^19.2.3",
52
+ "eslint": "^9.0.0",
53
+ "hast": "^1.0.0",
54
+ "react": "^19.2.4",
55
+ "react-dom": "^19.2.4",
56
+ "rehype-parse": "^9.0.1",
57
+ "rehype-stringify": "^10.0.1",
58
+ "typescript": "^5.7.0",
59
+ "typescript-eslint": "^8.0.0",
60
+ "vitest": "^3.0.0"
61
+ },
62
+ "dependencies": {
63
+ "@types/mdast": "^4.0.4",
64
+ "mdast-util-mdx-jsx": "^3.2.0",
65
+ "remark-parse": "^11.0.0",
66
+ "unified": "^11.0.0",
67
+ "unist-util-visit": "^5.0.0"
68
+ }
69
+ }