且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Markdown/Rdiscount中的编号标题可能吗?

更新时间:2023-09-23 13:05:34

是的,请尝试 Pandoc .这对我有用:

Yes, try Pandoc. This works for me:

pandoc --number-sections < test.md > out.html

(来源)

Markdown生成您在原始帖子中提到的编号轮廓,如下所示:

Markdown to produce the numbered outline you mention in the original post looks like this:

# My top-level topic

## My first subtopic

## Another subtopic

### A sub-subtopic

## Another top-level topic

如果您想对子节进行更深入的缩进,则可以使用内联CSS来实现.例如,将其放在上述Markdown源的顶部会使标题缩进:

If you want deeper indenting for sub-sections, you might be able to achieve this with inline CSS. For example, placing this at the top of the above Markdown source indents the headers:

<style type="text/css">
  h2 { margin-left: 10px; }
  h3 { margin-left: 20px; }
</style>

但是说您的标题下有几段文字...我不知道如何将其缩进与上述标题相同的水平.

But say you had paragraphs of text under your headings... I don't know how to indent that to the same level as the above header.

更新2015-10-18 : Markdeep 带有编号的标题(以及许多其他精美功能).也检查一下!

Update 2015-10-18: Markdeep has numbered headings (and many other fancy features). Check that out too!