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/
爲人:謙遜、激情、博學、審問、慎思、明辨、 篤行 學問:紙上得來終覺淺,絕知此事要躬行 爲事:工欲善其事,必先利其器。 態度:道阻且長,行則將至;行而不輟,將來可期 轉載請標註出處!
相關文章
相關標籤/搜索