中文
GitHub
Docs
Deployment
User Guide
Example
中文
GitHub
Docs
Example
Guest
Sign in
MrDoc Document Example
Markdown document example
Quote text
Audio and video
Attachment preview
Link effects
Images and attachments
Documentation table of contents
Code block effects
Table effects
List effects
Symbols and emoji
Scientific formulas
Flowchart
Sequence diagram
Strikethrough, bold, italic, superscript and subscript
Markdown text highlighting
Mind map, mind map, mindmap.
ECharts graphs and charts
Timeline
50,000-word ultra-long document
Mermaid diagrams
Markdown test document
Rich text document example
Documentation table of contents
Online spreadsheet document example
This is an online spreadsheet
Online spreadsheet with local Excel import
Mind map document
Hand-drawn diagram documentation
Office documents
OnlyOffice online documents
OnlyOffice online spreadsheet
OnlyOffice Slides
Powered by MrDoc Pro
-
+
home
Code block effects
# Code Block Effects ## Code Currently, in the exported EPUB, all code does not support syntax highlighting and is displayed in black by default. ### Inline code The syntax is: ``` `code content` ``` The effect is as follows: Execute the command: `pip install django` ### Indented style That is, indenting by four spaces, which also serves the function of achieving preformatted text similar to `<pre>` (Preformatted Text). <?php echo "Hello world!"; ?> Preformatted text: | First Header | Second Header | | ------------- | ------------- | | Content Cell | Content Cell | | Content Cell | Content Cell | ### Code block with specified language You can use three \` symbols followed by the language name to use a code block for a specific language, as shown below: ```python import datetime print(datetime.date.today()) ``` It will be rendered as follows: ```python import datetime print(datetime.date.today()) ``` The following is an example of a JavaScript code block: ```javascript function test() { console.log("Hello world!"); } (function(){ var box = function() { return box.fn.init(); }; box.prototype = box.fn = { init : function(){ console.log('box.init()'); return this; }, add : function(str) { alert("add", str); return this; }, remove : function(str) { alert("remove", str); return this; } }; box.fn.init.prototype = box.fn; window.box =box; })(); var testBox = box(); testBox.add("jQuery").remove("jQuery"); ``` The following is an example of an HTML code block: ### HTML codes ```html <!DOCTYPE html> <html> <head> <mate charest="utf-8" /> <meta name="keywords" content="Editor.md, Markdown, Editor" /> <title>Hello world!</title> <style type="text/css"> body{font-size:14px;color:#444;font-family: "Microsoft Yahei", Tahoma, "Hiragino Sans GB", Arial;background:#fff;} ul{list-style: none;} img{border:none;vertical-align: middle;} </style> </head> <body> <h1 class="text-xxl">Hello world!</h1> <p class="text-green">Plain text</p> </body> </html> ``` ```python #矿山救护队福克斯 #受到激发函数肯德基回复 #上空的飞机还是肯德基 上课就恢复了士大夫 ``` ```javascript // 深刻搭街坊还是觉得 // 士大夫看见数量的咖啡机 的反抗精神困境 ```
mrdoc
Sept. 29, 2026, 6:36 p.m.
Forward
Favorites
Last
Next
Scan the QR Code
Copy link
Scan the QR code to share.
Copy link
share
link
type
password
Update password
Validity period
Markdown file
Word document
PDF document (print)