个人常用的Markdown语法


前言

初次使用Markdown编辑器,将自己最常用的几个语法记录一下,如有错误或是更方便的使用方式还请指出。

多级标题

一个"#"到六个"#"分别表示一级标题到六级标题

有序列表

"1. ","2. "表示有序列表,英文句点后面的空格不能少

如:

  1. 张三
  2. 李四

无序列表

"* "表示无序列表,"*"后面的空格不能少

如:

  • 无序列表

插入链接

[http://baidu.com](http://baidu.com "百度一下")
[百度一下](http://baidu.com "百度一下")

结果如:

http://baidu.com

百度一下

插入代码

使用4个空格或是1个tab表示代码缩进,一个代码块会一直延续到没有缩进的那一行

效果如下所示:

def login(request):
global CTIME
global CODE CTIME = time.time()
# 获取二维码
response = requests.get(
url='https://login.wx.qq.com/jslogin?appid=wx782c26e4c19acffb&fun=new&lang=zh_CN&_=%s' % CTIME
)
# print(response.text)
CODE = response.text.split('= "')[1][0:-2]
# print(code)
return render(request, 'login.html', {'qcode': CODE})

字体

斜体:两个 * 将斜体文字包裹
如:*斜体*

效果如:斜体

加粗:两边分别用两个*将需要加粗的文字包裹
如:**加粗**

效果如:加粗

文字下划线:Markdown 并无下划线的原生语法,因为会和链接的默认样式产生混淆。可用两种方式解决:
1. 用<u></u>标签包裹
2. 使用span标签和行内css自定义下划线(字体颜色等其他样式也可自定义)
如:
<u>下划线</u>
<span style="border-bottom:2px dashed yellow; color:yellowgreen">下划线</span>

效果如:

下划线

所添加的需要加下划线的行内文字


如果要在文字前后直接插入普通的*,可以使用反斜杠,如:

\*直接使用\*符号

效果如:*直接使用*符号

    反斜杠可以在以下符号前添加    

\   反斜杠
· 反引号
* 星号
_ 底线
{} 花括号
[] 方括号
() 圆括号
# 井号
+ 加号
- 减号
. 英文句点
! 惊叹号

强大的编辑器

  • Windows: MarkdownPad
  • Linux: ReText
  • Mac:Mou

MarkDownPad2的授权密钥

邮箱:

Soar360@live.com

密钥:

GBPduHjWfJU1mZqcPM3BikjYKF6xKhlKIys3i1MU2eJHqWGImDHzWdD6xhMNLGVpbP2M5SN6bnxn2kSE8qHqNY5QaaRxmO3YSMHxlv2EYpjdwLcPwfeTG7kUdnhKE0vVy4RidP6Y2wZ0q74f47fzsZo45JE2hfQBFi2O9Jldjp1mW8HUpTtLA2a5/sQytXJUQl/QKO0jUQY4pa5CCx20sV1ClOTZtAGngSOJtIOFXK599sBr5aIEFyH0K7H4BoNMiiDMnxt1rD8Vb/ikJdhGMMQr0R4B+L3nWU97eaVPTRKfWGDE8/eAgKzpGwrQQoDh+nzX1xoVQ8NAuH+s4UcSeQ==

推荐:

http://wowubuntu.com/markdown/index.html

https://www.cnblogs.com/Jimmy1988/p/7053875.html


MarkDownPad2的自定义目录

<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
//是否显示导航栏
var showNavBar = true;
//是否展开导航栏
var expandNavBar = true;
var currentIndex = 0;
var currentScrollHigh = 0;
var currentContentScrollHigh = 0;
function sleep(numberMillis) {
var now = new Date();
var exitTime = now.getTime() + numberMillis;
while (true) {
now = new Date();
if (now.getTime() > exitTime)
return;
}
} $(window).onbeforeunload = function(){
currentIndex = 0;
} $(window).load(function(){
var h1s = $("body").find("h1");
var h2s = $("body").find("h2");
var h3s = $("body").find("h3");
var h4s = $("body").find("h4");
var h5s = $("body").find("h5");
var h6s = $("body").find("h6"); var headCounts = [h1s.length, h2s.length, h3s.length, h4s.length, h5s.length, h6s.length];
var vH1Tag = null; // 显示的最高层级
var vH2Tag = null; // 显示的最低层级
var sum = 0; for(var i = 0; i < headCounts.length; i++){
if(headCounts[i] > 0){
for( var y = 0; y < headCounts[i]; y++)
sum = sum + 1;
}
}
for(var i = 0; i < headCounts.length; i++){
if(headCounts[i] > 0){
if(vH1Tag == null){
vH1Tag = 'h' + (i + 1);
}else{
vH2Tag = 'h' + (i + 1);
}
}
}
if(vH1Tag == null){
return;
} $("body").prepend('<div class="BlogAnchor">' +
'<span style="color:red;position:absolute;top:-6px;left:0px;cursor:pointer;" onclick="$(\'.BlogAnchor\').hide();">×</span>' +
'<p>' +
'<b id="AnchorContentToggle" title="收起" style="cursor:pointer;">目录▲</b>' +
'</p>' +
'<div class="AnchorContent" id="AnchorContent"> </div>' +
'</div>' ); var vH1Index = 0;
var vH2Index = 0; var vIndexH1 = 0;
var vIndexH2 = 0;
var vIndexH3 = 0;
var vIndexH4 = 0;
var vIndexH5 = 0;
var vIndexH6 = 0;
var headerALL = [];
var headerIDALL = [];
var headerHightALL = [];
$("body").find("h1,h2,h3,h4,h5,h6").each(function(i,item){ var id = '';
var name = '';
var tag = $(item).get(0).tagName.toLowerCase();
var className = '';
// i=0 tag=h1 i=1 tag=h2 i=2 tag=h2 if(tag == "h1"){
id = name = ++vIndexH1;
vIndexH2 = 0;
vIndexH3 = 0;
vIndexH4 = 0;
vIndexH5 = 0;
vIndexH6 = 0;
className = 'item_h1'; //alert("tag ="+ tag +"---- i = "+ i + " name ="+ name +" className= "+ className);
//tag =h1---- i = 0 name =1 className= item_h1
}else if(tag == "h2"){ id = vIndexH1 + '_' + ++vIndexH2;
name = vIndexH1 + '.' + vIndexH2;
className = 'item_h2';
vIndexH3 = 0;
vIndexH4 = 0;
vIndexH5 = 0;
vIndexH6 = 0; }else if(tag == "h3"){
id = vIndexH1 + '_' + vIndexH2+ '_' + ++vIndexH3;
name = vIndexH1 + '.' + vIndexH2+ '.' + +vIndexH3;
className = 'item_h3';
vIndexH4 = 0;
vIndexH5 = 0;
vIndexH6 = 0; } else if(tag == "h4"){
id = vIndexH1 + '_' + vIndexH2+ '_' +vIndexH3 +'_'+ ++vIndexH4 ;
name = vIndexH1 + '.' + vIndexH2+ '.' +vIndexH3 +'.'+ vIndexH4 ;
className = 'item_h4';
vIndexH5 = 0;
vIndexH6 = 0;
} else if(tag == "h5"){
id = vIndexH1 + '_' + vIndexH2+ '_' +vIndexH3 +'_' +vIndexH4+'_'+ ++vIndexH5;
name = vIndexH1 + '.' + vIndexH2+ '.' +vIndexH3 +'.' +vIndexH4+'.'+ vIndexH5;
className = 'item_h5';
vIndexH6 = 0;
} else if(tag == "h6"){
id = vIndexH1 + '_' + vIndexH2+ '_' +vIndexH3 +'_' +vIndexH4+'_' +vIndexH5+'_'+ ++vIndexH6;
name = vIndexH1 + '.' + vIndexH2+ '.' +vIndexH3 +'.' +vIndexH4+'.' +vIndexH5+'.'+ vIndexH6;
className = 'item_h6'; }
if(name.length > 2){ var mFirstName = name.substring(0,2);
while(mFirstName == "0."){
name = name.substring(2,name.length);
mFirstName = name.substring(0,2);
} }
$(item).attr("id","wow"+id+"_index_"+i);
$(item).addClass("wow_head");
var itemHeight = $(item).offset().top
$("#AnchorContent").css('max-height', ($(document).height()) + 'px');
$("#AnchorContent").css('height', ($(window).height()) + 'px');
$("#AnchorContent").css('overflow','auto');
$("#AnchorContent").append('<li><a class="nav_item '+className+' anchor-link" href="#wow'+id+'_index_'+i+'" link="#wow'+id+'" index="'+i+'">'+name+"✶"+$(this).text()+" "+'</a></li>');
var str = "#wow"+id+"_index_"+i;
headerALL.push($(item));
headerIDALL.push(str);
console.log(" i = "+ i +" id =" + id +" itemHeight = "+ itemHeight);
}); // 1
// 1.1
// 1.1.1
// 1.1.1.1
// 1.1.1.1.1
// 1.1.1.1.1.1
$("#AnchorContentToggle").click(function(){
var text = $(this).html();
if(text=="目录▲"){
$(this).html("目录▼");
$(this).attr({"title":"展开"});
}else{
$(this).html("目录▲");
$(this).attr({"title":"收起"});
}
$("#AnchorContent").toggle();
}); $(".anchor-link").click(function(){ //$("html,body").animate({scrollTop: $($(this).attr("link")).offset().top}, 10);
var index = $(this).attr("index");
$(".BlogAnchor li .nav_item.current").removeClass('current');
$(headerNavs[index]).addClass('current');
var scrollTop = $(window).scrollTop(); // 获得将要到达的点离顶距离
currentScrollHigh = scrollTop;
currentContentScrollHigh = headerHightALL[index];
var value = headerTops[index];
currentIndex = value;
console.log("index = "+ index+ " headerTops["+index+"] ="+ value + "scrollTop="+ scrollTop);
}); var headerNavs = $(".BlogAnchor li .nav_item");
var headerTops = [];
var mHeight = 0;
$(".wow_head").each(function(i, n){
var value = $(n).offset().top; headerTops.push($(n).offset().top);
console.log("i = "+ i+ " offset().top ="+ value);
});
headerTops.push($(document).height()); window.onresize = function(){ headerTops = [];
$.each(headerNavs, function(i, n){
$(n).trigger("click");
document.querySelector(headerIDALL[i]).scrollIntoView(true);
//var high = $(n).offset().top;
var scrollTop = $(window).scrollTop();
headerTops.push(scrollTop);
console.log("headerNavs_index="+i +" scrollTop="+scrollTop +" headerTops="+headerTops[i]);
}
);
headerTops.push($(document).height()); //$("#AnchorContent").height($(window).height());
$("#AnchorContent").css('height', ($(window).height()) + 'px');
var xcontentWidth = $("#AnchorContent").width();
var xWidth = $(window).width();
var xlength = xWidth - xcontentWidth;
$("body").css("marginLeft",xcontentWidth+'px');
$("body").css("max-width",xlength); $(headerNavs[currentIndex]).trigger("click");
document.querySelector(headerIDALL[i]).scrollIntoView(true); } $(window).scroll(function(){
var scrollTop = $(window).scrollTop(); // 获得将要到达的点离顶距离 $.each(headerTops, function(i, n){
if( (scrollTop >= (headerTops[i]) && scrollTop < (headerTops[i+1] -1)) ){
console.log("headerTops[i-1]"+headerTops[i-1]+"headerTops[i]"+headerTops[i]+" scrollTop ="+ scrollTop+" headerTops[i+1]= "+headerTops[i+1] +" i ="+i);
$(".BlogAnchor li .nav_item.current").removeClass('current');
$(headerNavs[i]).addClass('current');
currentScrollHigh = scrollTop;
currentContentScrollHigh = headerHightALL[i];
currentIndex = i;
var mxxHeight = $("#AnchorContent").height()
var mscrollTop1 = $("#AnchorContent").scrollTop(); // 当前标签的高度
console.log("zukgit2 currentIndex="+ currentIndex );
console.log("zukgit2 windows.scrollTop="+ scrollTop );
console.log("zukgit2 $(window).height()="+ $(window).height() );
console.log("zukgit2 currentContentScrollHigh="+ currentContentScrollHigh );
console.log("zukgit2 AnchorContent.mscrollTop="+ mscrollTop1 );
console.log("zukgit2 AnchorContent.high="+ mxxHeight );
if((currentContentScrollHigh - mscrollTop1)> ($(window).height()/2)){ //↓ // 如果当前index超出 界面的高度
//var sum = Math.floor(headerHightALL(i) / $(window).height());
var dif = currentContentScrollHigh - mscrollTop1;
$("#AnchorContent").animate({scrollTop: (currentContentScrollHigh)}, 50);
console.log(" i(zukgit3) = "+ i +" currentContentScrollHigh =" + currentContentScrollHigh +" mscrollTop1 = "+ mscrollTop1);
console.log(" $(window).height()="+ $(window).height() ); } else if( ( mscrollTop1 - currentContentScrollHigh )> 0 ){ //↑
$("#AnchorContent").animate({scrollTop: currentContentScrollHigh-($("#AnchorContent").height()/3)}, 50);
console.log(" i(zukgit4) = "+ i +" currentContentScrollHigh =" + currentContentScrollHigh +" mscrollTop1 = "+ mscrollTop1);
console.log(" $(window).height()="+ $(window).height() +" $(#AnchorContent).height()="+mxxHeight);
} return false;
}
}
);
if(scrollTop == 0){
$("#AnchorContent").animate({scrollTop: 0}, 50);
}
if(scrollTop == $(document).height()){
$("#AnchorContent").animate({scrollTop: headerHightALL[headerHightALL.length-1]}, 50);
}
}); $.each(headerNavs, function(i, n){
var high = $(n).offset().top;
headerHightALL.push(high);
console.log("high"+high);
}
); headerTops = [];
$.each(headerNavs, function(i, n){ $(n).trigger("click");
document.querySelector(headerIDALL[i]).scrollIntoView(true); var scrollTop = $(window).scrollTop(); headerTops.push(scrollTop);
console.log("headerNavs_index="+i +" scrollTop="+scrollTop +" headerTops="+headerTops[i]); }
); headerTops.push($(document).height());
$(headerNavs[0]).trigger("click");
document.querySelector(headerIDALL[0]).scrollIntoView(true); var xcontentWidth = $("#AnchorContent").width();
var xWidth = $(window).width();
var xlength = xWidth - xcontentWidth;
$("body").css("marginLeft",xcontentWidth+'px');
$("body").css("max-width",xlength); if(!showNavBar){
$('.BlogAnchor').hide();
}
if(!expandNavBar){
$(this).html("目录▼");
$(this).attr({"title":"展开"});
$("#AnchorContent").hide();
}
}); </script>
<style>
/*导航*/
.BlogAnchor {
//background: #f1f1f1;
background: #ffffff;
//padding: 10px;
line-height: 180%;
position: fixed;
left: 0px; // right: 48px;
top: 0px;
border: 1px solid #aaaaaa;
width: 20%;
height:100%;
}
.BlogAnchor p {
font-size: 18px;
color: #15a230;
margin: 0 0 0.3rem 0;
text-align: right;
}
.BlogAnchor .AnchorContent {
//padding: 5px 0px;
overflow: auto; }
.BlogAnchor li{
text-indent: 0.5rem;
font-size: 14px;
list-style: none;
}
.BlogAnchor li .nav_item{
padding: 3px;
}
.BlogAnchor li .item_h1{
margin-left: 0rem;
}
.BlogAnchor li .item_h2{
margin-left: 2rem;
font-size: 0.8rem;
} .BlogAnchor li .item_h3{
margin-left: 4rem;
font-size: 0.8rem;
} .BlogAnchor li .item_h4{
margin-left: 5rem;
font-size: 0.8rem;
} .BlogAnchor li .item_h5{
margin-left: 6rem;
font-size: 0.8rem;
} .BlogAnchor li .item_h6{
margin-left: 7rem;
font-size: 0.8rem;
} .BlogAnchor li .nav_item.current{
color: white;
background-color: #5cc26f;
}
#AnchorContentToggle {
font-size: 13px;
font-weight: normal;
color: #FFF;
display: inline-block;
line-height: 20px;
background: #5cc26f;
font-style: normal;
padding: 1px 8px;
}
.BlogAnchor a:hover {
color: #5cc26f;
}
.BlogAnchor a {
text-decoration: none;
}
</style>

常用Markdown语法的更多相关文章

  1. 常用markdown语法入门

    入门markdown常用基本语法,简单到让你怀疑人生~~ 不说废话,直接上图(如果图片显示不清晰,建议选中图片右键——在新标签页中打开图片,妥妥的呢!!) (左侧黑色背景为markdown语法,右侧为 ...

  2. 总结Cnblogs支持的常用Markdown语法

    一.什么是Markdown Markdown是一种可以使用普通文本编辑器编写的标记语言, Markdown的语法简洁明了.学习容易,而且功能比纯文本更强,因此有很多人用它写博客.世界上最流行的博客平台 ...

  3. 写博客常用MarkDown语法

    目录 前言 1. 制作目录 2. 命令格式: 3. 超链接 4.上标和下标 5.引用 6.分割线 7.给图片添加图注 参考 前言 ​ 自己记性不是很好,导致每次写MarkDown文本时总是忘了一些重要 ...

  4. 程序员常用markdown语法记忆小结

    0.toc被中括号包围,实现自动提取标题生成目录 [TOC]   1.*的用法 * 一星:黑点 *二星:斜体* 三星:分割线 * * * **四星:粗体**   2.#的用法 # 1级标题 ## 2j ...

  5. 记录下 Markdown 语法

    github上常用markdown语法:Mastering Markdown 目录 0. 目录 1. 锚点 2.标题 3.超链接 3.1.行内式 3.2.自动链接 4.列表 4.1.有序列表 4.2. ...

  6. 转 .md即markdown文件的基本常用编写语法(图文并茂)

    原文链接:.md即markdown文件的基本常用编写语法(图文并茂) 序言: 很久没有写博客了,感觉只要是不写博客,人就很变得很懒,学的知识点感觉还是记不住,渐渐地让我明白,看的越多,懂的越少(你这话 ...

  7. .md 即 markdown 文件的基本常用编写语法

    0. 前言 Markdown 是一种纯文本格式的标记语言.通过简单的标记语法,它可以使普通文本内容具有一定的格式.现在的项目都使用了 git 仓库,再加上远程仓库 github 托管,那就难免要写一些 ...

  8. Markdown语法说明及常用软件推荐(附链接)

    Markdown语法同样支持HTML标签 以下所有字符均为英文字符 标题 标题级别由#决定,一个为一级 样例 # 一级标题 ## 二级标题 ### 三级标题 #### 四级标题 ##### 五级标题 ...

  9. 基于 Cmd MarkDown 的 markdown 语法学习

    首先我要打一个属于干货的广告:CmdMarkDown 是非常好用的markdown编辑器软件,支持全平台,由作业部落出品,分为客户端与WEB端两种使用场景. 本篇博客学习的markdown语法都是基于 ...

随机推荐

  1. surging教学视频资源汇总

    surging是什么 surging 是一个分布式微服务框架,提供高性能RPC远程服务调用,采用Zookeeper.Consul作为surging服务的注册中心,集成了哈希,随机,轮询.压力最小优先作 ...

  2. Python之旅.第四章.模块与包.总结(未完待遇)

    一.模块 模块: 一系列功能的集合体,在python中一个py文件就是一个模块,模块名就是py文件的文件名: 模块的好处: 1.减少重复的代码 2.拿来主义 定义模块: 就是创建一个py文件: 使用模 ...

  3. 微信浏览器的页面在PC端访问

    微信浏览器的页面在PC端访问: 普通的在微信浏览器看的页面如果不在php代码中解析一下,然后复制链接在PC打开就出现无法访问,因为它复制的地址是: https://open.weixin.qq.com ...

  4. SpringCloud的应用发布(二)vmvare+linux,Centos7.0下发布应用

    一.运行环境 1.jdk下载安装 地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html 检查是否有老版本jdk 如 ...

  5. redis入门(03)redis的配置

    一.配置文件 Redis 的配置文件位于 Redis 安装目录下,文件名为 redis.conf.你可以通过 CONFIG 命令查看或设置配置项. 二.查看修改 1.查看配置 1.1.vi redis ...

  6. zuul入门(1)zuul 的概念和原理

    一.zuul是什么 zuul 是netflix开源的一个API Gateway 服务器, 本质上是一个web servlet应用. Zuul 在云平台上提供动态路由,监控,弹性,安全等边缘服务的框架. ...

  7. python入门(9)字符串和编码

    python入门(9)字符串和编码 字符串是一种数据类型,比较特殊的是字符串有一个编码问题. 因为计算机只能处理数字,如果要处理文本,就必须先把文本转换为数字才能处理. 最早的计算机在设计时采用8个比 ...

  8. tomcat 热替换class

    需要在server.xml中做以下配置: 在host节点内加入<Context>标签,reloadable属性设置为true. <Host name="localhost& ...

  9. Python面向对象进阶示例--自定义数据类型

    需求: 基于授权定制自己的列表类型,要求定制的自己的__init__方法, 定制自己的append:只能向列表加入字符串类型的值 定制显示列表中间那个值的属性(提示:property) 其余方法都使用 ...

  10. Spark:spark df插入hive表后小文件数量多,如何合并?

    在做spark开发过程中,时不时的就有可能遇到租户的hive库目录下的文件个数超出了最大限制问题. 一般情况下通过hive的参数设置: val conf = new SparkConf().setAp ...