博客園markdown 編輯器
不支持語法
- 腳注
- 復選框
- 流程圖
- TOC
標題
用法
在想要設置為標題的文字前面加#來表示
一個#是一級標題,二個#是二級標題,以此類推。支持六級標題。
注:標准語法一般在#后跟個空格再寫文字
示例
# 這是一級標題
## 這是二級標題
### 這是三級標題
#### 這是四級標題
##### 這是五級標題
###### 這是六級標題
效果
這是一級標題
這是二級標題
這是三級標題
這是四級標題
這是五級標題
這是六級標題
字體
用法
-
加粗
要加粗的文字左右分別用兩個*號包起來 -
斜體
要傾斜的文字左右分別用一個*號包起來 -
斜體加粗
要傾斜和加粗的文字左右分別用三個*號包起來 -
刪除線
要加刪除線的文字左右分別用兩個~~號包起來
示例
**這是加粗的文字**
*這是傾斜的文字*`
***這是斜體加粗的文字***
~~這是加刪除線的文字~~
效果
這是加粗的文字
這是傾斜的文字`
這是斜體加粗的文字
這是加刪除線的文字
引用
用法
在引用的文字前加>即可。引用也可以嵌套,如加兩個>>三個>>>
n個...
貌似可以一直加下去
示例
>這是引用的內容
>>這是引用的內容
>>>這是引用的內容
效果
這是引用的內容
這是引用的內容
這是引用的內容
引用中有加粗和code
備注
為特定運行時指定dotnet publish -r或 dotnet build -r 參數,因為不支持其他運行時環境。
分割線
用法
三個或者三個以上的 - 或者 * 都可以。
示例
---
----
***
*****
效果
圖片
用法

圖片alt就是顯示在圖片下面的文字,相當於對圖片內容的解釋。
圖片title是圖片的標題,當鼠標移到圖片上時顯示的內容。title可加可不加
示例

效果


