GitbookIO / gitbook

The open source frontend for GitBook doc sites
https://www.gitbook.com
GNU General Public License v3.0
27.15k stars 3.87k forks source link

how to specify output folder? #1321

Closed piaomiaoguying closed 7 months ago

piaomiaoguying commented 8 years ago

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

SamyPesse commented 8 years ago

For the build command?

SamyPesse commented 8 years ago

Concerning the plugin splitter, @jpreynat did a PR to adapt it: https://github.com/yoshidax/gitbook-plugin-splitter/pull/5

aaronwest commented 8 years ago

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 } } }

aaronwest commented 8 years ago

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

sjwjames commented 8 years ago

I have met the same problem recently.I just modified my book.json and add "gitbook":"<3.0.0" ,which worked well.

iguyong commented 8 years ago

You can change the following two files:

aaronwest commented 7 years ago

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.

JayKan commented 6 years ago

By default gitbook actually allows you to specify output path. Have you tried running:

$ gitbook build src dest

see reference

tpluscode commented 6 years ago

@JayKan this is not a perfect solution because running gitbook serve would still generate the _book folder.

marcopeg commented 6 years ago

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!

  1. npm init
  2. add your scripts
    • "start" : "gitbook seve . docs"
    • "build" : "gitbook build . docs"
  3. 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.

iplus26 commented 5 years ago

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!

  1. npm init
  2. add your scripts

    • "start" : "gitbook seve . docs"
    • "build" : "gitbook build . docs"
  3. 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.