我想写几行文字。除了每行从第6列开始之外,它们应该正常格式化。例如,我不希望代码块格式规则使这一文本块看起来像代码,因为我将使用其他格式,如粗体面等。如何在Markdown中做到这一点?


当前回答

为了完整起见,更深入的项目列表如下:

嵌套的更深层次: ----在这里留下一个空行 *第一级A项目-前面没有空格的子弹字符 *二级Aa物品- 1格足够 *三级Aaa物品- 5个空格最少 *第二级Ab项目- 4个空格也可能 *第一个B级道具

嵌套的更深层次:

first level A item - no space in front the bullet character second level Aa item - 1 space is enough third level Aaa item - 5 spaces min second level Ab item - 4 spaces possible too first level B item Nested deeper levels: ...Skip a line and indent eight spaces. (as said in the editor-help, just on this page) * first level A item - no space in front the bullet character * second level Aa item - 1 space is enough * third level Aaa item - 5 spaces min * second level Ab item - 4 spaces possible too * first level B item And there could be even more such octets of spaces.

其他回答

markdown的原生功能无法做到这一点。然而markdown允许内联HTML,因此编写

      This will appear with six space characters in front of it

会产生:

这将在它前面显示六个空格字符

如果您可以控制页面上的CSS,还可以使用标记和样式,可以使用内联或CSS规则。

不管怎样,降价并不是作为一个布局的工具,它是为了简化网络写作的过程,所以如果你发现自己扩展了它的功能集来做你需要做的事情,你可能会看看你是否使用了正确的工具。看看格鲁伯的文件:

http://daringfireball.net/projects/markdown/syntax#html

为了完整起见,更深入的项目列表如下:

嵌套的更深层次: ----在这里留下一个空行 *第一级A项目-前面没有空格的子弹字符 *二级Aa物品- 1格足够 *三级Aaa物品- 5个空格最少 *第二级Ab项目- 4个空格也可能 *第一个B级道具

嵌套的更深层次:

first level A item - no space in front the bullet character second level Aa item - 1 space is enough third level Aaa item - 5 spaces min second level Ab item - 4 spaces possible too first level B item Nested deeper levels: ...Skip a line and indent eight spaces. (as said in the editor-help, just on this page) * first level A item - no space in front the bullet character * second level Aa item - 1 space is enough * third level Aaa item - 5 spaces min * second level Ab item - 4 spaces possible too * first level B item And there could be even more such octets of spaces.

一种方法是使用项目符号,它允许您指定多个缩进级别。项目符号用两个空格、星号和另一个空格的倍数插入。

this is a normal line of text
  * this is the first level of bullet points, made up of <space><space>*<space>
    * this is more indented, composed of <space><space><space><space>*<space>

这种方法有一个很大的优点,那就是当您查看原始文本时,它也很有意义。

如果你不想看到项目符号本身,你应该(取决于你在哪里使用markdown)能够为整个标记下来的区域在css中添加li {list-style-type: none;}。

为了回答MengLu和@lifebalance在回应SColvin的回答时提出的问题(我更喜欢它提供的控件的接受答案),似乎你可以在将显示设置为none时只针对列表的父元素,必要时添加一个周围元素。因此,如果我们假设我们在一个目录中这样做,我们可以扩展SColvin的答案:

HTML

<nav class="table-of-contents">
  this is a normal line of text
  * this is the first level of bullet points, made up of <space><space>*<space>
    * this is more indented, composed of <space><space><space><space>*<space>
</nav>

CSS

.table-of-contents ul {
  list-style-type: none;
}

这是一个旧线程,但我认为markdown的blockquotes('> ')将是最好的: