Markdown語法測試

xxm_20170414_172112.png
; ModuleID = 'test.c'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
%struct.what = type { i8, i16 }

@.str = private unnamed_addr constant [6 x i8] c"foo()\00", align 1
@e_long = common global i64 0, align 8
@g_double = common global double 0.000000e+00, align 8
@.str.1 = private unnamed_addr constant [7 x i8] c"oooooh\00", align 1
@func_ptr = common global i32 (...)* null, align 8
@.str.2 = private unnamed_addr constant [8 x i8] c"success\00", align 1
@.str.3 = private unnamed_addr constant [9 x i8] c"FizzBuzz\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"Fizz\00", align 1
@.str.5 = private unnamed_addr constant [5 x i8] c"Buzz\00", align 1
@.str.6 = private unnamed_addr constant [4 x i8] c"%zd\00", align 1
@.str.7 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@.str.8 = private unnamed_addr constant [12 x i8] c"%d, %c, %d\0A\00", align 1
@.str.9 = private unnamed_addr constant [11 x i8] c"need args!\00", align 1
@stderr = external global %struct._IO_FILE*, align 8

; Function Attrs: nounwind uwtable
define i32 @foo() #0 {
  %1 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0))
  ret i32 0
}

declare i32 @puts(i8*) #1

; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** %argv) #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i8**, align 8
  %b_char = alloca i8, align 1
  %d_int = alloca i32, align 4
  %cp_char_ptr = alloca i8*, align 8
  %X = alloca %struct.what, align 2
  %i = alloca i64, align 8
  store i32 0, i32* %1, align 4
  store i32 %argc, i32* %2, align 4
  store i8** %argv, i8*** %3, align 8
  %4 = load i8**, i8*** %3, align 8
  %5 = load i32, i32* %2, align 4
  %6 = icmp eq i32 %5, 1
  br i1 %6, label %7, label %11

; <label>:7                                       ; preds = %0
  %8 = getelementptr inbounds %struct.what, %struct.what* %X, i32 0, i32 0
  store i8 1, i8* %8, align 2
  store i8 49, i8* %b_char, align 1
  %9 = getelementptr inbounds %struct.what, %struct.what* %X, i32 0, i32 1
  store i16 128, i16* %9, align 2
  store i32 65536, i32* %d_int, align 4
  store i64 2147483648, i64* @e_long, align 8
  store double 1.000000e+01, double* @g_double, align 8
  store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8** %cp_char_ptr, align 8
  store i32 (...)* bitcast (i32 ()* @foo to i32 (...)*), i32 (...)** @func_ptr, align 8
  %10 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0))
  store i32 10, i32* %1, align 4
  br label %66

; <label>:11                                      ; preds = %0
  %12 = load i32, i32* %2, align 4
  %13 = icmp eq i32 %12, 2
  br i1 %13, label %14, label %63

; <label>:14                                      ; preds = %11
  store i64 0, i64* %i, align 8
  br label %15

; <label>:15                                      ; preds = %43, %14
  %16 = load i64, i64* %i, align 8
  %17 = icmp ult i64 %16, 100
  br i1 %17, label %18, label %46

; <label>:18                                      ; preds = %15
  %19 = load i64, i64* %i, align 8
  %20 = urem i64 %19, 15
  %21 = icmp ne i64 %20, 0
  br i1 %21, label %24, label %22

; <label>:22                                      ; preds = %18
  %23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0))
  br label %41

; <label>:24                                      ; preds = %18
  %25 = load i64, i64* %i, align 8
  %26 = urem i64 %25, 3
  %27 = icmp ne i64 %26, 0
  br i1 %27, label %30, label %28

; <label>:28                                      ; preds = %24
  %29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0))
  br label %40

; <label>:30                                      ; preds = %24
  %31 = load i64, i64* %i, align 8
  %32 = urem i64 %31, 5
  %33 = icmp ne i64 %32, 0
  br i1 %33, label %36, label %34

; <label>:34                                      ; preds = %30
  %35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0))
  br label %39

; <label>:36                                      ; preds = %30
  %37 = load i64, i64* %i, align 8
  %38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i64 %37)
  br label %39

; <label>:39                                      ; preds = %36, %34
  br label %40

; <label>:40                                      ; preds = %39, %28
  br label %41

; <label>:41                                      ; preds = %40, %22
  %42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i32 0, i32 0))
  br label %43

; <label>:43                                      ; preds = %41
  %44 = load i64, i64* %i, align 8
  %45 = add i64 %44, 1
  store i64 %45, i64* %i, align 8
  br label %15

; <label>:46                                      ; preds = %15
  %47 = getelementptr inbounds %struct.what, %struct.what* %X, i32 0, i32 0
  store i8 1, i8* %47, align 2
  store i8 49, i8* %b_char, align 1
  %48 = getelementptr inbounds %struct.what, %struct.what* %X, i32 0, i32 1
  store i16 128, i16* %48, align 2
  store i32 65536, i32* %d_int, align 4
  store i64 2147483648, i64* @e_long, align 8
  store double 1.000000e+01, double* @g_double, align 8
  store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8** %cp_char_ptr, align 8
  store i32 (...)* bitcast (i32 ()* @foo to i32 (...)*), i32 (...)** @func_ptr, align 8
  %49 = getelementptr inbounds %struct.what, %struct.what* %X, i32 0, i32 0
  %50 = load i8, i8* %49, align 2
  %51 = trunc i8 %50 to i1
  %52 = zext i1 %51 to i32
  %53 = load i8, i8* %b_char, align 1
  %54 = sext i8 %53 to i32
  %55 = getelementptr inbounds %struct.what, %struct.what* %X, i32 0, i32 1
  %56 = load i16, i16* %55, align 2
  %57 = sext i16 %56 to i32
  %58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i32 0, i32 0), i32 %52, i32 %54, i32 %57)
  %59 = getelementptr inbounds %struct.what, %struct.what* %X, i32 0, i32 0
  %60 = load i8, i8* %59, align 2
  %61 = trunc i8 %60 to i1
  %62 = zext i1 %61 to i32
  store i32 %62, i32* %1, align 4
  br label %66

