Unverified Commit aabc52aa authored by Hong Minhee's avatar Hong Minhee
Browse files

Twoslash

parent 3f04908f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -242,10 +242,12 @@ jobs:
        set -ex
        bun install
        if [[ "$GITHUB_EVENT_NAME" = "push" && "$GITHUB_REF_TYPE" = "tag" ]]; then
          bun add -Df --no-cache "@fedify/fedify@$GITHUB_REF_NAME"
          EXTRA_NAV_TEXT=Unstable \
          EXTRA_NAV_LINK="$UNSTABLE_DOCS_URL" \
          bun run build
        else
          bun add -Df --no-cache @fedify/fedify@dev
          EXTRA_NAV_TEXT=Stable \
          EXTRA_NAV_LINK="$STABLE_DOCS_URL" \
          bun run build
+5 −4
Original line number Diff line number Diff line
@@ -98,13 +98,13 @@ For Markdown, we have the following conventions:
 -  Wrap file paths in asterisks.
 -  Wrap code in backticks.

In order to build the docs, as a prerequisite, you need to install [Bun] first.
Then you can run the following commands:
In order to build the docs, as a prerequisite, you need to install [Node.js] and
[pnpm] first. Then you can run the following commands:

~~~~ bash
cd docs/
bun install
bun dev
pnpm install
pnpm dev
~~~~

Once the development server is running, you can open your browser and navigate
@@ -114,6 +114,7 @@ to *http://localhost:5173/* to view the docs.
[inline links]: https://spec.commonmark.org/0.31.2/#inline-link
[setext headings]: https://spec.commonmark.org/0.31.2/#setext-headings
[ATX headings]: https://spec.commonmark.org/0.31.2/#atx-headings
[pnpm]: https://pnpm.io/

### Bug fix

+18 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ import { jsrRef } from "markdown-it-jsr-ref";
import process from "node:process";
import { defineConfig } from "vitepress";
import { withMermaid } from "vitepress-plugin-mermaid";
import { transformerTwoslash } from "@shikijs/vitepress-twoslash";

const progress = new SingleBar({}, Presets.shades_classic);
let started = false;
@@ -202,6 +203,23 @@ export default withMermaid(defineConfig({
  cleanUrls: true,
  ignoreDeadLinks: true,
  markdown: {
    codeTransformers: [
      transformerTwoslash({
        twoslashOptions: {
          compilerOptions: {
            lib: ["dom", "dom.iterable", "esnext"],
            types: [
              "dom",
              "dom.iterable",
              "esnext",
              "@teidesu/deno-types/full",
            ],
            jsx: ["react-jsx"],
            jsxImportSource: "hono/jsx",
          }
        }
      })
    ],
    config: (md) => {
      md.use(abbr);
      md.use(deflist);
+12 −0
Original line number Diff line number Diff line
import TwoslashFloatingVue from "@shikijs/vitepress-twoslash/client";
import type { EnhanceAppContext } from "vitepress";
import Theme from "vitepress/theme";

import "@shikijs/vitepress-twoslash/style.css";

export default {
  extends: Theme,
  enhanceApp({ app }: EnhanceAppContext) {
    app.use(TwoslashFloatingVue);
  },
};

docs/bun.lockb

deleted100755 → 0
−98.4 KiB

File deleted.

Loading