-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
5,266 additions
and
5,296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
apps/backend/extensions/src/routes/docusaurus/input-transformer.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
apps/backend/extensions/src/routes/mdx/input-transformer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { createInputTransformer } from "@vrite/sdk/transformers"; | ||
import { mdxjs } from "micromark-extension-mdxjs"; | ||
import { fromMarkdown } from "mdast-util-from-markdown"; | ||
import { mdxFromMarkdown } from "mdast-util-mdx"; | ||
import { frontmatter } from "micromark-extension-frontmatter"; | ||
import { frontmatterFromMarkdown } from "mdast-util-frontmatter"; | ||
import { gfmFromMarkdown } from "mdast-util-gfm"; | ||
import { gfm } from "micromark-extension-gfm"; | ||
import { toHtml } from "hast-util-to-html"; | ||
import { toHast } from "mdast-util-to-hast"; | ||
|
||
import fs from "node:fs"; | ||
import path from "node:path"; | ||
|
||
const mdxInputTransformer = createInputTransformer(() => { | ||
const doc = fs.readFileSync(path.join(__dirname, "test.mdx"), "utf8"); | ||
const tree = fromMarkdown(doc, { | ||
extensions: [gfm(), frontmatter(), mdxjs()], | ||
mdastExtensions: [gfmFromMarkdown(), frontmatterFromMarkdown(), mdxFromMarkdown()] | ||
}); | ||
const hast = toHast(tree, { handlers: {} }); | ||
const html = toHtml(hast); | ||
|
||
console.log(tree, html); | ||
|
||
return { | ||
content: "" | ||
}; | ||
}); | ||
|
||
export { mdxInputTransformer }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -945,9 +945,9 @@ | |
} | ||
}); | ||
|
||
// ../../node_modules/.pnpm/@[email protected].0/node_modules/@sanity/eventsource/browser.js | ||
// ../../node_modules/.pnpm/@[email protected].1/node_modules/@sanity/eventsource/browser.js | ||
var require_browser = __commonJS({ | ||
"../../node_modules/.pnpm/@[email protected].0/node_modules/@sanity/eventsource/browser.js"(exports, module) { | ||
"../../node_modules/.pnpm/@[email protected].1/node_modules/@sanity/eventsource/browser.js"(exports, module) { | ||
module.exports = require_eventsource().EventSourcePolyfill; | ||
} | ||
}); | ||
|
@@ -1001,6 +1001,7 @@ | |
var import_eventsource, i, w, $, U, f, g, L, d, S, D, O, E, R, C, x, m, I, h, j, v, k, q, l, A, u, z, B; | ||
var init_api = __esm({ | ||
"../../packages/sdk/javascript/dist/api.mjs"() { | ||
"use strict"; | ||
import_eventsource = __toESM(require_browser(), 1); | ||
i = "/content-groups"; | ||
w = (t) => ({ get: (e) => t("GET", `${i}`, { params: e }), list: (e) => t("GET", `${i}/list`, { params: e }), create: (e) => t("POST", `${i}`, { body: e }), update: (e) => t("PUT", `${i}`, { body: e }), delete: (e) => t("DELETE", `${i}`, { params: e }) }); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.