测试各种代码的markdown支持能力。
C/C++
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
cout << "Hello, world!" << endl;
return 0;
}
Java
public class Hello
{
public static voi main(String argv[])
{
System.out.println("Hello, world.\n");
}
}
PHP
print "Hello, world!\n"
Latex
\documentclass[12pt,a4paper]{article}
\usepackage{fontspec}
\usepackage{indentfirst}
%\usepackage{xeCJK}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
%\setromanfont{STCaiyun}
\setromanfont{Microsoft YaHei}
\begin{document}
\section{咏鹅}
鹅,鹅,鹅,
曲项向天歌,
白毛浮绿水,
红掌拨清波。
\end{document}
CodeHilite extension 风格示例
There are two ways to specify the identifier:
也就是用单独一行:::python
开头
print("The triple-colon syntax will *not* show line numbers.")
To display line numbers, use a path-less shebang instead of colons:
也就是用单独一行#!python
开头
1 | print("The path-less shebang syntax *will* show line numbers.")
|
Java示例
1 2 3 4 5 6 7 | public class Hello
{
public static voi main(String argv[])
{
System.out.println("Hello, world.\n");
}
}
|
cpp示例
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
cout << "Hello, world!" << endl;
return 0;
}
Latex 示例
\documentclass[12pt,a4paper]{article}
\usepackage{fontspec}
\usepackage{indentfirst}
%\usepackage{xeCJK}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
%\setromanfont{STCaiyun}
\setromanfont{Microsoft YaHei}
\begin{document}
\section{咏鹅}
鹅,鹅,鹅,
曲项向天歌,
白毛浮绿水,
红掌拨清波。
\end{document}
comments powered by Disqus