Closed piaomiaoguying closed 7 months ago
For the build command?
Concerning the plugin splitter
, @jpreynat did a PR to adapt it: https://github.com/yoshidax/gitbook-plugin-splitter/pull/5
I'm having this same issue. Before, I could specify the output
folder where Gitbook would generate the static file contents. That doesn't appear to work under v3.0.3, which is what gets installed by default from npm. The automated build/deploy tool I'm using is now failing. I'm investigating to see if I can find where this was changed between 2.6.6 when it worked.
{ "gitbook": ">=2.1.0", "title": "title here", "description": "description here", "output": "website/static", "structure": { "readme": "introduction.md" }, "links": { "sharing": { "google": false, "facebook": false, "twitter": false, "all": false } } }
I have verified this is indeed an issue on the latest version of Gitbook but works fine on versions 2.6.6 and 2.6.7. In a nutshell, the directory specified by output
in book.json
is ignored in the latest version of Gitbook.
Given the book.json
configuration I posted prior, Gitbook places the generated output in the following directory on Linux:
{current-directory}/_book
I have met the same problem recently.I just modified my book.json and add "gitbook":"<3.0.0" ,which worked well.
You can change the following two files:
~/.gitbook/versions/3.2.0/lib/cli/build.js
(it specifies the outputFolder
, at least for the build command)~/.gitbook/versions/3.2.0/lib/contants/configSchema.js
(it validates the json values in book.json
)Just a quick note that I worked around this in my build tool (Wercker) by copying the {current-directory}/_book
(new location of the gitbook build
output to where I originally defined it to be in book.json
.
By default gitbook
actually allows you to specify output
path. Have you tried running:
$ gitbook build src dest
@JayKan this is not a perfect solution because running gitbook serve
would still generate the _book
folder.
Hi guys, I share with you the same problem and I don't like to type gitbook serve . docs
every time I use it, not to mention that I would need to document it for my collaborators too!
I came up with what I believe to be a simple solution that you - if you are a little bit like me - may like a lot: Javascript!
npm init
.gitbookignore
file to ingnore the `package.json``And it's done! Now your gitbook works as any other Javascript project and probably any of your collaborators is already familiar with npm/yarn project management.
You can also improve it further on by installing gitbook locally so that your people don't even need to have it running as a global command and skip over any version conflict.
I have my documentation project here for you to take a look at this structure.
Simple and really GitHub Pages firendly.
Hi guys, I share with you the same problem and I don't like to type
gitbook serve . docs
every time I use it, not to mention that I would need to document it for my collaborators too!I came up with what I believe to be a simple solution that you - if you are a little bit like me - may like a lot: Javascript!
npm init
add your scripts
- "start" : "gitbook seve . docs"
- "build" : "gitbook build . docs"
- fix
.gitbookignore
file to ingnore the `package.json``And it's done! Now your gitbook works as any other Javascript project and probably any of your collaborators is already familiar with npm/yarn project management.
You can also improve it further on by installing gitbook locally so that your people don't even need to have it running as a global command and skip over any version conflict.
I have my documentation project here for you to take a look at this structure.
Simple and really GitHub Pages firendly.
It seems that if we do it this way, gitbook will ignore book.json
config.
gitbook build --config book.json . docs
Thus the line above not working.
there isn't "output" folder anymore? it works well in 2.6.7 but it doesn't work in 3.0.0
the plugin "spliter" doesn't work too