一、首先到官網下載OLW:http://openlivewriter.org/javascript
二、選擇 Other servicesphp
三、填寫「博客地址」、「用戶名」、「密碼」css
四、「選擇博客提供商」 和 「遠程發佈博客地址」html
五、博客提供商 爲:Metaweblog APIjava
六、設置git
(1)選擇博客github
(2)註冊博客賬戶web
(3)下載博客主題 選 「否」編程
七、配置CSDN博客的鏈接windows
(1)開始配置
用戶名:CSDN用戶名
密碼:CSDN登陸密碼
(2)遠程發佈博客
(3)設置博客暱稱
(4)配置完成
八、配置博客園的鏈接
(1)開始配置
用戶名:博客園用戶名
密碼:博客園登陸密碼
(2)遠程發佈博客 博客園用戶名/services/metaweblog.aspx
(彷佛博客園不須要這個,跳過了這個步驟,但仍是貼出來,萬一哪天又要了呢)
(3)設置博客暱稱
(4)配置完成
九、配置網易博客的鏈接
(1)開始配置
博客地址:http://網易用戶名.blog.163.com/
用戶名:網易郵箱前綴(163郵箱才取前綴)
密碼:網易登陸密碼
(2)遠程發佈博客地址:http://os.blog.163.com/word/
(3)設置博客暱稱
(4)配置完成
十、配置新浪博客的鏈接:
(1)開始配置
博客地址:http://blog.sina.com.cn/新浪博客用戶名
用戶名:新浪登陸賬號
密碼:新浪登陸密碼
(2)遠程發佈博客地址:無(貌似也不須要,跳過這個步驟)
(3)設置博客暱稱
(4)配置完成
十一、配置51CTO博客的鏈接
(1)開始配置
博客地址:http://51CTO用戶名.blog.51cto.com/xmlrpc.php
用戶名:51CTO用戶名
密碼:51CTO登陸密碼
(2)遠程發佈博客地址:http://51CTO用戶名.blog.51cto.com/xmlrpc.php
(3)設置博客暱稱
(4)配置完成
十二、配置ChinaAET博客的鏈接
(1)開始配置
博客地址:http://blog.chinaaet.com/ChinaAET用戶名
用戶名:ChinaAET用戶名
密碼:ChinaAET登陸密碼
(2)遠程發佈博客地址:http://blog.chinaaet.com/metaweblog.ashx
(3)設置博客暱稱
(4)配置完成
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四、全部鏈接一覽:
1五、代碼高亮插件:
此插件放入C:\Users\siwux\AppData\Local\OpenLiveWriter\app-0.6.0.0\Plugins
(這裏的siwux是你電腦的用戶名,若沒有Plugins文件夾,就本身建立)
免積分 免下載豆 直接下載:
狡兔雙窟其二:http://down.51cto.com/data/2271173
關於代碼高亮插件:
(1):https://github.com/OpenLiveWriter/OpenLiveWriter
博客園內置支持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」插件,以下圖:
點擊該插件,粘貼須要着色的代碼並選擇相應的編程語言便可。
=================================================================================================================
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
(界面血漂亮)
默認安裝到C:\Users\用戶\AppData\Local\OpenLiveWriter目錄,結構以下:
、
標紅色的是OLW的主程序:
雙擊OpenLiveWriter.exe便可打開OLW編輯器:
做爲一個開發人員,對代碼進行着色是不可缺乏的,如何在OLW下實現插入代碼並着色呢?
前奏:從cnblogs的官網獲取,在windows live writer下,可用WindowsLiveWriter.CNBlogs.CodeHighlighter進行代碼着色,是有有效的
實驗:將WindowsLiveWriter.CNBlogs.CodeHighlighter.dll插件放到C:\Users\用戶\AppData\Local\OpenLiveWriter\app-0.6.0.0\Plugins目錄下,啓動並未有見插件
分析:經過調試OLW的源碼代碼調試,加載插件出現異常;經過ILSpy分析WindowsLiveWriter.CNBlogs.CodeHighlighter.dll,以下圖
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
插件安裝以後:
(1)原始項目下載地址:http://sourcecodeplugin.codeplex.com/SourceControl/latest
點擊「download」下載,只需按照3.2修訂WindowsLiveWriter.SourceCode項目編譯。
(2)修改後的項目可從github下載:
https://github.com/zsy619/OpenLiveWriter.SourceCode,下載編輯便可使用。
(1)修改類庫引用,WindowsLive.Writer.Api.dll更改成OpenLiveWriter.Api.dll(能夠從OLW安裝的目錄下找到)
(2)修改輸出地址:
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(); }
C#代碼展現如上,目前CNBlogs官網接口還不支持go語言,有點遺憾,期待更新!
===============================================================================================================================
最新插件下載地址:Memento.OLW_V1.0.0.3.7z
1. 修正 cnblog 語法高亮中的 SQL、Perl 語法高亮異常
下載地址:Memento.OLW_V1.0.0.1.7z
1. 增長 cnblog 頁籤中 SQL 語法高亮的關鍵詞連接選擇;
下載地址:Memento.OLW_V1.0.0.2.7z
1. 修正Python語法高亮中單行註釋顏色問題;
2. 修正Matlab語法高亮細節問題;
下載地址:Memento.OLW_V1.0.0.3.7z
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
>
(圖一)博客園網頁端插入代碼工具彈窗
/// <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 插件詳細設置
/// <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 主界面
● 標題展開