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

gitbook-edit plugin ignores book.json root configuration element #25

Open
mauroservienti opened this issue Feb 24, 2017 · 10 comments
Open
Assignees

Comments

@mauroservienti
Copy link

We use GitBook for our doco. We'd love to use the gitbook-edit plugin, however we have a custom book.json where we re-define the GitBook root directory.

The root configuration element is ignored by the gitbook-edit plugin when building the GitHub edit path.

Note: I raised the issue here because in the official repo issues are disabled.

@aleen42
Copy link
Owner

aleen42 commented Feb 24, 2017

@mauroservienti root is not an defined property for using in this plugin, and what it can be set is only repo and branch:

  • repo is used to figure out the repository responding to your book
  • branch is used to figure out which branch or your given repository

For example, if the repo is given "aleen42/PersonalWiki", and the branch is given "master", then edit button will be set as "https://github.com/aleen42/personalwiki/edit/master/README.md", in which README.md is a relative path read by calling a specific API of Gitbook.

@aleen42 aleen42 self-assigned this Feb 24, 2017
@aleen42
Copy link
Owner

aleen42 commented Feb 24, 2017

Anyway, thanks for your issue firstly, and the project of gitbook-edit is not able to be issued because it's forked from another project.

@mauroservienti
Copy link
Author

root is a standard GitBook property that allows files to be stored in a sub-folder. Isn't there an option to support it when building the path to the GitHub file?

@aleen42
Copy link
Owner

aleen42 commented Feb 24, 2017

@mauroservienti Actually, I have not even used this property, and can you show me your value of root and tell me how to build the path with this property, or what it really means? Of course, I can provide another option for this building. Of course you can also fork my repo to give out another pull request to support your requirement, man.

@aleen42
Copy link
Owner

aleen42 commented Feb 24, 2017

@mauroservienti Oh, the root property is a feature released in 2015, which allows author to figure out where the root folder of the book is.

@mauroservienti
Copy link
Author

Take a look at our repo: https://github.com/RadicalFx/documentation
In the root there is book.json file that configures GitBook to look for doco source files in the ./docs folder instead of using the repo root folder. Actually your plugin builds the following edit url (using your sample):

https://github.com/aleen42/personalwiki/edit/master/README.md

If the root configuration property is defined it should be

https://github.com/aleen42/personalwiki/edit/master/{root-configuration-value}/README.md

Where {root-configuration-value} should be trimmed removing from start any ./ and from end any /.

@mauroservienti
Copy link
Author

Of course you can also fork my repo to give out another pull request to support your requirement, man.

I have zero node.js knowledge unfortunately 😞

@aleen42
Copy link
Owner

aleen42 commented Feb 24, 2017

@mauroservienti 2333, okay, I will fix it soon or later.

@mauroservienti
Copy link
Author

I had a couple of minutes and decided to give it a try 😄
We use to say: Don't shoot to the pianist 😉

@aleen42
Copy link
Owner

aleen42 commented Feb 24, 2017

@mauroservienti check the version @1.0.8 and rebuild your book with it to test whether it works for your book.

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

No branches or pull requests

2 participants