超鏈接
用法
超鏈接名
title可加可不加
示例
[簡書](http://jianshu.com)
[百度](http://baidu.com)
效果
列表
用法
語法:
無序列表用 - + * 任何一種都可以
示例
- 列表內容
+ 列表內容
* 列表內容
注意:- + * 跟內容之間都要有一個空格
效果
- 列表內容
- 列表內容
- 列表內容
有序列表
1.列表內容
2.列表內容
3.列表內容
注意:序號跟內容之間要有空格
1.列表內容
2.列表內容
3.列表內容
列表嵌套
表格
用法
表頭|表頭|表頭
---|:--:|---:
內容|內容|內容
內容|內容|內容
第二行分割表頭和內容。
- 有一個就行,為了對齊,多加了幾個
文字默認居左
-兩邊加:表示文字居中
-右邊加:表示文字居右
注:原生的語法兩邊都要用 | 包起來。此處省略
效果
| header 1 | header 2 | header 3 | header 4 | header 4 |
|---|---|---|---|---|
| row 1 col 1 | row 1 col 2 | row 1 col 3 | row 1 col 4 | row 1 col 5 |
| row 2 col 1 | row 2 col 2 | row 2 col 3 | row 2 col 4 | row 2 col5 |
對齊
markdown代碼
| Item | Value | Qty |
| :-------- | --------:| :--: |
| Computer | 1600 USD | 5 |
| Phone | 12 USD | 12 |
| Pipe | 1 USD | 234 |
Item左對齊,Value右對齊,Qty居中
| Item | Value | Qty |
|---|---|---|
| Computer | 1600 USD | 5 |
| Phone | 12 USD | 12 |
| Pipe | 1 USD | 234 |
微信小程序API
| 值 | 說明 | 最低版本 |
|---|---|---|
| contact | 打開客服會話,如果用戶在會話中點擊消息卡片后返回小程序,可以從 bindcontact 回調中獲得具體信息具體說明 | 1.1.0 |
| share | 觸發用戶轉發,使用前建議先閱讀使用指引 | 1.2.0 |
| getUserInfo | 獲取用戶信息,可以從bindgetuserinfo回調中獲取到用戶信息 | 1.3.0 |
代碼
用法
單行代碼:代碼之間分別用一個反引號包起來
代碼塊:代碼之間分別用三個反引號包起來,且兩邊的反引號單獨占一行
效果
這里是單行代碼
這里是單行代碼
csharp
/// <summary>
/// 階乘
/// </summary>
public void Factorial()
{
//1*2*3*4*5
Func<int, int> fib = null;
fib = n => (n == 1) ? 1 : fib(n - 1) * n;
var result = fib(5);
result.Dump();
}
[TestMethod]
public void RecursionGetFiles()
{
var recGetFiles =
Functional.Y<string, IEnumerable<string>>
(f => d => Directory.GetFiles(d).Concat(Directory.GetDirectories(d).SelectMany(f)));
foreach (var f in recGetFiles(Directory.GetCurrentDirectory()))
Console.WriteLine(f);
}
/// <summary>
/// 獲取用戶公司基本信息
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpGet("corporate-baseinfo")]
[ProducesResponseType(typeof(UserCorporateBaseInfoModel), 200)]
public IActionResult GetUserCorporateBaseInfo([FromQuery]UserFilterModel model)
{
//返回值
return Ok(ApiResponseModel.Create(_buss.GetUserCorporateBaseInfo(model)));
}
static void SwitchStatement(string[] args)
{
int n = args.Length;
switch (n)
{
case 0:
Console.WriteLine("No arguments");
break;
case 1:
Console.WriteLine("One argument");
break;
default:
Console.WriteLine($"{n} arguments");
break;
}
}
static System.Collections.Generic.IEnumerable<int> Range(int from, int to)
{
for (int i = from; i < to; i++)
{
yield return i;
}
yield break;
}
static void YieldStatement(string[] args)
{
foreach (int i in Range(-10,10))
{
Console.WriteLine(i);
}
}
using System;
class ArrayExample
{
static void Main()
{
int[] a = new int[10];
for (int i = 0; i < a.Length; i++)
{
a[i] = i * i;
}
for (int i = 0; i < a.Length; i++)
{
Console.WriteLine($"a[{i}] = {a[i]}");
}
}
}
JavaScript
<script src="http://cdn.bootcss.com/highlight.js/8.0/highlight.min.js"></script>
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var reg_rewrite = new RegExp("(^|/)" + name + "/([^/]*)(/|$)", "i");
var r = window.location.search.substr(1).match(reg);
var q = window.location.pathname.substr(1).match(reg_rewrite);
if (r != null) {
return unescape(r[2]);
} else if (q != null) {
return unescape(q[2]);
} else {
return null;
}
}
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var reg_rewrite = new RegExp("(^|/)" + name + "/([^/]*)(/|$)", "i");
var r = window.location.search.substr(1).match(reg);
var q = window.location.pathname.substr(1).match(reg_rewrite);
if (r != null) {
return unescape(r[2]);
} else if (q != null) {
return unescape(q[2]);
} else {
return null;
}
}
css
/* 設置滾動條的樣式 */
::-webkit-scrollbar {
width:12px;
}
/* 滾動槽 */
::-webkit-scrollbar-track {
-webkit-box-shadow:inset006pxrgba(0,0,0,0.3);
border-radius:10px;
}
/* 滾動條滑塊 */
::-webkit-scrollbar-thumb {
border-radius:10px;
background:rgba(0,0,0,0.1);
-webkit-box-shadow:inset006pxrgba(0,0,0,0.5);
}
::-webkit-scrollbar-thumb:window-inactive {
background:rgba(255,0,0,0.4);
}
/*我的活動*/
.user-activity {
padding: 0 0.24rem;
}
.user-activity li {
position: relative;
padding-left: 0;
padding-right: 1.07rem;
border-width: 0.02rem;
}
.user-activity li .tag {
display: inline-block;
position: absolute;
right: 0;
top: 0.3rem;
width: 0.9rem;
height: 0.9rem;
background-repeat: no-repeat;
background-size: 100%;
}
.user-activity li .tag.blue {
background-image: url(./images/tag-blue.png);
}
.user-activity li .tag.red {
background-image: url(./images/tag-red.png);
}
.user-activity li .tag.gray {
background-image: url(./images/tag-gray.png);
Json
{
"name": "BeJson",
"url": "http://www.bejson.com",
"page": 88,
"isNonProfit": true,
"address": {
"street": "科技園路.",
"city": "江蘇蘇州",
"country": "中國"
},
"links": [
{
"name": "Google",
"url": "http://www.google.com"
},
{
"name": "Baidu",
"url": "http://www.baidu.com"
},
{
"name": "SoSo",
"url": "http://www.SoSo.com"
}
]
}
Java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
SQL
--給N賦初值為30
declare @n int set @n = 30
; with maco as
(
select top(@n)
plan_handle,
sum(total_worker_time) as total_worker_time ,
sum(execution_count) as execution_count ,
count(1) as sql_count
from sys.dm_exec_query_stats group by plan_handle
order by sum(total_worker_time) desc
)
select t.text ,
a.total_worker_time ,
a.execution_count ,
a.sql_count
from maco a
cross apply sys.dm_exec_sql_text(plan_handle) t
/* 結果格式如下
text total_worker_time execution_count sql_count
-------- ------------------ ----------------- ---------
內容略
*/
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=TestSQLServer;Initial Catalog=MyTestDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<connectionStrings>
<add name="DefaultConnection"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" providerName="System.Data.SqlClient"
xdt:Transform="Replace" xdt:Locator="Match(name)"/>
</connectionStrings>
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>
流程圖(不支持)
st=>start: Start
e=>end
op=>operation: My Operation
cond=>condition: Yes or No?
st->op->cond
cond(yes)->e
cond(no)->op
graph LR
A-->B
sequenceDiagram
A->>B: How are you?
B->>A: Great!
gantt
dateFormat YYYY-MM-DD
section S1
T1: 2014-01-01, 9d
section S2
T2: 2014-01-11, 9d
section S3
T3: 2014-01-02, 9d
以及時序圖:
Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!
復選框(不支持)
使用 - [ ] 和 - [x] 語法可以創建復選框,實現 todo-list 等功能。例如:
- [x] 已完成事項
- [ ] 待辦事項1
- [ ] 待辦事項2
