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

Don't set main README.md file as 'introduction' on the index #476

Closed
piranna opened this issue Oct 13, 2014 · 16 comments
Closed

Don't set main README.md file as 'introduction' on the index #476

piranna opened this issue Oct 13, 2014 · 16 comments

Comments

@piranna
Copy link

piranna commented Oct 13, 2014

README.md is added automatically, that not something so bad, but it's also added on the index as an introduction, that maybe it's not what you want, for example when using it to show info about how to generate the book. In my case (a degree thesis) I have a separate introduction chapter, so having it twice on the index looks ugly.

@SamyPesse
Copy link
Member

I agree that there should be a way to use another file than README as introduction to the book.

@piranna
Copy link
Author

piranna commented Oct 14, 2014

Problem is mostly with the fact that's being used as the first page, where it should be the cover (that's not being used when generating a PDF or a HTML site, by the way). I think that the first entry point on the PDF index (the first "chapter") should point to the first page (the cover or the readme, both are ok) but instead of being called "introduction" it should be called with the book title. I think this was working some weeks before, and in fact it was being showed as "chapter 0"...

@codepiano
Copy link

In my forked repo,I add another choice to specify it in the config file like this

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

If there is a introduction attribute in config.json,use it as first page,the SUMMARY.md only specify the chapter files.
else use the default behavior.

@piranna
Copy link
Author

piranna commented Oct 17, 2014

@codepiano does it allow to only define the introduction title, or it's necesary to define the path too?

@piranna
Copy link
Author

piranna commented Oct 17, 2014

Ok, I've searched a bit and found the source of the problem. As you can see, when parsing the summary, it looks for the first entry and if it's not a link to the book main README.md file, it add one with a hardcoded 'Introduction' name, that's not only a very few flexible mechanism (it force to use the README.md as the first page, while you wouldn't want to use it at all) but also a problem for non-english books.

I think that by the moment the only workaround is to define explicitly a link on top of SUMMARY.md pointing to README.md but using a custom title, but this should be fixed. @codeplano seems a good solution, would you be able to do a pull-request?

@piranna
Copy link
Author

piranna commented Oct 17, 2014

Oh, and of course, the hardcoded default 'Introduction' string should be localized to the book language... :-D

@codepiano
Copy link

@piranna
you can change the 'introduce' in summary file

# Summary

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

it is necessary to define the path,but the official gitbook don't support this,I fork to my own repo and change the behavior

@piranna
Copy link
Author

piranna commented Oct 17, 2014

Yes @codepiano, that was the workaround that I said :-P

@codepiano
Copy link

@piranna I will try to send a pr,but I'm not quite sure it will be merged.

@petermichaux
Copy link

I don't understand why the README.md file is required and why it is automatically included as the first item in the Table of Contents with the string "Introduction". I think it would be better that the README.md file is not included by default. It is very easy for authors to include it in the SUMMARY.md file if they want the README.md file included in some way. Much more flexible too.

@piranna
Copy link
Author

piranna commented Jan 8, 2015

+1 to @petermichaux

@gbonanome
Copy link

+1 to this feature, maybe an option inside book.json

@CristianCantoro
Copy link

See also #392.

This was referenced Jan 18, 2015
@piranna
Copy link
Author

piranna commented Mar 7, 2015

I've found this problem also affect the Glossary, being it shown in english while the other entries of my table of contents are in spanish...

@SamyPesse
Copy link
Member

Just add "language": "es" to your book.json file.

@piranna
Copy link
Author

piranna commented Mar 7, 2015

Oh, great, thank you! :-)

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

6 participants