贴代码的同学注意(代码高亮方法)! - 程序设计(Programming)版 - 北大未名BBS

贴代码的同学注意(代码高亮方法)!

[复制链接] 浏览该主题帖

badbear [离线]

大坏熊^_^

4.3维尼熊

发帖数:2493 原创分:2
关注
<ASCIIArt> 置顶 #2

为便于阅读,如果需要贴较长代码请使用:

"<code>

</code>

"

把代码括起来,可以自动高亮显示代码。e.g.:

#include <stdio.h>
int main()
{
int a,b;
printf("Welcome to CPlusPlus!\n");
}


也可指定代码语言:

"<code lang=xxx>

</code>

"    e.g.:

awk '
{
if (NR > 1)
{
print $0;
}
}' file



附:支持语言列表

ada

applescript

asm

awk

bat

bib

bison

caml

c_comment

changelog

c

clike_vardeclaration

clipper

cobol

conf

cpp

csharp

css

c_string

default

desktop

diff

d

erlang

errors

extreme_comment2

extreme_comment3

extreme_comment4

extreme_comment

fixed-fortran

flex

fortran

function

glsl

haskell

haxe

html

java

javascript

key_string

langdef

latex

ldap

log

logtalk

lsm

lua

m4

makefile

manifest

nohilite

number

outlang

oz

pascal

pc

perl

php

postscript

prolog

properties

python

ruby

scala

script_comment

sh

slang

sml

spec

sql

style

symbols

tcl

texinfo

todo

tsql

url

vbscript

xml

xorg

 最后修改于2012-03-17 12:47:04
  • 发表于2012-03-14 08:57:50

请您先 登录 再进行发帖

快捷回帖
标题
建议:≤ 24个字
签名档
发布(Ctrl+回车)

您输入的密码有误,请重新输入