语言支持
名称 | 关键字 | 调用的js | 说明 |
---|---|---|---|
AppleScript | applescript | shBrushAppleScript.js | |
ActionScript 3.0 | actionscript3 , as3 | shBrushAS3.js | |
Shell | bash , shell | shBrushBash.js | 命令行操作,git操作 |
ColdFusion | coldfusion , cf | shBrushColdFusion.js | |
C | cpp , c | shBrushCpp.js | |
C# | c# , c-sharp , csharp | shBrushCSharp.js | |
CSS | css | shBrushCss.js | |
Delphi | delphi , pascal , pas | shBrushDelphi.js | |
diff&patch | diff patch | shBrushDiff.js | 用代码版本库时,遇到代码冲突,其语法就是这个. |
Erlang | erl , erlang | shBrushErlang.js | |
Groovy | groovy | shBrushGroovy.js | |
Java | java | shBrushJava.js | |
JavaFX | jfx , javafx | shBrushJavaFX.js | |
JavaScript | js , jscript , javascript | shBrushJScript.js | |
Perl | perl , pl , Perl | shBrushPerl.js | |
PHP | php | shBrushPhp.js | |
text | text , plain | shBrushPlain.js | 就是普通文本. |
Python | py , python | shBrushPython.js | |
Ruby | ruby , rails , ror , rb | shBrushRuby.js | |
SASS&SCSS | sass , scss | shBrushSass.js | |
Scala | scala | shBrushScala.js | |
SQL | sql | shBrushSql.js | |
Visual Basic | vb , vbnet | shBrushVb.js | |
XML | xml , xhtml , xslt , html | shBrushXml.js | |
Objective C | objc , obj-c | shBrushObjectiveC.js | |
F# | f# f-sharp , fsharp | shBrushFSharp.js | |
xpp , dynamics-xpp | shBrushDynamics.js | ||
R | r , s , splus | shBrushR.js | |
matlab | matlab | shBrushMatlab.js | |
swift | swift | shBrushSwift.js | |
GO | go , golang | shBrushGo.js |
示例
C语言
```c
#include <stdio.h>
int main()
{
/* 我的第一个 C 程序 */
printf(“Hello, World! \n”);
return 0;
}
```
显示效果
#include <stdio.h>
int main()
{
/* 我的第一个 C 程序 */
printf(“Hello, World! \n”);
return 0;
}
python
```python
#!/usr/bin/python3
print(“Hello, World!”);
```
显示效果
#!/usr/bin/python3
print(“Hello, World!”);
shell
```shell
#!/usr/bin/python3
print(“Hello, World!”);
git push -f origin master ## 这里假设只有一个master分支
```
显示效果
git reflog
git reset --hard Obfafd
JavaScript
```js
if (time<10)
{
document.write(“早上好”);
}
else if (time>=10 && time<16)
{
document.write(“今天好”);
}
else
{
document.write(“晚上好!”);
}
```
显示效果
if (time<10)
{
document.write("<b>早上好</b>");
}
else if (time>=10 && time<16)
{
document.write("<b>今天好</b>");
}
else
{
document.write("<b>晚上好!</b>");
}
CSS
```css
body
{
background-color:#d0e4fe;
}
h1
{
color:orange;
text-align:center;
}
p
{
font-family:“Times New Roman”;
font-size:20px;
}
```
显示效果
body
{
background-color:#d0e4fe;
}
h1
{
color:orange;
text-align:center;
}
p
{
font-family:"Times New Roman";
font-size:20px;
}