<!DOCTYPE html>
昨天下載了haroopad,整體感受仍是很好的!可是從昨天開始就一直有個問題,就是代碼高亮的問題,好比我寫下面一段代碼:php
c #include<stdlib.h> #include<stdio.h> int mian() { printf("hello world!"); return 0; } 、、、 </code></pre><p>應該是沒有瑕疵的吧,可是顯示的倒是</p><pre><code class="c" data-origin="<pre><code class="c">#include&lt;stdlib.h&gt; #include&lt;stdio.h&gt; int mian() { printf("hello world!"); return 0; } </code></pre>">#include<stdlib.h> #include<stdio.h> int mian() { printf("hello world!"); return 0; } </code></pre><p>結果很明顯,並無傳說中的高亮顯示出來。<br>so why?</p><hr class="page"><p>苦思冥想不得其解,遂baidu,知道我看到了這篇博客:<br><a href="http://blog.csdn.net/u013553529/article/details/50629055#language_key">Haroopad Markdown 編輯器代碼語法高亮支持</a></p><p style="color:green">看完才知道,C的代碼須要用cpp來標識!</p><p>書寫代碼的規範應是:</p><p>
key
code<br><b style="color:red">PS:規範中的
可用 ~~~ 所有代替
因此如下代碼是不合規範的css
~
key~html
code</p> </blockquote> <p>或者是</p> <blockquote> <p>
key
code
合乎規範的代碼段java
~~~ key
code
~~~node
各支持語言對應key以下:python
language | key |
---|---|
1C | 1c |
ActionScript | actionscript |
Apache | apache |
AppleScript | applescript |
AsciiDoc | asciidoc |
AspectJ | asciidoc |
AutoHotkey | autohotkey |
AVR Assembler | avrasm |
Axapta | axapta |
Bash | bash |
BrainFuck | brainfuck |
Cap’n Proto | capnproto |
Clojure REPL | clojure |
Clojure | clojure |
CMake | cmake |
CoffeeScript | coffeescript |
C++/C | cpp |
C# | cs |
CSS | css |
D | d |
Dart | d |
Delphi | delphi |
Diff | diff |
Django | django |
DOS.bat | dos |
Dust | dust |
Elixir | elixir |
ERB (Embedded Ruby) | erb |
Erlang REPL | erlang-repl |
Erlang | erlang |
FIX | fix |
F# | fsharp |
G-code (ISO 6983) | gcode |
Gherkin | gherkin |
GLSL | glsl |
Go | go |
Gradle | gradle |
Groovy | groovy |
Haml | haml |
Handlebars | handlebars |
Haskell | haskell |
Haxe | haxe |
HTTP | http |
Ini file | ini |
Java | java |
JavaScript | javascript |
JSON | json |
Lasso | lasso |
Less | less |
Lisp | lisp |
LiveCode | livecodeserver |
LiveScript | livescript |
Lua | lua |
Makefile | makefile |
Markdown | markdown |
Mathematica | mathematica |
Matlab | matlab |
MEL (Maya Embedded Language) | mel |
Mercury | mercury |
Mizar | mizar |
Monkey | monkey |
nginx | nginx |
Nimrod | nimrod |
Nix | nix |
NSIS | nsis |
Objective C | objectivec |
OCaml | ocaml |
Oxygene | oxygene |
Parser 3 | parser3 |
Perl | perl |
PHP | php |
PowerShell | powershell |
Processing | processing |
Python’s profiler output | profile |
Protocol Buffers | protobuf |
Puppet | puppet |
Python | python |
Q | q |
R | r |
RenderMan RIB | rib |
Roboconf | roboconf |
RenderMan RSL | rsl |
Ruby | ruby |
Oracle Rules Language | ruleslanguage |
Rust | rust |
Scala | scala |
Scheme | scheme |
Scilab | scilab |
SCSS | scss |
Smali | smali |
SmallTalk | smalltalk |
SML | sml |
SQL | sql |
Stata | stata |
STEP Part 21 (ISO 10303-21) | step21 |
Stylus | stylus |
Swift | swift |
Tcl | tcl |
TeX | tex |
Thrift | thrift |
Twig | twig |
TypeScript | typescript |
Vala | vala |
VB.NET | vbnet |
VBScript in HTML | vbscript-html |
VBScript | vbscript |
Verilog | verilog |
VHDL | vhdl |
Vim Script | vim |
Intel x86 Assembly | x86asm |
XL | xl |
XML, HTML | xml |
詳情參考:HAROOPAD:How to use fenced code blocknginx
注:haroopad官網上的並無給出C語言的key,但精油本人試驗,C++與的key應該是共用的git
C語言代碼實例以下:github
#include<stdlib.h>
#include<stdio.h>
int mian()
{
printf("hello world!\n");
return 0;
}
sql代碼實例:
create table doubi(
no integer constraint doubi_no_nn not null,
name varchar2[30] constraint doubi_name_nn not null
);
and so on
參考網站:
http://pad.haroopress.com/page.html?f=how-to-write-fenced-code-block
http://blog.csdn.net/u013553529/article/details/50629055#支持的語言和縮寫標記