gitbook icon indicating copy to clipboard operation
gitbook copied to clipboard

Let gitbook process .md files outside of SUMMARY.md

Open achton opened this issue 11 years ago • 26 comments

It seems to me that there is no way to create pages that are not part of the SUMMARY.md?

Ie. from README.md I would like to create a [link to a page](./core-update.md) where core-update.md is not part of the SUMMARY.md.

What happens is that the link itself is altered to link to the corresponding .html output file, but in reality the .md file itself is moved into the output dir, eg:

-rw-rw-r-- 1 aw aw    10 Mar 18 22:58 core-update.md
-rw-rw-r-- 1 aw aw 15016 Mar 18 22:58 faq.html
-rw-rw-r-- 1 aw aw 14862 Mar 18 22:58 git.html
drwxrwxr-x 2 aw aw  4096 Mar 18 22:58 ng
-rw-rw-r-- 1 aw aw 14861 Mar 18 22:58 README.html

How can I create pages that do not appear in the summary?

achton avatar Mar 19 '15 07:03 achton

I do have the same problem. I would probably be able to provide a pull request for that, but I have no idea what the best approach would be? I think simply processing all markdown files is not the ideal solution. Should we configure the additional files in the book.json? Or add something to the summary that is not added to the navigation?

aschempp avatar Jun 22 '15 20:06 aschempp

Would be a useful feature I think. Similar issue here was closed.

jonjack avatar Sep 08 '15 10:09 jonjack

:+1:

ClintH avatar Nov 05 '15 11:11 ClintH

:+1:

solacerg avatar May 12 '16 16:05 solacerg

:+1:

mweststrate avatar May 23 '16 20:05 mweststrate

ouch!

👍

luisherranz avatar Oct 10 '16 21:10 luisherranz

bump .. +1 to this

ekristen avatar Jan 11 '17 14:01 ekristen

+1

jsntn avatar Mar 31 '17 16:03 jsntn

+1 This is a highly requested feature for me

bandantonio avatar Apr 14 '17 14:04 bandantonio

we need this feature too.change the validation rules of summary.md. allow empty dir name

jmmiracle avatar May 09 '17 04:05 jmmiracle

+1 a possible solution could be to at least follow (and process) all links in the book

nilswald avatar May 09 '17 17:05 nilswald

A workaround is to add them to SUMMARY.md and hide them with CSS, but it's kind of ugly:

.summary .chapter[data-path="file.html"] {
  display: none;
}

rafecolton avatar Aug 07 '17 18:08 rafecolton

I see there's a lot of interest here in this issue, can you provide a few user-stories so we can better understand the use case and if it makes sense support it out of the box without any hacks.

AaronO avatar Aug 07 '17 21:08 AaronO

@AaronO Below is our real world case that we cannot implement due to this limitation. Currently we have API-related documentation and we created a step-by-step guide describing how to configure test environment, so people can play around with API requests. We want to just include this guide somewhere in the body as a hyperlink and refer to it from another gitbook page as a source of additional information. This guide is not intended to be listed in SUMMARY as a separate section according to the existing doc structure.

I think there are many other examples when some pages should not be included in SUMMARY, but they should be somewhere in text. By adding some secondary pages in SUMMARY with the only purpose to make them available throughout gitbook (as currently there is no other workaround) can make a real mess in structure and mislead readers.

bandantonio avatar Aug 08 '17 07:08 bandantonio

I think there are many other examples when some pages should not be included in SUMMARY, but they should be somewhere in text. By adding some secondary pages in SUMMARY with the only purpose to make them available throughout gitbook (as currently there is no other workaround) can make a real mess in structure and mislead readers.

@AaronO our use case matches the above sentiment pretty exactly. Being able to exclude pages from the nav while still compiling them helps to balance the length of the side nav with the length of individual pages.

I recently wrote a page where one section under an H2 was about 3 times as long as the other sections on the page. I split it out into its own page so the canonical page flowed better, but that separate page is only relevant in the context of the canonical page from which it was split. So someone might be given direct access to the sub page or might click into it from the canonical, but they would never need to access it from elsewhere in the book. Given that, I didn't want to make the nav any longer than it has to be.

NOTE: There are also use cases for not compiling select pages. For example, if we want to include raw markdown into a different layout such as in https://github.com/rafecolton/presentation-tool. It would be helpful to also retain the ability to not compile certain pages. Probably better to assume all pages need to be compiled and provide an explicit way to leave a page as markdown.

rafecolton avatar Aug 08 '17 12:08 rafecolton

My use-case is that we use gitbook to build our application's help system, and the structure in SUMMARY matches the screen menu hierarchy, so it is easy to find specific help for each screen. Yet I'd like to add articles that describe certain global application concepts, which doesn't fit into any specific screen.

I can add another section to SUMMARY which will contain those articles, not linked to an actual screen, but it would break the clarity of help navigation — I'd rather link to those articles from specific screens that use corresponding concepts.

NPC avatar Aug 08 '17 17:08 NPC

My use case is I'm using Gitbook for documentation of a source code repository, one of the bits of documentation is some Architecture Decision Records. I want to be able to link to them from the top level of the section, but I don't want them in the summary. At the moment, there are only a couple, but over time there could be hundreds which would make the sidebar useless.

thenathanjones avatar Aug 16 '17 07:08 thenathanjones

Same use case for us. Sometimes we want to link to articles which we don't want to be in the summary.

luisherranz avatar Aug 16 '17 08:08 luisherranz

Another use case: you want to use a Gitbook to organise and structure a huge number of files, far more than the summary could easily allow in TOC format. Then each subchapter would ideally have many files which Gitbook would discover and compile.

larsyencken avatar Sep 11 '17 10:09 larsyencken

👍

sbkg0002 avatar Nov 07 '17 14:11 sbkg0002