跳至内容
wiki
用户工具
登录
站点工具
搜索
工具
显示页面
修订记录
导出 PDF
反向链接
最近更改
媒体管理器
网站地图
登录
>
最近更改
媒体管理器
网站地图
您在这里:
start
»
wiki
»
syntax_highlighting
您的足迹:
wiki:syntax_highlighting
本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。
====== Syntax Highlighting ====== DokuWiki includes support for code syntax highlighting as described at the [[wiki:syntax#syntax_highlighting|syntax page]]. Starting with DokuWiki release "Greebo" some additional GeShi options for syntax highlighting are supported: * Enable line numbers * Start line numbers at line **n** * Highlight certain lines extra All options are set by adding some key-value pairs to the standard ''code''-tag syntax. The following examples explain their usage. ===== Examples ===== The following code enables line numbers: <code JavaScript [enable_line_numbers="true"]> var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }(); </code> This is the result: <code JavaScript [enable_line_numbers="true"]> var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }(); </code> The next example additionally highlights one line: <code JavaScript [enable_line_numbers="true",highlight_lines_extra="2"]> var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }(); </code> This is the result: <code JavaScript [enable_line_numbers="true",highlight_lines_extra="2"]> var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }(); </code> You can also highlight multiple lines: <code JavaScript [enable_line_numbers="true",highlight_lines_extra="2,3"]> var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }(); </code> This is the result: <code JavaScript [enable_line_numbers="true",highlight_lines_extra="2,3"]> var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }(); </code> Line numbers can start at any given value: <code C [enable_line_numbers="true", start_line_numbers_at="42"]> void main () { printf ("Hello World!"); exit 0; } </code> This is the result: <code C [enable_line_numbers="true", start_line_numbers_at="42"]> void main () { printf ("Hello World!"); exit 0; } </code>
wiki/syntax_highlighting.txt
· 最后更改: 2023/03/17 10:12 由
127.0.0.1
页面工具
显示页面
修订记录
反向链接
导出 PDF
回到顶部