SUMMARY.md 摘要文件

mdBook 使用摘要文件来了解要包含的章节、它们应以何种顺序显示、其层次结构是什么以及源文件的位置。没有这个summary.md摘要文件,就没有书。

这个命名为SUMMARY.md 格式为markdown的文件。其格式有要求 非常严格,必须遵循下面概述的结构,以便 解析。未指定的任何元素,无论是格式还是文本,都可能 被忽略,或者在尝试构建书籍时可能导致错误。

Structure 结构

  1. Title - 虽然是可选的,但通常的做法是从标题开始,通常是# Summary. 但是,解析器会忽略这一点,并且 可以省略。

    # Summary
    
  2. Prefix Chapter - 前缀章节。在主要编号章节之前,可以添加前缀章节,这些是不会被编号。这对前言、简介等很有用。当然也存在一些制约因素。前缀章节不能是 嵌套;它们都应该在根级别上。并且您无法在 添加编号章节后添加前缀章节。

    [A Prefix Chapter](relative/path/to/markdown.md)
    
    - [First Chapter](relative/path/to/markdown2.md)
    
  3. Part Title - 分割标题。Headers can be used as a title for the following numbered chapters. This can be used to logically separate different sections of the book. The title is rendered as unclickable text. Titles are optional, and the numbered chapters can be broken into as many parts as desired.在一组编号的章节上面可以添加标题作为逻辑分割标题。标题呈现为不可点击的文本。 标题是可选的,编号的章节可以分成尽可能多的章节。

    # My Part Title
    
    - [First Chapter](relative/path/to/markdown.md)
    
  4. Numbered Chapter - 编号章节概述了本书的主要内容 并且可以嵌套,从而产生一个很好的层次结构 (章节、子章节等)。

    # Title of Part
    
    - [First Chapter](relative/path/to/markdown.md)
    - [Second Chapter](relative/path/to/markdown2.md)
       - [Sub Chapter](relative/path/to/markdown3.md)
    
    # Title of Another Part
    
    - [Another Chapter](relative/path/to/markdown4.md)
    

    编号的章节可以用-*表示(不要混合分隔符)。

  5. Suffix Chapter - 后缀章节.与前缀章节一样,后缀章节未编号,但它们位于后面 编号的章节。

    - [Last Chapter](relative/path/to/markdown.md)
    
    [Title of Suffix Chapter](relative/path/to/markdown2.md)
    
  6. Draft chapters - 草稿章节是没有文件,因此没有内容的章节。 章节草案的目的是表明未来的章节仍有待编写。 或者,当仍然布置书籍的结构以避免创建文件时 而你仍然在改变这本书的结构。 草稿章节将在 HTML 呈现器中呈现为表格中的禁用链接 的内容,如您在左侧目录中的下一章中看到的那样。 草稿章节的编写方式与普通章节类似,但未写入文件的路径。

    - [Draft Chapter]()
    
  7. Separators - 可以在任何其他元素之前、之间和之后添加分隔符。他们的结果 在构建的目录中的 HTML 呈现行中。 分隔符是 一行仅包含破折号和至少三个破折号:---

    # My Part Title
    
    [A Prefix Chapter](relative/path/to/markdown.md)
    
    ---
    
    - [First Chapter](relative/path/to/markdown2.md)
    

Example 例子

以下是本指南的SUMMARY.md的markdown 源码,左侧的栏位显示的内容就是设置的结果。

# Summary

[简介](README.md)

# 使用指南

- [安装](guide/installation.md)
- [阅读mdBook生成的图书](guide/reading.md)
- [通过mdBook制作图书](guide/creating.md)

# 参考指南

- [命令行工具](cli/README.md)
    - [init](cli/init.md)
    - [build](cli/build.md)
    - [watch](cli/watch.md)
    - [serve](cli/serve.md)
    - [test](cli/test.md)
    - [clean](cli/clean.md)
    - [completions](cli/completions.md)
- [Format](format/README.md)
    - [SUMMARY.md](format/summary.md)
        - [Draft chapter]()
    - [配置](format/configuration/README.md)
        - [General](format/configuration/general.md)
        - [Preprocessors](format/configuration/preprocessors.md)
        - [Renderers](format/configuration/renderers.md)
        - [Environment Variables](format/configuration/environment-variables.md)
    - [Theme](format/theme/README.md)
        - [index.hbs](format/theme/index-hbs.md)
        - [Syntax highlighting](format/theme/syntax-highlighting.md)
        - [Editor](format/theme/editor.md)
    - [MathJax Support](format/mathjax.md)
    - [mdBook-specific features](format/mdbook.md)
    - [Markdown](format/markdown.md)
- [持续集成](continuous-integration.md)
- [For Developers](for_developers/README.md)
    - [Preprocessors](for_developers/preprocessors.md)
    - [Alternative Backends](for_developers/backends.md)

-----------

[Contributors](misc/contributors.md)