欢迎使用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页面。 —— [ 维基百科 ]
使用简单的符号标识不同的标题,将某些文字标记为粗体或者斜体,创建一个链接等,详细语法参考帮助?。
本编辑器支持 Markdown Extra , 扩展了很多好用的功能。具体请参考Github.
表格
Markdown Extra 表格语法:
项目 | 价格 |
---|---|
Computer | $1600 |
Phone | $12 |
Pipe | $1 |
可以使用冒号来定义对齐方式:
项目 | 价格 | 数量 |
---|---|---|
Computer | 1600 元 | 5 |
Phone | 12 元 | 12 |
Pipe | 1 元 | 234 |
定义列表
-
Markdown Extra 定义列表语法:
项目1
项目2
- 定义 A
- 定义 B 项目3
- 定义 C
-
定义 D
定义D内容
代码块
代码块语法遵循标准markdown代码,例如:
install.packages("jpeg")
install.packages("stringi")
install.packages("reshape2")
install.packages("magick")
library(magick)
library(jpeg)
library(stringi)
library(reshape2)
setwd("/Users/apple/Documents/hhhhh/hhhhh")
#read the original image and transform it in to a matrix involves coordinates and rgb
image.name <- "dumplings.jpg"
hh <- readJPEG(image.name)
dim(hh)
hhh <- hh[c(1:750),c(1:725),]
longhhh <- melt(hhh)
rgbhhh <- reshape(longhhh, timevar='Var3',idvar=c('Var1','Var2'), direction='wide')
#get the cells of composing the image
int1 <- image_read("1111.jpg")
int2 <- image_read("2222.jpg")
int3 <- image_read("3333.jpg")
int4 <- image_read("4444.jpg")
int5 <- image_read("5555.jpg")
int6 <- image_read("6666.jpg")
#block size
block.size <- 25
width <- dim(hhh)[2]/block.size
height <- dim(hhh)[1]/block.size
#get the average level of "gray" in each block
gray <- array(NA,dim=c(height,width))
for(i in 1:(height)){
for(j in 1:(width)){
region <- rgbhhh[which(((i-1)*block.size+1) <= rgbhhh[,1] & rgbhhh[,1] <= i*block.size &
((j-1)*block.size+1) <= rgbhhh[,2] & rgbhhh[,2] <= j*block.size),c(1:5)]
mean.r <- mean(region$value.1)
mean.g <- mean(region$value.2)
mean.b <- mean(region$value.3)
gray[i,j] <- 0.3*mean.r+0.59*mean.g+0.11*mean.b
}
}
#level of gray to integers correspongding to cells
gray2int <- function(x){
if(x <= quantile(gray,1/6)){
return(1)
} else if(x <= quantile(gray,2/6)){
return(2)
} else if(x <= quantile(gray,3/6)){
return(3)
} else if(x <= quantile(gray,4/6)){
return(4)
} else if(x <= quantile(gray,5/6)){
return(5)
} else {
return(6)
}
}
int <- matrix(sapply(gray,gray2int),
nrow = height,ncol = width,byrow = F)
#integers to cells
int2img <- function(x){
if(x == 1){
return(int1)
} else if(x == 2){
return(int2)
} else if(x == 3){
return(int3)
} else if(x == 4){
return(int4)
} else if(x == 5){
return(int5)
} else if(x == 6){
return(int6)
}
}
#compose the image
image <- int1
for (n in 1:(height)) {
temp_row <- int1
for(m in 1:(width)){
temp_row <- c(temp_row,int2img(int[n,m]))
}
temp_row <- temp_row[-1]
newrow <- image_append(image_scale(temp_row, "x100"))
if(n == 1){
image <- newrow
} else {
image <- image_append(c(image,newrow),stack = T) #vertical
}
}
#visualize the image
image_background(image, "white", flatten = TRUE)
脚注
生成一个脚注1.
目录
用 [TOC]
来生成目录:
数学公式
使用MathJax渲染LaTex 数学公式,详见math.stackexchange.com.
- 行内公式,数学公式为: Γ(n)=(n−1)!∀n∈ℕ Γ ( n ) = ( n − 1 ) ! ∀ n ∈ N 。
- 块级公式:
更多LaTex语法请参考 这儿.
UML 图:
可以渲染序列图:
或者流程图:
离线写博客
即使用户在没有网络的情况下,也可以通过本编辑器离线写博客(直接在曾经使用过的浏览器中输入write.blog.csdn.net/mdeditor即可。Markdown编辑器使用浏览器离线存储将内容保存在本地。
用户写博客的过程中,内容实时保存在浏览器缓存中,在用户关闭浏览器或者其它异常情况下,内容不会丢失。用户再次打开浏览器时,会显示上次用户正在编辑的没有发表的内容。
博客发表后,本地缓存将被删除。
用户可以选择 把正在写的博客保存到服务器草稿箱,即使换浏览器或者清除缓存,内容也不会丢失。
注意:虽然浏览器存储大部分时候都比较可靠,但为了您的数据安全,在联网后,请务必及时发表或者保存到服务器草稿箱。
浏览器兼容
- 目前,本编辑器对Chrome浏览器支持最为完整。建议大家使用较新版本的Chrome。
- IE9以下不支持
- IE9,10,11存在以下问题
- 不支持离线功能
- IE9不支持文件导入导出
- IE10不支持拖拽文件导入
- 这里是 脚注 的 内容. ↩