如何在我的网站中包含 WMD 编辑器?
我知道这似乎是一个简单的问题,但是对于所有 WMD 版本,我需要知道如何在我的网站中包含 WMD 编辑器,以及是否有一个服务器控件可以包含在服务器端,或者只有 WMD 类可以包含在我的网站中。管理和清理输入内容?
I know this might seem a simple question, but with all the WMD versions out there, I need to know how to include WMD Editor in my website, and is there a server control to include in server-side or there is only WMD classes to manage and sanitize input content?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最近在我的博客中写了一篇文章,简单讨论了如何在您的网站中获取 derobins wmd 编辑器(与 SO wmd 编辑器相同):http://codesprout.blogspot.com/2011/03/wysiwyg-derobins-wmd-markdown-editor-in.html< /a> 在我的博客中,我提供了下载最新 WMD 编辑器的链接、说明以及随 WMD 下载提供的测试页。
安装
安装说明非常好,所以安装很顺利!
用法
我发现稍微修改一下 wmd 测试页面很有用,只是为了感受一下编辑器(对于已经熟悉 StackOverflow 的人来说应该非常熟悉)。
实施
假设您已经将 wmd 样式表添加/合并到网站的样式表中,现在您只需在母版页中添加适当的引用,使用 wmd 编辑器创建局部视图,最后在您选择的页面。
第 1 步:按照 wmd 的安装说明进行操作。
安装位于 readme 文件中://github.com/derobins/wmd" rel="nofollow">wmd 下载。
步骤 2:为编辑器创建一个局部视图(我称之为 MarkdownControl)。
步骤 3:在您选择的页面中显示控件:
这样您就拥有了:部分视图中的所见即所得编辑器,您可以将其显示在网站上的任何位置!您可以在此处查看我的实际实施:www.mydevarmy.com/Competition/Propose
I recently wrote an article in my blog with a simple discussion on how to get derobins wmd editor (same one as the SO wmd editor) in your web site: http://codesprout.blogspot.com/2011/03/wysiwyg-derobins-wmd-markdown-editor-in.html In my blog I provide the links for downloading the latest WMD editor, the instructions and a test page provided with the WMD download.
Installation
The installation instructions were quite good, so the installation went without a hitch!
Usage
I found it useful to muck with the wmd test page a little, just to get a feel for the editor (which should be pretty familiar to people who are already familiar with StackOverflow).
Implementation
Suppose you've already added/merged the wmd style sheet to your web site's style sheet, now you just need to add the proper references in your master page, create a partial view with the wmd editor, and finally display the partial view on a page of your choice.
Step 1: Follow the installation instructions for wmd.
The installation are in the readme file of the wmd download.
Step 2: Create a partial view for the editor (I called mine MarkdownControl).
Step 3: Display the control in a page of your choice:
And there you have it: a WYSIWYG editor in a partial view which you can display anywhere on your web site! You can see my implementation in action here: www.mydevarmy.com/Competition/Propose