Open Live Writer的配置

一、首先到官网下载OLW:http://openlivewriter.org/javascript

image

二、选择 Other servicesphp

image

三、填写“博客地址”、“用户名”、“密码”css

image

四、“选择博客提供商” 和 “远程发布博客地址”html

image

五、博客提供商 为:Metaweblog APIjava

image

六、设置git

(1)选择博客github

image

(2)注册博客账户web

image

(3)下载博客主题  选 “否”编程

image

七、配置CSDN博客的链接windows

(1)开始配置 

用户名:CSDN用户名

密码:CSDN登陆密码

image

(2)远程发布博客

image

(3)设置博客昵称

image


(4)配置完成

image

八、配置博客园的链接

(1)开始配置 

用户名:博客园用户名

密码:博客园登陆密码

image

(2)远程发布博客 博客园用户名/services/metaweblog.aspx

(彷佛博客园不须要这个,跳过了这个步骤,但仍是贴出来,万一哪天又要了呢)

(3)设置博客昵称

image

(4)配置完成

image

九、配置网易博客的链接

(1)开始配置

博客地址:http://网易用户名.blog.163.com/

用户名:网易邮箱前缀(163邮箱才取前缀)

密码:网易登陆密码

image

(2)远程发布博客地址:http://os.blog.163.com/word/

image

(3)设置博客昵称

image

(4)配置完成

image

十、配置新浪博客的链接:

(1)开始配置

博客地址:http://blog.sina.com.cn/新浪博客用户名

用户名:新浪登陆账号

密码:新浪登陆密码

image

(2)远程发布博客地址:无(貌似也不须要,跳过这个步骤)

(3)设置博客昵称

image

(4)配置完成

image

十一、配置51CTO博客的链接

(1)开始配置

博客地址:http://51CTO用户名.blog.51cto.com/xmlrpc.php

用户名:51CTO用户名

密码:51CTO登陆密码

image

(2)远程发布博客地址:http://51CTO用户名.blog.51cto.com/xmlrpc.php

image

(3)设置博客昵称

image

(4)配置完成

image

十二、配置ChinaAET博客的链接

(1)开始配置

博客地址:http://blog.chinaaet.com/ChinaAET用户名

用户名:ChinaAET用户名

密码:ChinaAET登陆密码

image

(2)远程发布博客地址:http://blog.chinaaet.com/metaweblog.ashx

image

(3)设置博客昵称

image

(4)配置完成

image

1三、综合以下:

CSDN: 

用户名:CSDN用户名

密码:CSDN登陆密码

远程发布博客地址

博客园: 

用户名:博客园用户名

密码:博客园登陆密码

远程发布博客地址:无 

网易博客:

博客地址:http://网易用户名.blog.163.com/

用户名:网易邮箱前缀(163邮箱才取前缀)

密码:网易登陆密码

远程发布博客地址:http://os.blog.163.com/word/

新浪博客:

博客地址:http://blog.sina.com.cn/新浪博客用户名

用户名:新浪登陆账号

密码:新浪登陆密码

远程发布博客地址:无

51CTO博客:

博客地址:http://51CTO用户名.blog.51cto.com/xmlrpc.php

用户名:51CTO用户名

密码:51CTO登陆密码

远程发布博客地址:http://51CTO用户名.blog.51cto.com/xmlrpc.php

ChinaAET博客:

博客地址:http://blog.chinaaet.com/ChinaAET用户名

用户名:ChinaAET用户名

密码:ChinaAET登陆密码

远程发布博客地址:http://blog.chinaaet.com/metaweblog.ashx

1四、全部链接一览:

image

1五、代码高亮插件:

此插件放入C:\Users\siwux\AppData\Local\OpenLiveWriter\app-0.6.0.0\Plugins

(这里的siwux是你电脑的用户名,若没有Plugins文件夹,就本身建立)

image

免积分  免下载豆  直接下载:

狡兔双窟其二:http://down.51cto.com/data/2271173

关于代码高亮插件:

(1):https://github.com/OpenLiveWriter/OpenLiveWriter 

 

 

 

Windows Live Writer推荐SyntaxHighlighter代码着色插件

博客园内置支持SyntaxHighlighter代码着色,代码着色语法:<pre class='brush:编程语言'>代码</pre>。

须要注意的是:如何你使用SyntaxHighlighter代码着色,须要将默认编辑器改成TinyMCE。若是使用CuteEditor,CuteEditor会自动去除代码中的空格,形成代码格式破坏。

