Skip to content

feat: solve the problem of TinyEditor document demo not displaying - #113

Merged
zzcr merged 1 commit into
devfrom
wyp/tiny-edtior-0722
Jul 24, 2026
Merged

feat: solve the problem of TinyEditor document demo not displaying#113
zzcr merged 1 commit into
devfrom
wyp/tiny-edtior-0722

Conversation

@wuyiping0628

@wuyiping0628 wuyiping0628 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

文档系统中TinyEditor下面的:::demo src=... 无法解析,是因为主站用的是 vitepress-demo-plugin(只认 ),而 tiny-editor 原文是 @vitepress-code-preview 的 :::demo 语法,导致demo无法显示
修改前
old
修改后
new

Summary by CodeRabbit

  • New Features

    • Added support for rendering TinyEditor demos directly in documentation pages.
    • Included Fluent Editor styling in the documentation theme.
  • Bug Fixes

    • Improved TinyEditor demo presentation by preventing documentation styles from affecting editor previews, including list formatting and spacing.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Adds VitePress support for TinyEditor demo markdown blocks, loads Fluent Editor styles, and isolates TinyEditor preview list styling from VitePress defaults.

Changes

TinyEditor documentation integration

Layer / File(s) Summary
TinyEditor demo markdown pipeline
.vitepress/config.mts, .vitepress/theme/markdown/tiny-editor-demo.ts
Transforms :::demo src=... blocks into demo tags and registers the preprocessing plugin in VitePress.
TinyEditor theme rendering
.vitepress/theme/index.ts, .vitepress/theme/style.css
Loads Fluent Editor styles and resets list styling within TinyEditor demo previews.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • opentiny/docs#112: Updates related VitePress demo styling selectors in the same stylesheet.

Suggested reviewers: gene9831

Poem

A rabbit hops through docs so bright,
TinyEditor blocks now render right.
Fluent styles join the parade,
Lists keep the shape that editors made.
“Hop hop!” says Bun, “the demos are displayed!”

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing TinyEditor documentation demos not displaying.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wyp/tiny-edtior-0722

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.vitepress/theme/markdown/tiny-editor-demo.ts:
- Around line 10-13: Update transformTinyEditorDemoMarkdown to parse or
otherwise track Markdown structure before converting demo directives, so
same-line :::demo src=... ::: syntax is handled while matching text inside
fenced code blocks remains unchanged. Preserve the existing vuePath resolution
and replacement output, and add regression coverage for both inline directives
and fenced-block content.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 15112c3b-4678-4006-83f7-26356daa4c40

📥 Commits

Reviewing files that changed from the base of the PR and between b8de140 and 61a5747.

📒 Files selected for processing (4)
  • .vitepress/config.mts
  • .vitepress/theme/index.ts
  • .vitepress/theme/markdown/tiny-editor-demo.ts
  • .vitepress/theme/style.css

Comment thread .vitepress/theme/markdown/tiny-editor-demo.ts
@zzcr
zzcr merged commit 25ccbcf into dev Jul 24, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants