美文网首页
typora的md语法

typora的md语法

作者: 十里肥羊 | 来源:发表于2020-09-14 12:32 被阅读0次

    [toc]

    最快速开始

    • 加粗: Ctrl + B
    • 标题:==直接用#号== Ctrl + H
    • 插入表格:Ctrl + T
    • 插入链接: Ctrl + K 【会智能读取剪贴板数据填到URL】
    • 插入代码: Ctrl + Shift + 反斜杠 【避免中文切换】
    • 多行代码: Ctrl + Shift + K
    • 插入图片:==优先拖拽,截图粘贴== Ctrl + Shift + I
    • 无序列表: Ctrl + Shift + L
    • 撤销: Ctrl + Z
    • 一级标题:快捷键为Crtl + 1,以此类推
    • 切入/切出==源代码模式==:Ctrl + /
    • 侧边栏 CTRL+ Shift+ L
    • 建议平常写作时,使用快捷键,使用快捷键,使用快捷键,语法了解即可。

    快速开始

    符合我的习惯的Typora操作(键盘+鼠标)

    文本

    操作 说明 PURE键盘 键盘+鼠标
    标题 1-6级 ## h2标题 选择范围,Ctrl+1-6
    换行 Shift+回车
    加粗 <b>,实际是<strong> ** Bold ** 选择范围,Ctrl+B
    斜体 <i>,实际是<em> * Italy * 选择范围,Ctrl+I
    灰底 <code>,所谓的行内代码 `括起来 Ctrl+Shift+反引号
    高亮 <mark> ==Highlights== “格式”菜单
    上下标 “格式”菜单
    下划线 <u> <u>underlines</u> Ctrl+U

    超文本

    操作 说明 PURE键盘 键盘+鼠标
    水平线 ---回车
    引用 >空格,进入引用编辑模式;Ctrl+Shift+Q
    表格 Ctrl+T 右键菜单,或从Excel复制粘贴
    有序列表 1.空格,进入有序列表编辑模式
    无序列表 -/+/*空格,进入列表编辑模式
    列表缩进 TabCtrl+]
    列表反缩进 Shift+TabCtrl+[
    任务列表 “段落”菜单
    多行代码 3个反引号+回车,进入代码块编辑模式,或Ctrl+Shift+K
    链接 []() Ctrl+K
    链接2 <i@typora.io>
    图像 ![]() Ctrl+Shift+I 拖拽,复制粘贴
    本地视频 拖拽,需要新增2个属性height和controls[1]
    网络视频 <iframe> 复制粘贴[2]
    其他 <iframe>
    标注/脚注 [^说明1]另起一行,[^说明1]:
    目录 自动生成 [toc]回车
    表情 :smile: :smile:
    <video src="VID_20190629_153804.mp4" height="600" controls="controls"></video>
    
    <iframe src="//player.bilibili.com/player.html?aid=625381177&bvid=BV1Xt4y127zw&cid=185089615&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" height=600> </iframe>
    

    概要

    这篇文章是阅读《Typora官网Markdown参考文档》的笔记

    Typora是基于GFMGitHub Flavored Markdown的语法

    Typora的严格模式(Strict Mode)是采用GFM标准,像高亮都是扩展的

    官方文档在Typora的安装目录下有md格式。除了官方文档外,也推荐看这篇基于-typora-的-markdown-文档编写,它还对比了几种文档图片集成的利弊。

    PANDOC安装与使用

    Hugo 和 Pandoc 对 Markdown 的扩展支持

    块元素(Block Elements

    段、换行(Paragraph and line breaks

    键盘 表示 MD表示 html表示
    回车 回车x2 <p>
    Shift + 回车 换行 回车 回车*

    *查看Typora导出的HTML源代码,换行直接是用回车(\r\n)表示的
    可以直接用HTML标签 <br /><br><br/>表示

    第一行<br />第二行

    标题(Headers

    # H1

    ## H2

    ###### H6

    引用(Blockquotes

    > 引用第一行
    > 引用第二行
    >> 嵌套引用
    

    引用第一行
    引用第二行

    嵌套引用

    列表(Lists

    ### un-ordered list
    * Red          - Red        + Red
    * Green        - Green      + Green
    * Blue         - Blue       + Blue
    
    ### ordered list
    1. Red
    2. Green
    3. Blue
    

    un-ordered list

    • Red
    • Green
    • Blue

    ordered list

    1. Red
    2. Green
    3. Blue

    结束一个列表,敲2次回车即可
    无序列表,除了用-,也可以用 * 或者 + 代替

    任务列表(Task List

    - [ ] a task list item
    - [ ] list syntax required
    - [ ] normal **formatting**, @mentions, #1234 refs
    - [ ] incomplete
    - [x] completed
    
    • a task list item
    • list syntax required
    • normal formatting, @mentions, #1234 refs
    • incomplete
    • completed

    代码块(Code Blocks

    Typora only supports fences in GitHub Flavored Markdown, not the original code block style.

    前后分别用三个反引号括起来,Typora只需输入3个反引号+回车,就会自动进入code block模式

    ​```ruby
    ruby代表语言,也可以不填,填了语言可以高亮语法
    ​```
    

    数学公式(Math Blocks

    用一对$$括起来,目前没有用到,后续了解

    表格(Tables

    手写代码示例:

    | First Header  | Second Header |
    | ------------- | ------------- |
    | Content Cell  | Content Cell  |
    | Content Cell  | Content Cell  |
    

    就用Typora的右键菜单插入以及编辑器就好,好用

    复杂的表格,比如合并列,可以直接插入HTML表格

    脚注(Footnotes

    You can create footnotes like this[^11] and this[^12]. 
    
    [^11]: Here is the **text** of the first ***\*footnote\****.
    [^12]: Here is the **text** of the second ***\*footnote\****.
    

    光标放到脚注上会显示

    You can create footnotes like this[3] and this[4].

    水平线(Horizontal Rules

    ***
    ---
    

    行内元素(Span Elements

    链接(Links

    类型 type example
    标题链接 Inline Links [baidu](http://www.baidu.com)
    锚点 Internal Links [概要](#概要)
    参考链接 Reference Links [title][var_name]
    链接 URL <i@qq.com> <http://abc.com>
    This is [an example][id] reference-style link.
    
    Then, anywhere in the document, you define your link label on a line by itself like this:
    
    [id]: http://example.com/  "Optional Title Here"
    
    如果id为空,表示id与标题同名
    [Google][]
    And then define the link:
    
    [Google]: http://google.com/
    
    

    图像(**Images)

    语法类似链接,比链接多加一个!前缀 [图片上传失败...(image-4cdee2-1600057768277)]

    图像的操作建议:

    • Typora-文件-偏好设置-图像设定
      • 优先使用相对路径
      • 插入图像时...复制到当前文件夹
    • 直接拖拽到Typora,或截图粘贴到Typora(会自动生成以时间为文件名的PNG)

    字体样式(Font Style)

    markdown html
    Emphasis 斜体 *Italy* <em>
    Strong 粗体 **Bold** <strong>
    E+S 斜粗体 ***AAA*** <strong><em>
    Underlines 下划线 <u>Underline</u> <u>
    Code 行内代码 `` <code>
    Strikethrough 删除线 ~~Mistaken~~ <del>
    Highlight 高亮 ==highlight== <mark>
    **double asterisks**
    
    __double underscores__
    
    都是可以的
    

    还有“上标”和“下标”,比较少用到,直接“格式”菜单点选吧


    1. Typora默认的Video高度过高需要限制,虽然Typora会自动显示播放控件,但浏览器不会,需要显式说明

    2. 从网站的“分享”,获得嵌入式代码,同样也需要设置height高度属性

    3. Here is the text of the first *footnote*.

    4. Here is the text of the second *footnote*.

    相关文章

      网友评论

          本文标题:typora的md语法

          本文链接:https://www.haomeiwen.com/subject/ecxzektx.html