Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to ignore README.md #392

Closed
davefp opened this issue Aug 3, 2014 · 23 comments
Closed

Add option to ignore README.md #392

davefp opened this issue Aug 3, 2014 · 23 comments

Comments

@davefp
Copy link

davefp commented Aug 3, 2014

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.

@orelby
Copy link

orelby commented Aug 4, 2014

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. :-)

@davefp
Copy link
Author

davefp commented Aug 4, 2014

@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

@codepiano
Copy link

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)

@orelby
Copy link

orelby commented Aug 12, 2014

@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.

@codepiano
Copy link

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

@orelby
Copy link

orelby commented Aug 12, 2014

@codepiano
Thank you. :-)

@codepiano
Copy link

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 5b648ac

add this in book.json

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

@gbonanome
Copy link

+1 to the feature.

@petermichaux
Copy link

+1

@SamyPesse
Copy link
Member

Since version 2.0.0, this is fixed by configuration:

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

@Abel-Torres
Copy link

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

@piranna
Copy link

piranna commented May 5, 2016

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" notifications@github.com 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
#392 (comment)

@SamyPesse
Copy link
Member

@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"]
}

@piranna
Copy link

piranna commented May 6, 2016

@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 :-)

@SamyPesse
Copy link
Member

@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).

@piranna
Copy link

piranna commented May 6, 2016

@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?

@SamyPesse
Copy link
Member

@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.

@piranna
Copy link

piranna commented May 6, 2016

@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...

@todvora
Copy link

todvora commented May 6, 2016

@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.

@cycomachead
Copy link

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.

@SamyPesse
Copy link
Member

@todvora @cycomachead Happy to implement this PAI back in the new version (or implement a cleaner API), the API for plugins since version 3.0.0-pre.10 is correctly separated: https://github.com/GitbookIO/gitbook/blob/master/lib/api/encodeGlobal.js

@todvora What API signature to access the SUMMARY to you think is better? Something to get the whole summary as a tree ? Something equivalent to walk ?

@todvora
Copy link

todvora commented May 6, 2016

@SamyPesse Thanks! I like the walk variant. Currently I need ordered summary, access to page.level, page.content (html or at least raw content) and page.ref to be able to build images registry with backlinks to figures on different pages. Here is the pre.9 implementation of image-captions plugin's walk callback.

@cycomachead
Copy link

I spent a few hours trying to read through the plugin's code as well as GitBook's. I think the walk method is pretty useful. I might end up using it for another plugin I'm messing with. (I think you could get by with simply accessing book.summary, but that's also deprecated.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants