本文翻译自:How to link to a named anchor in Multimarkdown?

I have come across a number of mentions of MultiMarkdown's support for internal links / named anchors but I am unable to find a single example of how to actually do it. 我遇到过一些关于MultiMarkdown对内部链接/命名锚点的支持的提及,但我无法找到如何实际执行此操作的单个示例。

So, what is the syntax for denoting the named anchor, and what is the syntax for linking to it the same as linking to any other URLs (only using #foo instead of http://.... )? 那么,表示命名锚的语法是什么,链接到它的语法是什么,与链接到任何其他URL相同(仅使用#foo而不是http://.... )?


#1楼

参考:https://stackoom.com/question/S5mx/如何链接到Multimarkdown中的命名锚点


#2楼

If you have headers in the markdown files, you can directly link them in the file. 如果您在markdown文件中有标题,则可以直接在文件中链接它们。

Markdown Header - Markdown标题 -

## The Header

this will generate an implicit id #the-header (replace internal spaces with hyphens and make lowercase). 这将生成一个隐式id #the-header (用连字符替换内部空格并使其成为小写)。

To navigate to this id, you can create the link like this: 要导航到此ID,您可以创建如下链接:

[Link to Header](#the-header)

This is equivalent to: 这相当于:

<a href="#the-header">Link to Header</a>

Please note the reference's name is a lower-case #header . 请注意,引用的名称是小写的#header


#3楼

The best way to create internal links (related with sections) is create list but instead of link, put #section or #section-title if the header includes spaces. 创建内部链接(与部分相关)的最佳方法是创建列表,但如果标题包含空格,则将#section或#section-title放入链接。

---- MARKDOWN ------------------------ ---- MARKDOWN ------------------------

Go to section
* [Hello](#hello)
* [Hello World](#hello-world)
* [Another section](#new-section)    <-- it's called 'Another section' in this list but refers to 'New section'## Hello
### Hello World
## New section

---- LIST PREVIEW ------------------------ ----列表预览------------------------

Go to section
Hello              <-- [Hello](#hello)                 -- go to `Hello` section
Hello World        <-- [Hello World](#hello world)     -- go to `Hello World` section
Another section    <-- [Another section](#new-section) -- go to `New section`

---- HTML ------------------------ ---- HTML ------------------------

<p>Go to section</p>
<ul>
<li><a href="#hello">Hello</a><br />
</li>
<li><a href="#hello-world">Hello World</a></li>
<li><a href="#new-section">Another section</a> &lt;– it’s called ‘Another section’ in this list but refers to ‘New section’</li>
</ul>
<h2 id="hello">Hello</h2>
<h3 id="hello-world">Hello World</h3>
<h2 id="new-section">New section</h2>

It doesn't matter whether it's h1, h2, h3, etc. header, you always refer to it using just one # . 无论是h1,h2,h3等标头,你总是只用一个#来引用它。
All references in section list should be converted to lowercase text as it is shown in the example above. 部分列表中的所有引用都应转换为小写文本,如上例所示。

Link to section should be lowercase. 链接到部分应该是小写的。 In other way it won't work. 换句话说它不起作用。
This technique works very well for all Markdown variants, also MultiMarkdown. 这种技术适用于所有Markdown变体,也适用于MultiMarkdown。

Currently I'm using the Pandoc to convert documents format. 目前我正在使用Pandoc转换文档格式。 It's much better than MultiMarkdown. 它比MultiMarkdown要好得多。
Test Pandoc here 在这里测试Pandoc


#4楼

I tested Github Flavored Markdown for a while and can summarize with four rules: 我测试了Github Flavored Markdown一段时间,可以总结四个规则:

  1. punctuation marks will be dropped 标点符号将被删除
  2. leading white spaces will be dropped 领先的白色空间将被丢弃
  3. upper case will be converted to lower 大写将转换为更低
  4. spaces between letters will be converted to - 字母之间的空格将转换为-

For example, if your section is named this: 例如,如果您的部分命名为:

## 1.1 Hello World

Create a link to it this way: 以这种方式创建一个链接:

[Link](#11-hello-world)

#5楼

Here is my solution (derived from SaraubhM 's answer) 这是我的解决方案(源自SaraubhM的回答)

**Jump To**: [Hotkeys & Markers](#hotkeys-markers) / [Radii](#radii) / [Route Wizard 2.0](#route-wizard-2-0)

Which gives you: 哪个给你:

Jump To : Hotkeys & Markers / Radii / Route Wizard 2.0 跳转到 :热键和标记/半径/路线向导2.0

Note the changes from 请注意来自的更改 and . . to - and also the loss of the & in the links. -以及链接中&的丢失。


#6楼

In mdcharm it is like this: 在mdcharm中它是这样的:

* [Descripción](#descripcion)
* [Funcionamiento](#funcionamiento)
* [Instalación](#instalacion)
* [Configuración](#configuracion)

### Descripción {#descripcion}
### Funcionamiento {#funcionamiento}
### Instalación {#instalacion}
### Configuración {#configuracion}

如何链接到Multimarkdown中的命名锚点?相关推荐

  1. 使用程序更改链接到PC中的Windows Phone设备的文件目录名

    今天想批量改WP8的SD卡里面的所有txt文件的扩展名为txtk,为了让开卷倒入看本地小说,可我那些中二意淫傻逼起点文有300多个文件,你让我手动全改了不是爆我菊花呢...于是去网上找了各种软件,别说 ...

  2. arm linux 加载.a,如何将libc.a链接到arm-linux中的共享库中使用arm-none-linux-gnueabi-gcc...

    在一个项目中,我的同事创建了一个静态库,例如liba.a,它与app链接. 在liba.a中,他将libc malloc()覆盖为其所有者版本. 我创建了一个共享库libs.so,它也与app链接. ...

  3. html网页中的锚点(命名锚记)的使用介绍

    1.锚点是网页制作中超级链接的一种,又叫命名锚记.命名锚记像一个迅速定位器一样是一种页面内的超级链接,运用相当普遍. 英文名:anchor 使用命名锚记可以在文档中设置标记,这些标记通常放在文档的特定 ...

  4. php分页命名锚记怎么用,网页中的锚点(命名锚记)的使用介绍

    1.锚点是网页制作中超级链接的一种,又叫命名锚记.命名锚记像一个迅速定位器一样是一种页面内的超级链接,运用相当普遍. 英文名:anchor 使用命名锚记可以在文档中设置标记,这些标记通常放在文档的特定 ...

  5. 在提交消息中链接到GitHub上的问题编号

    是否有可能在git commit消息中自动获得指向GitHub问题编号的链接? #1楼 您还可以交叉引用回购: githubuser/repository#xxx xxx是问题编号 #2楼 他们在他们 ...

  6. 将html连接到外部样式表文件,外部样式表文件通过( )标记链接到HTML文件中

    外部样式表文件通过( )标记链接到HTML文件中 更多相关问题 家长在婴儿(),时期开始训练婴儿自己刷牙为宜.A.半岁左右B.10岁左右C.3岁左右D.1岁半左右 在()中,汪家以汪文宣的死亡,婆婆带 ...

  7. html 网页中的锚点(命名锚记)的使用介绍

    html 网页中的锚点(命名锚记)的使用介绍 转自:https://blog.csdn.net/guofengpu/article/details/51578383

  8. Word控件Spire.Doc 【超链接】教程(8):在 C#/VB.NET 中链接到 Word 文档中的书签

    Spire.Doc for .NET是一款专门对 Word 文档进行操作的 .NET 类库.在于帮助开发人员无需安装 Microsoft Word情况下,轻松快捷高效地创建.编辑.转换和打印 Micr ...

  9. html命名锚id name,Html5 锚 的页内跳转, name=abc herf=#abc | 易学教程

    锚点是网页制作中超级链接的一种,又叫命名锚记.命名锚记像一个迅速定位器一样是一种页面内的超级链接,运用相当普遍. 英文名:anchor 使用命名锚记可以在文档中设置标记,这些标记通常放在文档的特定主题 ...

最新文章

  1. dst matlab,DSTcode DST跟踪算法MATLAB代码,复杂环境中仿多目标 实现的单 Other systems 其他 272万源代码下载- www.pudn.com...
  2. Android登录拦截器实现方式(一)
  3. python seaborn安装_Windows下安装pip、matplotlib以及seaborn
  4. volatile与synchronized的区别
  5. python训练数据集_Python-yolov3训练自己的数据集,pytorchyolov3
  6. 左右伸缩_SSFB梳齿型桥梁伸缩缝安装步骤及使用特性
  7. Eclipse报错:java.lang.ClassNotFoundException: ContextLoaderListener
  8. 黑莓桌面管理器4.2_虚拟桌面管理器行业现状调研分析及发展趋势预测报告(2020)...
  9. 新手如何创建Facebook广告账户?
  10. 2018年python工作好找吗-2018年IT行业薪资大揭秘:你拖后腿了吗?
  11. 信息林-青岛分类信息网.net源码
  12. linux需要4k对齐么,linux查看硬盘4K对齐方法
  13. 简易版百度换肤之background属性
  14. Shopee平台很火爆,但是产品价格设置的不合理,努力都是白费的
  15. 基于Python的微信好友男女比例,区域排名,签名情感分析
  16. mysql查询每门课程成绩最好的前两名学生id和姓名
  17. Android 安卓ADB命令远程调试 单个或多个设备调试
  18. 华为手表开发:WATCH 3 Pro(17)传感器订阅指南针
  19. Numpy:数组对象(Ndarray)的属性
  20. Synopsys VCS仿真编译选项

热门文章

  1. 购买课程赠老男孩出版的签名新书啦!
  2. ubuntu 安装配置JDK
  3. 关于C#解决无法解析skinEngine和使用皮肤的问题
  4. 算法一看就懂之「 递归 」
  5. Informatica_(2)第一个例子
  6. fhq-treap模板
  7. java面试题干货126-170
  8. 验证GridControl Gridview 单元格。
  9. C和指针 第五章 习题
  10. Android实现计时与倒计时的几种方法