@ox-content/vite-plugin 2.70.0 → 2.72.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/dist/github.cjs +270 -290
- package/dist/github.cjs.map +1 -1
- package/dist/github.mjs +622 -2
- package/dist/github.mjs.map +1 -0
- package/dist/github2.mjs +2 -632
- package/dist/index.cjs +142 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +62 -18
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +62 -18
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +138 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/github2.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -3142,6 +3142,140 @@ async function* renderMarkdownStream(chunks, options = {}) {
|
|
|
3142
3142
|
yield renderer.finish();
|
|
3143
3143
|
}
|
|
3144
3144
|
//#endregion
|
|
3145
|
+
//#region src/framework.ts
|
|
3146
|
+
function createFrameworkMarkdownOptions(options) {
|
|
3147
|
+
return {
|
|
3148
|
+
srcDir: options.srcDir,
|
|
3149
|
+
outDir: options.outDir,
|
|
3150
|
+
base: options.base,
|
|
3151
|
+
extensions: options.extensions,
|
|
3152
|
+
ssg: {
|
|
3153
|
+
enabled: false,
|
|
3154
|
+
extension: ".html",
|
|
3155
|
+
clean: false,
|
|
3156
|
+
bare: false,
|
|
3157
|
+
generateOgImage: false,
|
|
3158
|
+
lastUpdated: false
|
|
3159
|
+
},
|
|
3160
|
+
gfm: options.gfm,
|
|
3161
|
+
frontmatter: options.frontmatter ?? false,
|
|
3162
|
+
toc: options.toc,
|
|
3163
|
+
tocMaxDepth: options.tocMaxDepth,
|
|
3164
|
+
codeAnnotations: {
|
|
3165
|
+
enabled: options.codeAnnotations?.enabled ?? false,
|
|
3166
|
+
notation: "attribute",
|
|
3167
|
+
metaKey: options.codeAnnotations?.metaKey ?? "annotate",
|
|
3168
|
+
defaultLineNumbers: false
|
|
3169
|
+
},
|
|
3170
|
+
footnotes: true,
|
|
3171
|
+
tables: true,
|
|
3172
|
+
taskLists: true,
|
|
3173
|
+
strikethrough: true,
|
|
3174
|
+
highlight: false,
|
|
3175
|
+
highlightTheme: "github-dark",
|
|
3176
|
+
highlightLangs: [],
|
|
3177
|
+
mermaid: false,
|
|
3178
|
+
ogImage: false,
|
|
3179
|
+
ogImageOptions: {
|
|
3180
|
+
vuePlugin: "vitejs",
|
|
3181
|
+
width: 1200,
|
|
3182
|
+
height: 630,
|
|
3183
|
+
cache: true,
|
|
3184
|
+
concurrency: 1
|
|
3185
|
+
},
|
|
3186
|
+
transformers: [],
|
|
3187
|
+
docs: false,
|
|
3188
|
+
ogViewer: false,
|
|
3189
|
+
search: {
|
|
3190
|
+
enabled: false,
|
|
3191
|
+
limit: 10,
|
|
3192
|
+
prefix: true,
|
|
3193
|
+
placeholder: "Search...",
|
|
3194
|
+
hotkey: "k"
|
|
3195
|
+
},
|
|
3196
|
+
embeds: {
|
|
3197
|
+
github: options.embeds?.github ?? {},
|
|
3198
|
+
openGraph: options.embeds?.openGraph ?? {},
|
|
3199
|
+
pm: false,
|
|
3200
|
+
spotify: false,
|
|
3201
|
+
stackBlitz: false,
|
|
3202
|
+
twitter: false,
|
|
3203
|
+
bluesky: false,
|
|
3204
|
+
webContainer: false
|
|
3205
|
+
},
|
|
3206
|
+
i18n: false,
|
|
3207
|
+
wikiLinks: {
|
|
3208
|
+
enabled: false,
|
|
3209
|
+
baseUrl: options.base
|
|
3210
|
+
},
|
|
3211
|
+
emojiShortcodes: {
|
|
3212
|
+
enabled: false,
|
|
3213
|
+
custom: {}
|
|
3214
|
+
},
|
|
3215
|
+
attrs: { enabled: false },
|
|
3216
|
+
codeImports: { enabled: false },
|
|
3217
|
+
sanitize: { enabled: false },
|
|
3218
|
+
editThisPage: {
|
|
3219
|
+
enabled: false,
|
|
3220
|
+
branch: "main",
|
|
3221
|
+
label: "Edit this page"
|
|
3222
|
+
},
|
|
3223
|
+
cjkEmphasis: false,
|
|
3224
|
+
codeBlockLint: {
|
|
3225
|
+
enabled: false,
|
|
3226
|
+
requireLanguage: false,
|
|
3227
|
+
trailingSpaces: true,
|
|
3228
|
+
mode: "warn"
|
|
3229
|
+
},
|
|
3230
|
+
codeBlockTypecheck: {
|
|
3231
|
+
enabled: false,
|
|
3232
|
+
languages: ["ts", "tsx"],
|
|
3233
|
+
requireMeta: true,
|
|
3234
|
+
tsgoCommand: "tsgo",
|
|
3235
|
+
mode: "warn"
|
|
3236
|
+
},
|
|
3237
|
+
docsTests: {
|
|
3238
|
+
enabled: false,
|
|
3239
|
+
languages: [
|
|
3240
|
+
"js",
|
|
3241
|
+
"jsx",
|
|
3242
|
+
"ts",
|
|
3243
|
+
"tsx"
|
|
3244
|
+
],
|
|
3245
|
+
requireMeta: true
|
|
3246
|
+
}
|
|
3247
|
+
};
|
|
3248
|
+
}
|
|
3249
|
+
function renderHtmlToReactCreateElement(html, islands = []) {
|
|
3250
|
+
return renderHtmlToFrameworkCode(html, "react", "expression", islands);
|
|
3251
|
+
}
|
|
3252
|
+
function renderHtmlToVueH(html, islands = []) {
|
|
3253
|
+
return renderHtmlToFrameworkCode(html, "vue", "expression", islands);
|
|
3254
|
+
}
|
|
3255
|
+
function renderHtmlToFrameworkCode(html, target, mode, islands = []) {
|
|
3256
|
+
return require_napi.importNapiModuleSync().renderFrameworkComponentCode(html, target, toNapiIslands(islands), mode);
|
|
3257
|
+
}
|
|
3258
|
+
function renderHtmlToReactComponent(html, islands = []) {
|
|
3259
|
+
return renderHtmlToFrameworkCode(html, "react", "component", islands);
|
|
3260
|
+
}
|
|
3261
|
+
function renderHtmlToVueComponent(html, islands = []) {
|
|
3262
|
+
return renderHtmlToFrameworkCode(html, "vue", "component", islands);
|
|
3263
|
+
}
|
|
3264
|
+
function renderHtmlToSvelteComponent(html) {
|
|
3265
|
+
return renderHtmlToFrameworkCode(html, "svelte", "component");
|
|
3266
|
+
}
|
|
3267
|
+
function escapeSvelteMarkup(html) {
|
|
3268
|
+
return require_napi.importNapiModuleSync().escapeSvelteMarkup(html);
|
|
3269
|
+
}
|
|
3270
|
+
function toNapiIslands(islands) {
|
|
3271
|
+
return islands.map((island) => ({
|
|
3272
|
+
name: island.name,
|
|
3273
|
+
props: island.props,
|
|
3274
|
+
id: island.id,
|
|
3275
|
+
content: island.content
|
|
3276
|
+
}));
|
|
3277
|
+
}
|
|
3278
|
+
//#endregion
|
|
3145
3279
|
//#region src/docs-tests.ts
|
|
3146
3280
|
var DocsTestRunError = class extends Error {
|
|
3147
3281
|
result;
|
|
@@ -4905,6 +5039,7 @@ exports.collectGitHubSources = require_github.collectGitHubSources;
|
|
|
4905
5039
|
exports.collectOgpUrls = require_ogp.collectOgpUrls;
|
|
4906
5040
|
exports.convertVitePressNav = require_vitepress.convertVitePressNav;
|
|
4907
5041
|
exports.convertVitePressSidebar = require_vitepress.convertVitePressSidebar;
|
|
5042
|
+
exports.createFrameworkMarkdownOptions = createFrameworkMarkdownOptions;
|
|
4908
5043
|
exports.createI18nPlugin = createI18nPlugin;
|
|
4909
5044
|
exports.createIncrementalMarkdownParser = createIncrementalMarkdownParser;
|
|
4910
5045
|
exports.createIncrementalMarkdownRenderer = createIncrementalMarkdownRenderer;
|
|
@@ -4913,6 +5048,7 @@ exports.createTheme = createTheme;
|
|
|
4913
5048
|
exports.defaultTheme = require_vitepress.defaultTheme;
|
|
4914
5049
|
exports.defineTheme = require_vitepress.defineTheme;
|
|
4915
5050
|
exports.each = each;
|
|
5051
|
+
exports.escapeSvelteMarkup = escapeSvelteMarkup;
|
|
4916
5052
|
exports.extractCodeBlocks = extractCodeBlocks;
|
|
4917
5053
|
exports.extractDocs = extractDocs;
|
|
4918
5054
|
exports.extractDocsTests = extractDocsTests;
|
|
@@ -4952,6 +5088,12 @@ exports.prefetchGitHubSources = require_github.prefetchGitHubSources;
|
|
|
4952
5088
|
exports.prefetchOgpData = require_ogp.prefetchOgpData;
|
|
4953
5089
|
exports.raw = raw;
|
|
4954
5090
|
exports.renderAllPages = renderAllPages;
|
|
5091
|
+
exports.renderHtmlToFrameworkCode = renderHtmlToFrameworkCode;
|
|
5092
|
+
exports.renderHtmlToReactComponent = renderHtmlToReactComponent;
|
|
5093
|
+
exports.renderHtmlToReactCreateElement = renderHtmlToReactCreateElement;
|
|
5094
|
+
exports.renderHtmlToSvelteComponent = renderHtmlToSvelteComponent;
|
|
5095
|
+
exports.renderHtmlToVueComponent = renderHtmlToVueComponent;
|
|
5096
|
+
exports.renderHtmlToVueH = renderHtmlToVueH;
|
|
4955
5097
|
exports.renderMarkdownStream = renderMarkdownStream;
|
|
4956
5098
|
exports.renderPage = renderPage;
|
|
4957
5099
|
exports.renderToString = renderToString;
|