Skip to content

Markdown Online Preview Site Plan

Goal

Build a lightweight online preview site for Markdown files generated by Codex.

Instead of sending long Markdown content through WeChat, Codex should be able to:

  1. Generate a .md file locally.
  2. Put it into a preview-site repository or folder.
  3. Trigger deployment.
  4. Return a public preview URL.

Example final URL:

text
https://docs.lshbosheth.cn/ranran-gsap-migration

Final Direction

Use a small dedicated documentation site.

Final stack:

  • VitePress
  • Vercel
  • Custom subdomain
  • Git-backed deployment

Suggested subdomains:

text
docs.lshbosheth.cn
preview.lshbosheth.cn
notes.lshbosheth.cn

Recommended final domain:

text
docs.lshbosheth.cn

The preview site should be treated as a real output channel for Codex-generated documents, not as a temporary static folder.

Final Architecture

text
Codex workspace
  ↓ generate markdown
docs-preview repository
  ↓ git push
Vercel deployment
  ↓ custom domain
https://docs.lshbosheth.cn/{slug}

The user should receive the final preview URL instead of the full Markdown body in WeChat.

VitePress Setup

Project Structure

text
docs-preview/
  package.json
  docs/
    index.md
    ranran-gsap-migration.md
    markdown-preview-site-plan.md
    .vitepress/
      config.ts

Basic Setup

bash
npm create vitepress@latest docs-preview
cd docs-preview
npm install
npm run docs:dev

Or manually install:

bash
npm init -y
npm install -D vitepress

Example package.json scripts:

json
{
  "scripts": {
    "docs:dev": "vitepress dev docs",
    "docs:build": "vitepress build docs",
    "docs:preview": "vitepress preview docs"
  },
  "devDependencies": {
    "vitepress": "latest"
  }
}

Example VitePress Config

docs/.vitepress/config.ts

ts
import { defineConfig } from "vitepress";

export default defineConfig({
  title: "lshbosheth Docs",
  description: "Markdown previews generated by Codex",
  cleanUrls: true,
  themeConfig: {
    nav: [
      { text: "Home", link: "/" }
    ],
    sidebar: [
      {
        text: "Preview Docs",
        items: [
          { text: "Ranran GSAP Migration", link: "/ranran-gsap-migration" },
          { text: "Markdown Preview Site Plan", link: "/markdown-preview-site-plan" }
        ]
      }
    ]
  }
});

Deployment

Deploy to Vercel or Cloudflare Pages.

For Vercel:

  • Framework preset: VitePress or Other
  • Build command:
bash
npm run docs:build
  • Output directory:
text
docs/.vitepress/dist

Bind a custom domain such as:

text
docs.lshbosheth.cn

Repository

text
docs-preview

This should be a separate repository from the WeChat bridge workspace.

Suggested repo location:

text
github.com/lshbosheth/docs-preview

Suggested local checkout path:

text
D:\lshbosheth\cc-connect-weixin-codex\workspace\docs-preview

This path keeps the preview repository visible to Codex in the current workspace, while still allowing it to be its own Git repository.

If nested Git repositories become inconvenient, move it to:

text
D:\lshbosheth\docs-preview

and record the final path in lshbosheth-memory.

Recommended content folder:

text
docs-preview/docs/

Generated Markdown files should be copied or created directly into:

text
docs-preview/docs/{slug}.md

Then the preview URL should be:

text
https://docs.lshbosheth.cn/{slug}

Publishing Rules

Do not publish every Markdown file automatically.

Use these rules:

  • If the user says 写一个 md 放工作区, save it locally only.
  • If the user says 生成 md 并给我预览链接, publish it to the preview site.
  • If the user says 这个也发线上预览, publish it to the preview site.
  • If the document may contain private health, account, company, or project secrets, ask before publishing or keep it local.

Default behavior:

text
Local md only, unless the user asks for an online preview link.

Deployment Flow

One-time setup

  1. Create docs-preview repository.
  2. Initialize VitePress.
  3. Push to GitHub.
  4. Import the repository into Vercel.
  5. Set build command:
bash
npm run docs:build
  1. Set output directory:
text
docs/.vitepress/dist
  1. Bind custom domain:
text
docs.lshbosheth.cn
  1. Confirm Vercel auto-deploys on main branch push.

Per-document flow

  1. Codex creates or updates docs/{slug}.md.
  2. Codex updates docs/.vitepress/config.ts sidebar when the doc should appear in navigation.
  3. Codex runs the local build if practical.
  4. Codex commits and pushes.
  5. Vercel deploys automatically.
  6. Codex replies with:
text
https://docs.lshbosheth.cn/{slug}

Future Codex Workflow

When the user asks Codex to generate a document:

  1. Create the Markdown file.
  2. Generate a safe slug from the title.
  3. Save it to the preview site.
  4. Update sidebar/navigation if needed.
  5. Run build locally if useful.
  6. Commit and push to the preview-site repo.
  7. Wait for deployment or trigger deployment.
  8. Return only the preview URL in WeChat.

Example:

text
User: 写一个 ranran GSAP 迁移说明,给我线上预览。

Codex:
- Creates docs/ranran-gsap-migration.md
- Updates sidebar
- Deploys preview site
- Replies:
  https://docs.lshbosheth.cn/ranran-gsap-migration

Naming Rules

Use lowercase kebab-case slugs.

Examples:

text
ranran-gsap-migration
markdown-preview-site-plan
macbook-air-vs-pro
wechat-codex-bridge-notes

Avoid Chinese filenames for public URLs unless there is a specific reason.

Privacy Notes

Do not publish private notes by default.

Before publishing, check whether the Markdown contains:

  • Tokens or API keys.
  • Private domains or internal URLs.
  • Phone numbers or addresses.
  • Account names that should not be public.
  • Personal health details.
  • Work-internal implementation details.

If the content is private, either:

  • Keep it local only.
  • Publish to a private repo / protected site.
  • Redact sensitive sections before deployment.

Acceptance Criteria

The first version is ready when:

  1. A Markdown file can be added locally.
  2. The file has a stable public preview URL.
  3. The site works on desktop and mobile.
  4. The custom domain resolves correctly.
  5. Codex can update the docs without pasting long content into WeChat.

Notes

This preview site should be separate from the main cc-connect-weixin-codex workspace unless there is a strong reason to couple them.

The preview site is an output channel, not the source of long-term memory.

Docsify is intentionally not used in the final plan. VitePress is preferred because this preview site may become a long-term document surface with navigation, clean URLs, custom theme control, and stable deployment behavior.