gitbook icon indicating copy to clipboard operation
gitbook copied to clipboard

Add support for front matter and back matter

Open orelby opened this issue 12 years ago • 0 comments

I don't think I need to explain why we need this feature.

Implementation 1

Change the format of SUMMARY.md - divide it to sections:

# Book Content

## Front Matter

* Preface
* Acknowledgments

## Main Matter

* Chapter 1
* Chapter 2

## Back Matter

* Index
* Appendix A
* Appendix B

Backward compatibility shouldn't be complicated to preserve: if there aren't sub-headings, just parse the list.

gitbook-plugin-multipart (which I didn't know existed until now) will need to be updated. In my opinion it is a basic feature that should be included in the Gitbook source.

Implementation 2

Like the suggestion above, put the three sections in 3 different files. (There is no need to worry about backward compatibility, but it might be verbose .)

README.md

With this feature, I don't see a need for README.md anymore (at least not for a one that's included automatically as an introduction). So maybe add a book.json config option with something like prependWithReadme (defaults to true for backward compatibility) for a month or two.

It would also solve issue #392.

orelby avatar Aug 04 '14 14:08 orelby