若是您使用Windows Live Writer写博客(配置步骤),经过Windows Live Writer代码着色插件,能够方便进行SyntaxHighlighter代码着色。

咱们推荐的代码着色插件是:Windows Live Writer Source Code plugin for SyntaxHighlighter

官方网址:http://sourcecodeplugin.codeplex.com/

本地下载:SourceCodePlugin_version_1.1.zip

安装方法:

将WindowsLiveWriter.SourceCode.dll复制到Windows Live Writer plugin文件夹:
* 32-bit systems: C:\Program Files\Windows Live\Writer\Plugins
* 64-bit systems: C:\Program Files (x86)\Windows Live\Writer\Plugins

使用方法:

安装成功以后,在Live Writer会出现“Source Code”插件,以下图:

image

点击该插件,粘贴须要着色的代码并选择相应的编程语言便可。

image

 

=================================================================================================================

 

 

OpenLiveWriter代码插件

 

一、OpenLiveWriter安装

     Windows Live Writer在2012年就中止了更新,Open Live Writer(如下简称OLW)是由Windows Live WriterWriter改名而来,是由微软推出的一款可以无偿使用的博客写做软件,主要为用户提供博客在线撰写和编辑功能,相比Windows Live Writer,OLW首个版本仍然缺乏一些功能,不过团队已经制订了更新路线图,一些新功能会陆续推出。相信之后他将是一个写博客的好利器。

    但从github源代码(https://github.com/OpenLiveWriter/OpenLiveWriter)来看,已经有9个月未更新了,而官网更是未见一个插件,“钱途”堪忧呀。

    官网地址:http://openlivewriter.org/ 点击download下载:https://openlivewriter.azureedge.net/stable/Releases/OpenLiveWriterSetup.exe

image

image(界面血漂亮)

   默认安装到C:\Users\用户\AppData\Local\OpenLiveWriter目录,结构以下:

image

    标红色的是OLW的主程序:

image

    双击OpenLiveWriter.exe便可打开OLW编辑器:

image

    做为一个开发人员,对代码进行着色是不可缺乏的,如何在OLW下实现插入代码并着色呢?

二、如何实现代码着色

   前奏:从cnblogs的官网获取,在windows live writer下,可用WindowsLiveWriter.CNBlogs.CodeHighlighter进行代码着色,是有有效的 

   实验:将WindowsLiveWriter.CNBlogs.CodeHighlighter.dll插件放到C:\Users\用户\AppData\Local\OpenLiveWriter\app-0.6.0.0\Plugins目录下,启动并未有见插件

image

    分析:经过调试OLW的源码代码调试,加载插件出现异常;经过ILSpy分析WindowsLiveWriter.CNBlogs.CodeHighlighter.dll,以下图

image

   WindowsLiveWriter.CNBlogs.CodeHighlighter.dll引用WindowsLive.Writer.Api,与现有OLW的新接口OpenLiveWriter.Api不匹配。

   解决方案一:反编译WindowsLiveWriter.CNBlogs.CodeHighlighter.dll修改引用类库,将WindowsLive.Writer.Api.dll更改成OpenLiveWriter.Api.dll,不建议使用本方法。

   解决方案二:因为是从Windows Live Writer Source Code plugin for SyntaxHighlighter(http://sourcecodeplugin.codeplex.com/)进行优化而来,能够从本开源项目进行优化。

   封装编译以后的dll为:OpenLiveWriter.CNBlogs.SourceCode.dll,下载地址为:OpenLiveWriter.CNBlogs.SourceCode.zip

   插件安装以后:

image

image

三、代码着色项目下载

3.1 项目下载

   (1)原始项目下载地址:http://sourcecodeplugin.codeplex.com/SourceControl/latest

image

    点击“download”下载,只需按照3.2修订WindowsLiveWriter.SourceCode项目编译。

   (2)修改后的项目可从github下载:

https://github.com/zsy619/OpenLiveWriter.SourceCode,下载编辑便可使用。

3.2 编译配置

   (1)修改类库引用,WindowsLive.Writer.Api.dll更改成OpenLiveWriter.Api.dll(能够从OLW安装的目录下找到)

   (2)修改输出地址:

image

    OpenLiveWriter.CNBlogs.SourceCode类库输出地址:copy "$(TargetPath)" "C:\Users\xxtt\AppData\Local\OpenLiveWriter\app-0.6.0.0\Plugins"

   (3)CodeForm窗体代码修订

    修改Code属性:

 public string Code
        {
            get
            {
                return this._code;
            }
            set
            {
                this._code = value;
            }
        }

新增博客园的远程代码着色方法(可参考WindowsLiveWriter.CNBlogs.CodeHighlighter.dll):

 private string RemoteCodeHighlight()
        {
            string requestUriString = 'javascript:void(0)';
            HttpWebRequest httpWebRequest = WebRequest.Create(requestUriString) as HttpWebRequest;
            httpWebRequest.Method = "POST";
            httpWebRequest.ContentType = "application/x-www-form-urlencoded";
            string value = string.Format("language={0}&code={1}", HttpUtility.UrlEncode(this.comboBrush.Text.Trim()), HttpUtility.UrlEncode(this.textCode.Text.Trim()));
            using (StreamWriter streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
            {
                streamWriter.Write(value);
            }
            string result;
            using (WebResponse response = httpWebRequest.GetResponse())
            {
                using (StreamReader streamReader = new StreamReader(response.GetResponseStream()))
                {
                    result = streamReader.ReadToEnd();
                }
            }
            return result;
        }

修改buttonOK_Click方法:

 

 private void buttonOK_Click(object sender, EventArgs e)
        {
            this._configDb.Config.Brush = this.comboBrush.Text;
            this._configDb.Config.MainFormX = base.Left;
            this._configDb.Config.MainFormY = base.Top;
            this._configDb.Config.MainFormWidth = base.Width;
            this._configDb.Config.MainFormHeight = base.Height;
            this._configDb.SavePluginConfigurationData();
            try
            {
                this._code = this.RemoteCodeHighlight();
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            base.DialogResult = DialogResult.OK;
            base.Close();
        }

复制代码

3.3 使用效果

    C#代码展现如上,目前CNBlogs官网接口还不支持go语言,有点遗憾,期待更新!

 

 

===============================================================================================================================

 

 

[Tool] Open Live Writer 插件更新

 

最新插件下载地址:Memento.OLW_V1.0.0.3.7z

零、历史更新记录
  • 2016.11.24

1. 修正 cnblog 语法高亮中的 SQL、Perl 语法高亮异常

下载地址:Memento.OLW_V1.0.0.1.7z

  • 2016.11.27

1. 增长 cnblog 页签中 SQL 语法高亮的关键词连接选择;

下载地址:Memento.OLW_V1.0.0.2.7z

  • 2017.01.17

1. 修正Python语法高亮中单行注释颜色问题;

2. 修正Matlab语法高亮细节问题;

下载地址:Memento.OLW_V1.0.0.3.7z

  • 持续更新…
1、更新内容
    • cnblog 页签中增长 LuaMatlab 语法高亮;(SyntaxHighlight 页签中还没有添加)
    • 增长折叠区域插件,见效果展现;
    • 增长 bat 执行文件,直接拷贝插件所需 dll 文件到指定位置;
    • 增减 OLWPlugins.css 样式文件和 OLWPlugins.js 脚本文件; 
    • 测试 Win10/7 32/64 位系统安装使用状况;
    • 优化部分使用体验;
2、更新说明
  • 应 @我要更名叫嘟嘟 和 @船长J.K 两位的需求,尝试了一下 Wilco.SyntaxHighlighter 的扩展开发,实现 Lua 和 Matlab 两种语法高亮。因为博主不擅长这两种语言,测试不必定到位,若是两位或者其余人使用过程当中有何问题均可以留言反馈,博主再尽力修改完善,先在此谢过。
  • 折叠区域插件,先前在文章 插入折叠区域功能 中已有开发,不过那次是针对 WLW,此次移植到 OLW 上来,并优化了部分使用体验。
  • 同时,FoldRegion 插件属于本身为了方便浏览开发的,因此须要加入自定义的 css 样式和 js 脚本文件。使用该插件时须要在“博客园后台管理”->“设置”->“页首html代码”中添加这两个文件的引用,文件下载参考最后的资源下载,引用代码参考以下:

01

02

<link type="text/css" rel="stylesheet" href='javascript:void(0)'>

<script type="text/javascript" src="http://files.cnblogs.com/files/memento/OLWPlugins.js"></script>

  • 上一篇文章许多人反应说不知道插件放到哪里,Plugins 文件夹没有找到等问题,为了方便使用,博主在压缩包里增长一个 bat 文件,DeployDLL.bat,解压缩后直接执行便可拷贝插件所须要的 dll 到指定位置了。
  • 博主经过 Hyper-V 分别模拟了 Win10/7 32/64位几种不一样的环境进行插件测试,都可以使用,若是有问题请留言讨论。 注意,Open Live Writer 软件自己建议基于 .NET 4.5.2 环境,详情参考 OpenLiveWriter.SDK.nuspec
  • 对了,再啰嗦一句,从网上下载下来的 dll,windows 系统有时候会默认为锁定状态,须要在属性中进行解锁后再使用。
3、效果展现
  • cnblog(模拟博客园推荐使用的插入代码)

博客园网页端插入代码工具弹窗(图一)博客园网页端插入代码工具弹窗

插件模拟弹窗

 

 

/// <summary>
/// 构造函数
/// </summary>
/// <param name="settings">插件配置</param>
/// <param name="content">文本内容</param>
public CNBlogs(Settings settings, string content)
{
    InitializeComponent();

    try
    {
        m_Settings = settings;
        m_Content = content;
        m_HtmlParser = new HtmlParser();

        chbCollapse.CheckedChanged += ChbCollapse_CheckedChanged;
        chbTAB.CheckedChanged += chbTAB_CheckedChanged;
        chbShowLineNum.CheckedChanged += ChbShowLineNum_CheckedChanged;

        Load += CNBlogs_Load;
        txtTAB.KeyPress += CommonHelper.NumberImput_KeyPress;
    }
    catch (Exception ex)
    {
        CommonHelper.ShowError(ex);
    }
}

/// <summary>
/// 构造函数
/// </summary>
/// <param name="settings">插件配置</param>
/// <param name="content">文本内容</param>
public CNBlogs(Settings settings, string content)
{
    InitializeComponent();

    try
    {
        m_Settings = settings;
        m_Content = content;
        m_HtmlParser = new HtmlParser();

        chbCollapse.CheckedChanged += ChbCollapse_CheckedChanged;
        chbTAB.CheckedChanged += chbTAB_CheckedChanged;
        chbShowLineNum.CheckedChanged += ChbShowLineNum_CheckedChanged;

        Load += CNBlogs_Load;
        txtTAB.KeyPress += CommonHelper.NumberImput_KeyPress;
    }
    catch (Exception ex)
    {
        CommonHelper.ShowError(ex);
    }
}

 

 

-- 文件名为 module.lua
-- 定义一个名为 module 的模块
module = {}

-- 定义一个常量
module.constant = "这是一个常量"

-- 定义一个函数
function module.func1()
    io.write("这是一个公有函数!\n")
end

local function func2()
    print("这是一个私有函数!")
end

function module.func3()
    func2()
end

return module

Lua
 x = [0:0.01:10];
   y = sin(x);
   plot(x, y), xlabel('x'), ylabel('Sin(x)'), title('Sin(x) Graph'),
   grid on, axis equal
  • SyntaxHighlighter(利用博客园已植入的 SyntaxHighlighter 高亮脚本)

SyntaxHighlighter 主界面

(图三)SyntaxHighlighter 主界面

SyntaxHighlighter 插件详细设置

(图四)SyntaxHighlighter 插件详细设置

/// <summary>
/// 构造函数
/// </summary>
/// <param name="settings">插件配置</param>
/// <param name="content">文本内容</param>
public CNBlogs(Settings settings, string content)
{
    InitializeComponent();

    try
    {
        m_Settings = settings;
        m_Content = content;
        m_HtmlParser = new HtmlParser();

        chbCollapse.CheckedChanged += ChbCollapse_CheckedChanged;
        chbTAB.CheckedChanged += chbTAB_CheckedChanged;
        chbShowLineNum.CheckedChanged += ChbShowLineNum_CheckedChanged;

        Load += CNBlogs_Load;
        txtTAB.KeyPress += CommonHelper.NumberImput_KeyPress;
    }
    catch (Exception ex)
    {
        CommonHelper.ShowError(ex);
    }
}
  • FoldRegion(折叠区域插件,优化浏览体验)

FoldRegion 主界面

(图五)FoldRegion 主界面

● 标题展开

4、资源下载
  1. 插件下载:Memento.OLW_V1.0.0.3.7z
  2. 工程源码:OLW Plugin Coding
  3. 其余资源:
    • Open Live Writer 官网
    • Open Live Writer Github
    • SyntaxHighlighter 下载:http://alexgorbatchev.com/SyntaxHighlighter/download/
    • SyntaxHighlighter 配置:http://alexgorbatchev.com/SyntaxHighlighter/manual/configuration/
为人:谦逊、激情、博学、审问、慎思、明辨、 笃行 学问:纸上得来终觉浅,绝知此事要躬行 为事:工欲善其事,必先利其器。 态度:道阻且长,行则将至;行而不辍,将来可期 转载请标注出处!
相关文章
相关标签/搜索