现在一个博客每个漂亮的代码高亮插件简直不好意思见人哈
前言
昨天之前用的代码高亮插件出了问题,布吉岛为啥,好吧,我承认之前的插件有点复杂了,昨晚找个简单的用用,然后就发现了这个:wp code highlight,很简单嘛,用于wordpress的代码高亮。
使用方法
使用方法傻瓜化,只要使用wordpress自带的
HTML<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <title>Document</title> </head> <body> </body> </html>CSS
/*隐藏下拉箭头并在鼠标移动到上方显示*/ toolbarbutton:not([class*="tabs-alltabs-button"]) dropmarker {display: none !important;} toolbarbutton:not([type="menu"]):hover dropmarker {display: -moz-box !important;} toolbarbutton[type="menu"]:not([class*="bookmark-item"]) image {margin: 0px !important;} .lzl_edui_dialog_container{left: 20px;}javascript
// ==UserScript== // @name Mouseover Popup Image Viewer // @namespace http://w9p.co/userscripts/ // @description Shows larger version of thumbnails. Also supports HTML5 video. // @version 2014.8.6 // @author kuehlschrank // @homepage http://w9p.co/userscripts/mpiv/ // @icon https://s3.amazonaws.com/uso_ss/icon/109262/large.png // @include http* // @grant GM_getValue // @grant GM_setValue // @grant GM_xmlhttpRequest // @grant GM_openInTab // @grant GM_registerMenuCommand // @grant GM_setClipboard // ==/UserScript== 'use strict'; var d = document, wn = window, _ = {}, cfg = loadCfg(), imgtab = d.images.length == 1 && d.images[0].parentNode == d.body, enabled = cfg.imgtab || !imgtab, hosts; function loadCfg() { return fixCfg(GM_getValue('cfg'), true); }自定义
wp code highlight支持主题自定义,有5种主题,其实就是亮色和暗色而已,插件按钮和行号支持。
我个人觉得吧,还是默认的亮色主题不错相关链接
直接在后台搜索wp-code-highlight安装即可
下载地址:-- 完 --
博主您好,用了这个代码插件却发现在文章中插入的代码中的<将自动变成<, 😥 😥
@小飞 嗯,原因你已经知道了吧
不能换行是硬伤,不知道markdown写的html代码能换行不?
@FF观光团团员 这个插件吗?因为是追求简单采用这个的,如果想用强大的,Crayon Syntax Highlighter这个很强大,如果不想用插件的话,prismjs也很好,MD我不怎么用,换行不是
这个吗?