在博客园安家
CSDN为了强制推广自己的编辑器,禁了离线博客发布的接口,于是来这里了。主要是两点原因:
1. 界面很整洁,不像CSDN那样广告满天飞,零零散散。
2. 对Windows Live Writer的支持很好。
1. 注册和配置Windows Live Writer
注册cnblog账号之后,还有人工审批才能开通博客,怎么说呢,有点感动吧。
然后开始设置Windows Live Writer,参考这里:http://www.cnblogs.com/dudu/articles/495718.html.
2. 代码插件
参考这里:http://www.cnblogs.com/wuchang/archive/2010/01/21/LiveWriter-SyntaxHighlighter-Plugin.html。
去http://code.google.com/p/wlwsh/下载源码,这个project只能用mercurial下载,有点麻烦。注意编译之前要根据本机Windows Live Writer的安装路径添加3个引用dll文件,就能够编译通过了。
安装只需把生成的wuchang.sh.dll拷贝到你的Live Writer安装目录下的Plugins子目录中即可(一般为C:/Program Files/Windows Live Writer/Plugins或者C:/Program Files/Windows Live/Writer/Plugins)。
然后使用新增的插件来添加代码,与cnblogs无缝衔接,很漂亮。示例如下:
#include <stdio.h> #define LEN 10 int a[LEN] = { 10, 5, 2, 4, 7, 8, 6, 9, 1, 0, 3 }; void insertion_sort(int *a) { int i, j, key; for (j = 1; j < LEN; j++) { key = a[j]; i = j - 1; while(i >= 0 && a[i] > key) { a[i+1] = a[i]; i--; } a[i+1] = key; } for (i = 0; i < LEN; i++) printf("%d\t", a[i]); printf("\n"); } int main() { insertion_sort(a); return 0; }
官方还有一个插件,参考:http://www.cnblogs.com/cmt/archive/2012/06/26/live_writer_cnblogs_code_highlight.html。示例效果如下:
#include <stdio.h> #define LEN 10 int a[LEN] = { 10, 5, 2, 4, 7, 8, 6, 9, 1, 0, 3 }; void insertion_sort(int *a) { int i, j, key; for (j = 1; j < LEN; j++) { key = a[j]; i = j - 1; while(i >= 0 && a[i] > key) { a[i+1] = a[i]; i--; } a[i+1] = key; } for (i = 0; i < LEN; i++) printf("%d\t", a[i]); printf("\n"); } int main() { insertion_sort(a); return 0; }
前者美观,后者紧凑。
3. 其他插件[未用]
参考:http://blog.csdn.net/pongba/article/details/1966306。
4. 排版[未用]
排版要参考这里:http://www.cnblogs.com/lyj/archive/2008/11/30/1344463.html.
优质内容筛选与推荐>>