Windows Live Writer 语法高亮

1、WindowsLiveWriter.CNBlogs.CodeHighlighter.rar

这个插件生成的高亮代码与网页上的一模一样,插入后即可立即显示效果,不过貌似它必须联网才能实时显示效果,因为博客园官方说这是基于“云处理”的。安装方法很简单,将上面的压缩包解压然后复制里面的文件到:

C:\Program Files (x86)\Windows Live\Writer\Plugins,然后重启Writer即可看到

/**
 * 从一段文本中检索出唯一的结果
 * @param regx 正则表达式语句
 * @param text 要检索的文本
 * @return
 */
public String regx(String regx,String text)
{
    Matcher matcher=Pattern.compile(regx).matcher(text);
    if(matcher.find())
        return matcher.group();
    else
        return null;
}

2、Windows Live Writer Source Code plugin for SyntaxHighlighter

安装方法同上面一样,也是复制一个dll文件到插件目录

博客园内置支持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

/**
 * 从一段文本中检索出唯一的结果
 * @param regx 正则表达式语句
 * @param text 要检索的文本
 * @return
 */
public String regx(String regx,String text)
{
    Matcher matcher=Pattern.compile(regx).matcher(text);
    if(matcher.find())
        return matcher.group();
    else
        return null;
}
 
 

猜你喜欢

转载自www.cnblogs.com/ZackEdge/p/12020175.html