gitbook icon indicating copy to clipboard operation
gitbook copied to clipboard

Add option to ignore README.md

Open davefp opened this issue 12 years ago • 23 comments

My book doesn't use README.md as the introduction. Instead, it's a guide to contributing, how to build the book, etc..

As such, I don't want it included in the summary at all. As far as I can tell this isn't possible. Adding the file to .bookignore causes the following error:

ENOENT, stat '/Users/david/code/books/webhookbook/_book/index.html'

My preferred solution would be an option entry in book.json called ignoreReadme or something similar that when set to true would simply let me skip adding the README to the summary.

davefp avatar Aug 03 '14 14:08 davefp

I think so too. Including README.md in the book should be configurable. Also its path and file name, and SUMMARY.md's. The last one might not be necessary, but I hate that name. :-)

orelby avatar Aug 04 '14 14:08 orelby

@OrelBeY That's probably a better solution. It could default to looking for README.md but if the path is set to nil in the json then it would just skip the default intro chapter altogether

davefp avatar Aug 04 '14 17:08 davefp

~~If the README.md is the first node of SUMMARY.md, gitbook will use it as the content of index.html.~~ ~~Just set your own node name instead of the default 'Introduction' and use the README.md as the content of the index page.~~

# Summary

* [name_to_instead_of_introduction](README.md)
* [xxx](xxx.md)

codepiano avatar Aug 12 '14 09:08 codepiano

@codepiano Have you read the issue? It's not about changing the README.md's heading, but it's file path, and to be able to choose not to use it at all.

orelby avatar Aug 12 '14 09:08 orelby

@OrelBeY I will try to complete this and send a pr.

codepiano avatar Aug 12 '14 09:08 codepiano

@codepiano Thank you. :-)

orelby avatar Aug 12 '14 09:08 orelby

In my own forked repo,I add config to specify the file name and title to generate introduction instead of README.md.But still need a introduction,it's difficult to totally ignore introduction. And it is not properly to send a pr,because it changes the default behavier,if you really need this feature,you can use 'git cherrypick' to merge the commit into your own repo.

https://github.com/codepiano/gitbook the commit is 5b648acb5ad4ff978c77c2b0b6df0a39d3a67bb8

add this in book.json

    "introduction": {
        "path": "your introduction path",
        "title": "your introduction title"
    }

codepiano avatar Aug 28 '14 06:08 codepiano

+1 to the feature.

gbonanome avatar Jan 14 '15 15:01 gbonanome

+1

petermichaux avatar Jan 15 '15 15:01 petermichaux

Since version 2.0.0, this is fixed by configuration:

{
  "structure": {
    "readme": "OTHER_README.md"
  }
}

SamyPesse avatar Sep 04 '15 15:09 SamyPesse

Gitbook demands the README.md file. I don't want to use it. Why should the editor impose itself on my work?

Abel-Torres avatar May 05 '16 22:05 Abel-Torres

It's not the only place where this happens, it was not easier to use directly GitHub repos for plugins... According to the authors, this is done to make it easier to use by people that know nothing about Node.js and npm, but this way of thinking complicates too much to us advance users and gitbook architecture and development itself. What a shame :-( El 6/5/2016 12:47 AM, "Abel-Torres" [email protected] escribió:

Gitbook demands the README.md file. I don't want to use it. Why should the editor impose itself on my work?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/GitbookIO/gitbook/issues/392#issuecomment-217302094

piranna avatar May 05 '16 22:05 piranna

@Abel-Torres You can use another file than README.md as introduction by modifying the book.json:

{
  "structure": {
    "readme": "OTHER_README.md"
  }
}

The editor should support it, but when opening the book it might try to always open the README.md. We are working on improving the editor to fix this kind of UX issues.

@piranna You can use GitHub repos for plugins now (starting with version 2.6.7, and better support in 3.0.0):

{
    "plugins": ["test@git+https://github.com/You/myGitBookPlugin.git"]
}

SamyPesse avatar May 06 '16 08:05 SamyPesse

@piranna You can use GitHub repos for plugins now (starting with version 2.6.7, and better support in 3.0.0):

{ "plugins": ["test@git+https://github.com/You/myGitBookPlugin.git"] }

Ok, good to know, last time I test it was on previous versions (2.0.x or so). SInce now I'm using 2.6.7 I'm going to give it a try :-)

piranna avatar May 06 '16 08:05 piranna

@piranna If it's not working as expected, it will in version 3.0.0 (A few fixes have been implemented on this: support for SSH urls, etc).

SamyPesse avatar May 06 '16 08:05 SamyPesse

@piranna If it's not working as expected, it will in version 3.0.0 (A few fixes have been implemented on this: support for SSH urls, etc).

Yeah, there's A LOT of features and bug-fixes in 3.0.0 that I need for my thesis, but since the dateline to give a printed copy in secretary is the next friday 13th I don't think I would be able to move to it yet, specially due to plugins support... :-/ I'll try to give latest alpha version a try this weekend, but do you have an extimated date when 3.0.0 final will be released?

piranna avatar May 06 '16 08:05 piranna

@piranna What is the link to your book on GitBook.com ? (I can easily test it with GitBook v3) What plugins are you using?

We still have a few bugs to fix before releasing, and we want to ensure compatibility with the max number of plugins.

SamyPesse avatar May 06 '16 08:05 SamyPesse

@piranna What is the link to your book on GitBook.com ? (I can easily test it with GitBook v3)

https://github.com/piranna/pfc It's a private repo, but I've give you access to it. I'll open it with a CreativeCommons licence when I present the thesis (not more than a months).

What plugins are you using?

anchors, autocover, image-captions, indexes, mermaid and printlinks

Both autocover and mermaid use specific commits due to incompatibilites with newer versions, but they are correctly installed with npm install:

GitbookIO/plugin-autocover#452ba6c JozoVilcek/gitbook-plugin-mermaid#c9b5c82

We still have a few bugs to fix before releasing, and we want to ensure compatibility with the max number of plugins.

Seems image captions is having some issues, don't know others...

piranna avatar May 06 '16 09:05 piranna

@piranna, @SamyPesse: yes, image-captions is broken since 3.0.0-pre.10 due to missing summary.walk function. I don't see any replacement or alternative right now. The plugin works OK in 3.0.0-pre.9, if it helps to compile your thesis.

todvora avatar May 06 '16 09:05 todvora

I don't see any replacement or alternative right now. The plugin works OK in 3.0.0-pre.9, if it helps to compile your thesis.

Running into the same problems, and this is my current workaround.

cycomachead avatar May 06 '16 10:05 cycomachead