; <label>:63                                      ; preds = %11
  %64 = load %struct._IO_FILE*, %struct._IO_FILE** @stderr, align 8
  %65 = call i32 @fputs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i32 0, i32 0), %struct._IO_FILE* %64)
  store i32 -1, i32* %1, align 4
  br label %66

; <label>:66                                      ; preds = %63, %46, %7
  %67 = load i32, i32* %1, align 4
  ret i32 %67
}

declare i32 @printf(i8*, ...) #1

declare i32 @fputs(i8*, %struct._IO_FILE*) #1

attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }

!llvm.ident = !{!0}

!0 = !{!"clang version 3.8.0 (tags/RELEASE_380/final)"}

歡迎使用Markdown編輯器寫博客

本Markdown編輯器使用StackEdit修改而來,用它寫博客,將會帶來全新的體驗哦:

  • Markdown和擴展Markdown簡潔的語法
  • 代碼塊高亮
  • 圖片鏈接和圖片上傳
  • LaTex數學公式
  • UML序列圖和流程圖
  • 離線寫博客
  • 導入導出Markdown文件
  • 豐富的快捷鍵

快捷鍵

  • 加粗 Ctrl + B
  • 斜體 Ctrl + I
  • 引用 Ctrl + Q
  • 插入鏈接 Ctrl + L
  • 插入代碼 Ctrl + K
  • 插入圖片 Ctrl + G
  • 提升標題 Ctrl + H
  • 有序列表 Ctrl + O
  • 無序列表 Ctrl + U
  • 橫線 Ctrl + R
  • 撤銷 Ctrl + Z
  • 重做 Ctrl + Y

Markdown及擴展

Markdown 是一種輕量級標記語言,它允許人們使用易讀易寫的純文本格式編寫文檔,然后轉換成格式豐富的HTML頁面。 —— <a target="_blank"> [ 維基百科 ]

使用簡單的符號標識不同的標題,將某些文字標記為粗體或者斜體,創建一個鏈接等,詳細語法參考幫助?。

本編輯器支持 Markdown Extra ,  擴展了很多好用的功能。具體請參考Github.

表格

Markdown Extra 表格語法:

項目 價格
Computer $1600
Phone $12
Pipe $1

可以使用冒號來定義對齊方式:

項目 價格 數量
Computer 1600 元 5
Phone 12 元 12
Pipe 1 元 234

定義列表

  • 這里是1
  • 這里是2
  • 這里是3
  1. 這里是1
  2. 這里是2
  3. 這里是3

Markdown Extra 定義列表語法:
項目1
項目2
: 定義 A
: 定義 B

項目3
: 定義 C

: 定義 D

> 定義D內容

代碼塊

代碼塊語法遵循標準markdown代碼,例如:

@requires_authorization
def somefunc(param1='', param2=0):
    '''A docstring'''
    if param1 > param2: # interesting
        print 'Greater'
    return (param2 - param1 + 1) or None
class SomeClass:
    pass
>>> message = '''interpreter
... prompt'''

腳注

生成一個腳注[1].

目錄

[TOC]來生成目錄:

[TOC]

數學公式

使用MathJax渲染LaTex 數學公式,詳見math.stackexchange.com.

  • 行內公式,數學公式為:$\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N$。
  • 塊級公式:

$$ x = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$

更多LaTex語法請參考 這兒.

UML 圖:

可以渲染序列圖:

張三->李四: 嘿,小四兒, 寫博客了沒?
Note right of 李四: 李四愣了一下,說:
李四-->張三: 忙得吐血,哪有時間寫。

或者流程圖:

st=>start: 開始
e=>end: 結束
op=>operation: 我的操作
cond=>condition: 確認?

st->op->cond
cond(yes)->e
cond(no)->op
  • 關于 序列圖 語法,參考 這兒,
  • 關于 流程圖 語法,參考 這兒.

離線寫博客

即使用戶在沒有網絡的情況下,也可以通過本編輯器離線寫博客(直接在曾經使用過的瀏覽器中輸入write.blog.csdn.net/mdeditor即可。Markdown編輯器使用瀏覽器離線存儲將內容保存在本地。

用戶寫博客的過程中,內容實時保存在瀏覽器緩存中,在用戶關閉瀏覽器或者其它異常情況下,內容不會丟失。用戶再次打開瀏覽器時,會顯示上次用戶正在編輯的沒有發表的內容。

博客發表后,本地緩存將被刪除。

用戶可以選擇 <i class="icon-disk"></i> 把正在寫的博客保存到服務器草稿箱,即使換瀏覽器或者清除緩存,內容也不會丟失。

注意:雖然瀏覽器存儲大部分時候都比較可靠,但為了您的數據安全,在聯網后,請務必及時發表或者保存到服務器草稿箱

瀏覽器兼容

  1. 目前,本編輯器對Chrome瀏覽器支持最為完整。建議大家使用較新版本的Chrome。
  2. IE9以下不支持
  3. IE9,10,11存在以下問題
    1. 不支持離線功能
    2. IE9不支持文件導入導出
    3. IE10不支持拖拽文件導入


  1. 這里是 腳注內容. ?

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容