Skip to content

Commit

Permalink
Add initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
henrmota committed Oct 22, 2024
0 parents commit 8bad559
Show file tree
Hide file tree
Showing 7,198 changed files with 952,637 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 5 additions & 0 deletions dist/cjs/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Node } from "unist";
export declare function remarkShikiMdx({ theme }: {
theme: string;
}): (tree: Node) => Promise<void>;
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions dist/cjs/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions dist/cjs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.remarkShikiMdx = remarkShikiMdx;
const unist_util_visit_1 = require("unist-util-visit");
const shiki_1 = require("shiki");
// Custom plugin with `unist-util-visit`
function remarkShikiMdx({ theme }) {
return (tree) => __awaiter(this, void 0, void 0, function* () {
const highlighter = yield (0, shiki_1.getSingletonHighlighter)({
themes: [theme],
langs: ["js", "jsx", "ts", "tsx", "glsl"],
});
(0, unist_util_visit_1.visit)(tree, "code", (node) => {
const lang = node.lang || "text";
// Generate the highlighted code HTML
const highlightedCode = highlighter.codeToHtml(node.value, {
lang,
theme,
});
node.type = "html";
node.value = highlightedCode;
});
});
}
5 changes: 5 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Node } from "unist";
export declare function remarkShikiMdx({ theme }: {
theme: string;
}): (tree: Node) => Promise<void>;
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions dist/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
import { visit } from "unist-util-visit";
import { getSingletonHighlighter } from "shiki";
// Custom plugin with `unist-util-visit`
export function remarkShikiMdx({ theme }) {
return (tree) => __awaiter(this, void 0, void 0, function* () {
const highlighter = yield getSingletonHighlighter({
themes: [theme],
langs: ["js", "jsx", "ts", "tsx", "glsl"],
});
visit(tree, "code", (node) => {
const lang = node.lang || "text";
// Generate the highlighted code HTML
const highlightedCode = highlighter.codeToHtml(node.value, {
lang,
theme,
});
node.type = "html";
node.value = highlightedCode;
});
});
}
17 changes: 17 additions & 0 deletions node_modules/.bin/jest

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/ts-jest

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/ts-node

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/ts-node-cwd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/ts-node-esm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/ts-node-script

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/ts-node-transpile-only

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/ts-script

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/tsc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/tsserver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8bad559

Please sign in to comment.