Windows Live Writer 代码插件测试

Windows Live Writer Plugin - Source Code Formatter

August 12, 2008 at 11:22 AM — Amer Gerzic

Couple of days ago, my blog application started crushing. At first, I assumed that my ISP provider is to blame. Somewhat irritated I submitted the question to the support crew and couple of emails later, they informed me that the blog application was taking over 100MB in RAM space (which triggers the server to stop the application). In addition I noticed that the number of visitors increased dramatically over the last couple of weeks. Quick look under the hood revealed that during post rendering, source code is rendered "on-fly", which utilizes Wilco.SyntaxHighlighter.dll control. Considering the fact that there are many posts that display the source code and that there are many visitors viewing them, it is possible that memory usage would increase drastically. To eliminate the issue I decided to render the code at the time of post editing (as opposed to rendering during page loading). The only elegant solution (in my case) was to use Windows Live Writer with source code plugin. However, I could not find a plugin that would satisfy my needs, so I decided to write my own.

As mentioned earlier, all of my syntax highlighting is done by Wilco.SyntaxHighlighting.dll control which can be found under reference section. At the same site you can find the source code. Following languages are supported:

  • ASPX
  • C
  • C#
  • C++
  • COBOL
  • Cold Fusion
  • CSS
  • Eiffel
  • Fortran
  • Haskell
  • Java
  • JavaScript
  • JScript
  • Mercury
  • MSIL
  • Pascal
  • Perl
  • PHP
  • Python
  • Ruby
  • SQL
  • Visual Basic
  • Visual Basic Script
  • XML
Sample Code Formatting:

Simplest code formatting - no box, no line numbers, no alternating color lines:

public class SourceCodeFormatter
{
    /* Member 1 */
    public static string member1;
    /* Member 2 */
    private int member2;
    // Constructor
    public SourceCodeFormatter()
    {
    }
}
 
... now enclose code into a box - very useful if the code might "overflow"
public class SourceCodeFormatter
{
    /* Member 1 */
    public static string member1;
    /* Member 2 */
    private int member2;
    // Constructor
    public SourceCodeFormatter()
    {
    }
}
 
... now add line numbers and alternating line coloring:
  1: public class SourceCodeFormatter
  2: {
  3:     /* Member 1 */
  4:     public static string member1;
  5: 
  6:     /* Member 2 */
  7:     private int member2;
  8: 
  9:     // Constructor
 10:     public SourceCodeFormatter()
 11:     {
 12:     }
 13: }
 
... now we can select some lines for demonstration:
  1: public class SourceCodeFormatter
  2: {
  3:     /* Member 1 */
  4:     public static string member1;
  5: 
  6:     /* Member 2 */
  7:     private int member2;
  8: 
  9:     // Constructor
 10:     public SourceCodeFormatter()
 11:     {
 12:     }
 13: }
 
 
 
 
 
 
 

原文地址:https://www.cnblogs.com/superdesigns/p/9807563.html

时间: 2024-08-28 02:15:44

Windows Live Writer 代码插件测试的相关文章

Windows Live Writer 代码插件改造

源码和插件都在后面,如果不想看我神神叨叨的可以直接到文章后面下载 一 .找插件 在使用Windows Live Writer 经常要用到插入代码的功能,根据博客园中教程,分别使用了: WindowsLiveWriter.CNBlogs.CodeHighlighter 和 SourceCodePlugin_version_1.1.zip 都不尽人意 只能再找一个,于是我便发现了它:Windows Live Writer Plugin - Source Code Formatter http://w

【转】Windows Live Writer 代码插件改造

源码和插件都在后面,如果不想看我神神叨叨的可以直接到文章后面下载 一 .找插件 在使用Windows Live Writer 经常要用到插入代码的功能,根据博客园中教程,分别使用了: WindowsLiveWriter.CNBlogs.CodeHighlighter 和 SourceCodePlugin_version_1.1.zip 都不尽人意 只能再找一个,于是我便发现了它:Windows Live Writer Plugin - Source Code Formatter http://w

Windows Live Writer 代码着色插件推荐

1.WindowsLiveWriter.CNBlogs.CodeHighlighter 1.1.下载地址 文件名:WindowsLiveWriter.CNBlogs.CodeHighlighter.zip 下载地址:http://files.cnblogs.com/files/cmt/WindowsLiveWriter.CNBlogs.CodeHighlighter.zip 1.2.安装方法 1.2.1.将 "WindowsLiveWriter.CNBlogs.CodeHighlighter.z

open Live Writer 代码插件安装

1,第一步:下载open live writer插件,下载地址:http://www.cnblogs.com/memento/p/5995173.html 2,拷贝文件到Plugins目录(自己建立) 3,更改家里路由器 原文地址:https://www.cnblogs.com/frogkiller/p/12215564.html

Windows Live Writer - CNBlogs.CodeHighlighter - 测试一下Blog会如何显示Python源代码

      #!/usr/local/bin/python # -*- coding: utf-8 -*-. # line of utf-8 is for multi-language # optional 4-spaces before line rule for Python. import sys sys.path.append("/homes/sli/pexpect-2.3/") import pexpect import time import re import os st

Windows Live Writer加载代码着色插件步骤

博客园内置支持SyntaxHighlighter代码着色,代码着色语法:<pre class='brush:编程语言'>代码</pre>. 需要注意的是:如何你使用SyntaxHighlighter代码着色,需要将默认编辑器改为TinyMCE.如果使用CuteEditor,CuteEditor会自动去除代码中的空格,造成代码格式破坏.还有需要注意的是,加载完插件后,在Live Writer中是看不到代码着色效果的,发布后就可以看到了. 如果您使用Windows Live Write

[cnblogs] 仿博客园插入代码的Windows Live Writer插件

一  插件相关效果图展示 插件效果图: 在Windows Live Writer中的效果如图: [1] [2] [3] 对应的插入代码在博客中的效果如下: [1] public static void Main(string[] args) { int sum = 0; for(int i = 0 ; i < 100 ; i++) { sum += i; } } [2] public static void Main(string[] args) { int sum = 0; for(int i

用 Windows Live Writer 和 SyntaxHighlighter 插件写高亮代码

博客园内置支持SyntaxHighlighter代码着色,代码着色语法:<pre class='brush:编程语言'>代码</pre>. 需要注意的是:如何你使用SyntaxHighlighter代码着色,需要将默认编辑器改为TinyMCE.如果使用CuteEditor,CuteEditor会自动去除代码中的空格,造成代码格式破坏. 如果您使用Windows Live Writer写博客(配置步骤),通过Windows Live Writer代码着色插件,可以方便进行Syntax

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

博客园内置支持SyntaxHighlighter代码着色,代码着色语法:<pre class='brush:编程语言'>代码</pre>. 需要注意的是:如何你使用SyntaxHighlighter代码着色,需要将默认编辑器改为TinyMCE.如果使用CuteEditor,CuteEditor会自动去除代码中的空格,造成代码格式破坏. 如果您使用Windows Live Writer写博客(配置步骤),通过Windows Live Writer代码着色插件,可以方便进行Syntax