cherry-markdown icon indicating copy to clipboard operation
cherry-markdown copied to clipboard

怎么将预览页面提取出来呀,我想通过编辑内容展示到主页上

Open ruisen2020 opened this issue 1 year ago • 3 comments

Prerequisites

  • [ ] There isn't an existing issue that requests the same feature, to avoid duplicates.

Issue Type

Bug Report

Description of the Problem or Idea

怎么讲预览页面提取出来呀,我想通过编辑内容展示到主页上

Further Information

No response

Contributing

None

ruisen2020 avatar Oct 11 '24 03:10 ruisen2020

可以查看一下这个: https://github.com/Tencent/cherry-markdown?tab=readme-ov-file#engine-mode-just-syntax-compile

在这里可以快速体验:https://tencent.github.io/cherry-markdown/examples/api.html

RSS1102 avatar Oct 11 '24 03:10 RSS1102

当然你也可以直接将其 编辑器设置为无toolbar 的 纯预览页面也可以。

RSS1102 avatar Oct 11 '24 03:10 RSS1102

有两个方案

  • 方案1,用Cherry的纯预览模式 效果见这里 demo对应代码在这里
  • 方案2, 用Cherry的API获取html内容 api为:cherryObject.getHtml()。获取html后,把html展示到主页上 不过这种方式需要自行实现样式或者单独引入Cherry的样式文件

sunsonliu avatar Oct 11 '24 08:10 sunsonliu