基于Open Live Writer实现博客代码样式优化

之前写的博客代码样式不太好看,也没有在意,最近想修改一下,于是在网上查找相关资料,发现网页版的博客没有办法实现代码样式优化,

需要借助客户端编辑器及相应插件,这里我们选用Open Live Writer 编辑器。具体步骤如下:

1. 下载安装 Open Live Writer Setup   http://openlivewriter.org/,安装路径默认为:C:\Users\用户名\AppData\Local\OpenLiveWriter\app-0.6.2

2. 配置Open Live Writer

a.选择Other services

image

b.填写“博客地址”、“用户名”、“密码”

image

c.远程发布博客

地址:http://www.cnblogs.com/博客园用户名/services/metaweblog.aspx

(目前博客园不需要这个,跳过了这个步骤,但还是记录出来,以防万一)

d.设置博客昵称

配置完成

image

3. 下载 Memento.OLW_V1.0.0.0.7z  插件   https://files.cnblogs.com/files/memento/Memento.OLW_V1.0.0.0.7z

4. 请将压缩包(Memento.OLW_V1.0.0.0.7z)里的文件拷贝到C:\Users\用户名\AppData\Local\OpenLiveWriter\app-0.6.2\Plugins

注意:若没有Plugins文件夹,就自己创建。

安装OLW插件之后的界面

image

代码插入整体界面,选择SyntaxHlighter

image

其他设置界面

image

之前的博客代码样式

  1 from django.db import models
  2 
  3 # Create your models here.
  4 class Boy(models.Model):
  5     name = models.CharField(max_length=32)
  6 
  7 class Girl(models.Model):
  8     nick = models.CharField(max_length=32)
  9 
 10 class Love(models.Model):
 11     b = models.ForeignKey('Boy')
 12     g = models.ForeignKey('Girl')
 13 
 14 class Other(models.Model):
 15     id = models.AutoField(primary_key=True)
 16     a = models.DecimalField()
 17 

现在的博客代码样式

from django.db import models

# Create your models here.
class Boy(models.Model):
    name = models.CharField(max_length=32)

class Girl(models.Model):
    nick = models.CharField(max_length=32)

class Love(models.Model):
    b = models.ForeignKey('Boy')
    g = models.ForeignKey('Girl')

class Other(models.Model):
    id = models.AutoField(primary_key=True)
    a = models.DecimalField()

注意点:如果选择“折叠代码”时,必须选择“toolbar”,因为折叠标题是在工具栏处,如果不显示工具栏也就不显示折叠标题,最后在界面上是什么都显示不出来的

参考:http://www.cnblogs.com/memento/p/5314257.html

之前的博客代码样式修改可参考:https://www.cnblogs.com/sunpear/p/7687961.html

posted @ 2018-02-01 11:02  Joe1991  阅读(86)  评论(0)    收藏  举报