福州网站微信公众号,济南网站优化推广公司,韩国网站,百度搜索引擎网址一直用Windows Live Writer写博客#xff0c;不过没找到能与博客园配合得很好的代码插件#xff0c;每次写完文章发布到博客园总要手动修改代码。所以我自己写了一个博客园专用的Windows Live Writer代码插件#xff08;我知道这世界上已经有N个代码插件#xff0c;好吧不过没找到能与博客园配合得很好的代码插件每次写完文章发布到博客园总要手动修改代码。所以我自己写了一个博客园专用的Windows Live Writer代码插件我知道这世界上已经有N个代码插件好吧我承认我手贱O(∩_∩)O~。 代码是通过syntaxhighlighter渲染的插件根据博客园的特点定制了特殊的html格式。 使用方法 插件使用非常简单在需要插入代码的地方点击“插入”菜单下的“CnblogsCode” 然后就可以再如下的界面中插入代码了 效果如下 /************************************************************* Windows Live Writer 博客园专用代码插件* * Author: 张洋Eric Zhang* Blog: leoo2sk.cnblogs.com* E-mail: ericzhang.buaagmail.com************************************************************/using System.Windows.Forms;
using WindowsLive.Writer.Api;namespace CnblogsCode
{/// /// 插件主体/// [WriterPlugin(ED97E6E4-5A18-497e-A690-5DE4CF27C327, CnblogsCode)][InsertableContentSource(插入博客园样式代码, SidebarText 博客园样式代码)]public class CnblogsCodeContentSource : ContentSource{public override DialogResult CreateContent(IWin32Window dialogOwner, ref string content){FRM_INSERT_CNBLOGS_CODE dialog new FRM_INSERT_CNBLOGS_CODE();dialog.ShowDialog();content dialog.HtmlContent;return dialog.DialogResult;}}
} 安装方法 只要将CnblogsCode.dll点击这里下载复制到“你的Windows Liver Writer安装目录\plugins\”下就可以了一般这个目录是“C:\Program Files\Windows Live\Writer\Plugins”。下面将源代码一并奉上点击这里下载。