Markdown 文档标题的标记

Markdown 文档标题的标记,markdown,Markdown,是否无法在降价文档中指示文档标题 我已经开始使用Markdown和Sublime文本来准备我的许多个人和业务文档。例如,我经常想要一种类似于Word中标题样式的“顶级”标题。例如: ### Things to Do ### At Home ======= * Mow the cat * Feed the lawn At the Office ============= * Learn Markdown * Use Big-O notation in a clever

是否无法在降价文档中指示文档标题

我已经开始使用Markdown和Sublime文本来准备我的许多个人和业务文档。例如,我经常想要一种类似于Word中标题样式的“顶级”标题。例如:

### Things to Do ###

At Home
=======
*    Mow the cat
*    Feed the lawn

At the Office
=============
*    Learn Markdown
*    Use Big-O notation in a clever way
<header>
Things to Do
============
</header>
<main>
At Home
=======
*    Mow the cat
*    Feed the lawn

At the Office
=============
*    Learn Markdown
*    Use Big-O notation in a clever way
</main>
# Things to Do

## At Home
*    Mow the cat
*    Feed the lawn

## At the Office
### Morning
*    Learn Markdown
*    Use Big-O notation in a clever way
### Afternoon
*    Read e-mails
*    Scrutinize LOLcats
但是Markdown不尊重
########
这一行,我也不知道还有其他选择。有吗


我可以使用标题1样式作为标题,然后使用标题2样式作为其余样式,但是如果我需要更深层的标题嵌套,我很快就会用完深度。毕竟,标题本身根本不是标题。例如,如果Markdown to HTML解析器将标题用于页面
以及页面顶部标题(即单词标题),这将是一件好事

Markdown设计的一个有趣之处是HTML是明确允许的。HTML5添加了语义页面部分,包括和,这可能非常适合您的页面标题

例如:

### Things to Do ###

At Home
=======
*    Mow the cat
*    Feed the lawn

At the Office
=============
*    Learn Markdown
*    Use Big-O notation in a clever way
<header>
Things to Do
============
</header>
<main>
At Home
=======
*    Mow the cat
*    Feed the lawn

At the Office
=============
*    Learn Markdown
*    Use Big-O notation in a clever way
</main>
# Things to Do

## At Home
*    Mow the cat
*    Feed the lawn

## At the Office
### Morning
*    Learn Markdown
*    Use Big-O notation in a clever way
### Afternoon
*    Read e-mails
*    Scrutinize LOLcats
标题元数据 如果使用多重标记,可以在文档顶部添加一些元数据

format: complete
title: This is a title for the web-page
css: http://example.com/main.css

First line of visible text
标题将包含在
部分的

您还可以使用
[%title]
通过引用将其包含在正文中

小标题 将第一行开头的
####
识别为生成
标记的3级标题应该不会有任何问题。我在Markdown/MultiMarkdown的几个实现中使用了它

您可以使用等等来测试它

航向偏移 至少有些标记/多重标记实现允许您为生成的标题指定偏移量,以便生成
,而不是

例如,这将允许您将
Title
[%Title]
作为文档的第一行(在元数据声明之后)

工具书类

如果您特别指的是pandoc markdown,最简单的方法是使用“%”,例如

% Document Title

# Header 1

content

## Header 2

## Header 2

有关pandoc markdown的更多信息,请参阅。

我专门在GitHub上发布的markdown书籍和研究论文,markdown中的HTML标题标记在GitHub上不起作用,因此我使用以下约定:

Document Title
==============

***This is a subtitle***

**Author:** *Me*

# Chapter One: Overview

Do you know the way?

---

# Chapter Two: Foo

Foo is the way...

---
最终看起来像:


文件标题 这是一个副标题

作者:

第一章:概述 你知道路吗


第二章:福 福就是这样


我使用
--
来分隔章节,因为它看起来不错,有助于在文本中找到章节。但是,当降价文档变大时,这确实会出现问题,在这种情况下,每次键入时,降价预览窗口就会开始冻结,因为它会刷新,或者语法开始出错,并且需要很长时间。这就是使用
==
H1标题格式的理由,因为当文档变大时,您需要将其拆分,在这种情况下,最好使用以下格式:

Document Title
==============

***This is a subtitle***

**Author:** *Me*

[<< Previous Chapter](URL) | [Content Table](URL) | [Next Chapter >>](URL)

---

# Chapter Two: Foo

Foo is the way...

---

[<< Previous Chapter](URL) | [Content Table](URL) | [Next Chapter >> ](URL)
文档标题
==============
***这是一个副标题***
**作者:**我*
[>](URL)
---
#第二章:福
福就是这样。。。
---
[>](URL)
这看起来像:


文件标题 这是一个副标题

作者:

|


第二章:福 福就是这样


|



我也放弃了使用Wiki文件名作为标题,因为它不允许使用连字符,这会弄乱我的章节标题,所以我切换到所有以章节索引
01\u chapter\u name.md
02\u chapter\u name-with-hyphens.md
。。。使用
==
H1标题格式,并将我的降价书移动到主存储库中,这样我就可以使用问题驱动开发和GitHub问题和项目,每章有一个项目,这样我就可以记住所有要做的事情并完成积压工作。

如果您不介意使用RStudio,Rmd(rmarkdown)文件使用顶部的元数据部分生成标题,然后使用
#+
作为标题

链接


    • 我想发布一个暴力一次性解决方案:

      <font size="+12"><center>
          Things to Do
      </font></center>
      
      
      要做的事情
      

      确实有一种更复杂的方法可以做到这一点,但我发现,因为每个文档都使用一次,所以它并没有那么糟糕。

      #######要做的事情应该得到尊重,但由于#的三次重复,你会得到一个三级标题,这显然不适合你的目标。@RyanPrior True。我试图想出一个似乎“非常粗体”的符号,但与现有语法相冲突。这就是我不喜欢Atx风格的原因之一:不太重要的东西会变得更大胆。许多降价到foo的渲染器都是可扩展的。您可以考虑将规则添加到由不同字符重复的粗大文本中。也许是^^^^^^s?Atx样式标题的问题是,例如pandoc中的标题编号受顶层标题的影响,因此所有内容都显示在第1节下(即仅1.x、1.x.x,无第2节)。谢谢!有没有办法防止标题在文档正文中重复?在
      pandoc
      编译过程中,我看到了一些关于
      -T
      选项的信息,但是手册没有真正意义。每次编译时都要记住键入一些额外的选项/参数值(而不是将其存储在文档中),这很烦人。您可以在命令行上设置标题元数据:
      --metadata=title:“document title”
      @MichaelChirico,在文档中设置标题的任何方法(不是
      -T
      ,不是
      --metadata title=“烦人的”
      ),在pandoc 2.11中?这对其他人来说是一个很好的指南!这是一个旧的指南-但仅供参考-HTML