觅道文档效果示例
站点配置
觅道文档效果示例
删除线、粗体、斜体、上下标 - 觅道文档效果示例
引用文本效果
链接效果
代码块效果
代码块效果
图片和附件
列表效果
表格效果
符号和表情
科学公式
流程图
序列图
思维导图、脑图、mindmap
Echarts图形图表
音视频插入
时间线
觅道文档集成支持iceEditor富文本编辑器
Markdown文本高亮标记
本文档使用 MrDoc 发布
-
+
home page
代码块效果
# 代码块效果 --- ## 代码 Codes 目前在导出的EPUB上,所有代码均不支持高亮显示,默认为黑色。 ### 行内代码 Inline code 语法为: 1. `` `代码内容` `` 效果如下所示: 执行命令:`pip install django` ### 缩进风格 即缩进四个空格,也做为实现类似 `<pre>` 预格式化文本 ( Preformatted Text ) 的功能。 1. `<?php` 2. `echo "Hello world!";` 3. `?>` 预格式化文本: 1. `| First Header | Second Header |` 2. `| ------------- | ------------- |` 3. `| Content Cell | Content Cell |` 4. `| Content Cell | Content Cell |` ### 指定语言代码块 可以使用三个\`符号后接语言的名称,使用特定语言的代码块,如下所示: 1. ` ```python` 2. `import datetime` 4. `print(datetime.date.today())` 5. ` ``` ` 会渲染为如下所示的效果: 1. `import datetime` 3. `print(datetime.date.today())` 如下为JavaScript代码块示例: 1. `function test() {` 2. `console.log("Hello world!");` 3. `}` 5. `(function(){` 6. `var box = function() {` 7. `return box.fn.init();` 8. `};` 9. `box.prototype = box.fn = {` 10. `init : function(){` 11. `console.log('box.init()');` 12. `return this;` 13. `},` 14. `add : function(str) {` 15. `alert("add", str);` 16. `return this;` 17. `},` 18. `remove : function(str) {` 19. `alert("remove", str);` 20. `return this;` 21. `}` 22. `};` 23. `box.fn.init.prototype = box.fn;` 24. `window.box =box;` 25. `})();` 26. `var testBox = box();` 27. `testBox.add("jQuery").remove("jQuery");` 如下为HTML代码块示例: ### HTML 代码 HTML codes 1. `<!DOCTYPE html>` 2. `<html>` 3. `<head>` 4. `<mate charest="utf-8" />` 5. `<meta name="keywords" content="Editor.md, Markdown, Editor" />` 6. `<title>Hello world!</title>` 7. `<style type="text/css">` 8. `body{font-size:14px;color:#444;font-family: "Microsoft Yahei", Tahoma, "Hiragino Sans GB", Arial;background:#fff;}` 9. `ul{list-style: none;}` 10. `img{border:none;vertical-align: middle;}` 11. `</style>` 12. `</head>` 13. `<body>` 14. `<h1 class="text-xxl">Hello world!</h1>` 15. `<p class="text-green">Plain text</p>` 16. `</body>` 17. `</html>`
似最初
May 23, 2021, 12:16 a.m.
转发文档
Collection documents
Last
Next
手机扫码
Copy link
手机扫一扫转发分享
Copy link
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
share
link
type
password
Update password