Windows Live Writer高亮外掛程式

來源:互聯網
上載者:User
Windows Live Writer高亮外掛程式

關於Windows Live Writer的高亮外掛程式,網上有許多,我基本上都試用過一遍,不知道是否是我軟體版本(14.0.8089.726 zh-cn)的原因,很多這類外掛程式使用起來會報錯,立馬就沒有使用的慾望了。本文將介紹2種不同的Windows Live Writer高亮外掛程式——Insert Code For Windows Live Writer和Syntax Highlighter,比較一下它們的著色效果以及一些其他功能,看有什麼不同。

註:著色的範例程式碼——Javascript

1、Insert Code For Windows Live Writer

我們先看一下Insert Code的:

 

著色代碼效果:

var ArrayImageError = [];function ImageOnError(obj, type, url) {    if (obj.src.indexOf('blog.163.com') == -1) {        ArrayImageError.push(obj.src.replace('http://images.163.com/099851203/',''));        obj.src=obj.src.replace('images.163.com', 'blog.163.com');    }}function WriteImageError(){    if(ArrayImageError.length > 0)    {        CreateLogFile();    }}function CreateLogFile(){    var form = document.createElement("form");    form.id="form_imageerror";    form.name="form_imageerror";    form.action="/Templates/163/ImageErrorLog.do";    form.method="post";    form.target = "ifr_imageerror"    var input = document.createElement("input");    input.id="txt_imageerror";    input.name="txt_imageerror";    input.type="text";    for(var i = 0; i < ArrayImageError.length; i ++)    {        if(input.value == "")        {            input.value += ArrayImageError[i];        }        else        {            input.value += "|" + ArrayImageError[i];        }    }    //alert(input.value);    form.appendChild(input);    document.getElementById("div_imageerror").appendChild(form);    form.submit();}

:Insert Code For Windows Live Writer

2、Syntax Highlighter

Syntax Highlighter的:

 

著色代碼效果:

var ArrayImageError = [];function ImageOnError(obj, type, url) {if (obj.src.indexOf('blog.163.com') == -1) {ArrayImageError.push(obj.src.replace('http://images.163.com/099851203/',''));obj.src=obj.src.replace('images.163.com', 'blog.163.com');}}function WriteImageError(){if(ArrayImageError.length > 0){CreateLogFile();}}function CreateLogFile(){var form = document.createElement("form");form.id="form_imageerror";form.name="form_imageerror";form.action="/Templates/163/ImageErrorLog.do";form.method="post";form.target = "ifr_imageerror"var input = document.createElement("input");input.id="txt_imageerror";input.name="txt_imageerror";input.type="text";for(var i = 0; i < ArrayImageError.length; i ++){if(input.value == ""){input.value += ArrayImageError[i];}else{input.value += "|" + ArrayImageError[i];}}//alert(input.value);form.appendChild(input);document.getElementById("div_imageerror").appendChild(form);form.submit();}

:Syntax Highlighter

總結:

1、可以明顯地看出來,Insert Code的縮排比Syntax Highlighter要小,比較符合我們平時的縮排大小; 2、Insert Code支援單引號字串著色,而Syntax Highlighter不能;3、Insert Code支援插入行號和隔行換色功能;4、Syntax Highlighter支援自訂模板配置,但基本上比較雞肋,可以不考慮;5、這2個外掛程式都不支援自訂色彩配置,比較失敗;6、高亮外掛程式的著色原理都是使用css樣式來控制區塊顏色,因此,任何一款高亮外掛程式都可以在“原始碼”視圖進行自訂編輯,只是麻煩程度不同而已;

最後,個人偏向於使用Insert Code,插入代碼後基本不需要調整了,喜歡的童鞋可以下載試試。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.