Giter Club home page Giter Club logo

gitbook's Introduction

GitBook

Docs - Community - Developer Docs - Changelog - Bug reports

Documented on GitBook

Welcome to GitBook, the platform for managing technical knowledge for teams.

This repository contains the open-source code used to render GitBook's published content.

GitBook Open Published Site

Table of Contents

Getting Started

To run a local version of this project, please follow these simple steps.

Prerequisites

  • Node.js (Version: >=18.x)
  • Bun

Set up

  1. Clone the repo into a public GitHub repository. If you plan to distribute the code, keep the source code public to comply with GNU GPLv3. To clone in a private repository, acquire a commercial license.
git clone https://github.com/gitbookIO/gitbook.git
  1. Install the project's dependencies through Bun.
bun install
  1. Start your local development server.
bun dev

Then open the space in your web browser, using http://localhost:3000// (example: http://localhost:3000/docs.gitbook.com).

Other development commands

  • bun format: format the code
  • bun lint: lint the code

CI and testing

All pull-requests will be tested against both visual and performances testing to prevent regressions.

Contributing

GitBook's rendering engine is fully open-source and built on top of Next.js. Head to our contributing guide to learn more about the workflow on adding your first Pull Request.

Types of contributions

We encourage you to contribute to GitBook to help us build the best tool for doucmenting techincal knowledge. If you're looking for some quick ways to contribute, continue reading to learn more about popular contributions.

Translations

The GitBook UI is rendered using a set of translation files found in src/intl/translations. We welcome all additional translations for the UI.

Bugs

Encounter a bug or find an issue you'd like to fix? Helping us fix issues related to GitBook greatly improves the experience for everyone. Head to the issues section of this repository to learn more about the types of bugs you can already help out with.

Deployment

Warning

While it is possible to self-host this project, we do not recommend this unless you are certain this option fits your need.

Looking to add a specific feature in GitBook? Head to our contributing guide to get started.

Self-hosting this project puts the responsibility of maintaining and merging future updates on you. We cannot guarantee support, maintainance, or updates to forked and self-hosted instances of this project.

We want to make it as easy as possible for our community to collaborate and push the future of GitBook, which is why we encourage you to contribute to our product directly instead of creating your own version.

This project allows you to self-host the rendering portion of your GitBook published content. Self-hosting has pros and cons.

On the pro side, you can customize the look and feel of your content, and better embed your documentation in your application.

On the con side, you become responsible for the reliability of your published site, and keeping the renderer up-to-date with the changes made to the GitBook platform.

License

Distributed under the GNU GPLv3 License.

If you plan to distribute the code, you must the source code public to comply with GNU GPLv3. To clone in a private repository, acquire a commercial license.

See LICENSE for more information.

Acknowledgements

GitBook wouldn't be possible without these projects:

Legacy GitBook (Deprecated)

Our previous version of GitBook and it's CLI tool are now deprecated. You can still view the old repository and it's commits on this branch.

gitbook's People

Contributors

addisonschultz avatar amritk avatar brettjephson avatar emmerich avatar gregberge avatar jpreynat avatar marclave avatar samypesse avatar scazan avatar sebastiangraz avatar spastorelli avatar taranvohra avatar valentin0h avatar viktorrenkema avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gitbook's Issues

GitBook 'serve' error

Hi,

When I use the gitbook serve command in the JavaScript example directory, I receive the following error:

Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

C:\Users\psgs\Documents\GitHub\javascript [master]> gitbook serve
Starting build ...
{ [Error: EPERM, symlink 'C:\Users\psgs\Documents\GitHub\javascript\_book\RE
ADME.html']
  errno: 50,
  code: 'EPERM',
  path: 'C:\\Users\\psgs\\Documents\\GitHub\\javascript\\_book\\README.html'
 }
C:\Users\psgs\Documents\GitHub\javascript [master]>

The directory i'm executing gitbook serve in is a fork of the JavaScript GitBook example. I currently haven't edited the example. Would this error be due to an argument i'm missing or perhaps that i'm not using Grunt to execute the serve task?

Thanks,

psgs

Font problem.

There is something wrong with your fonts.

I'm sorry for the bad bug report... I spend most of my time in a terminal. I don't know anything about fonts.

But I took pictures!

From http://www.gitbook.io/ :

fontproblemb

From one of the example books:

fontproblema

I'm using Firefox 28.0 on Windows 7.

Here is some information provided by Firefox Inspector about the font.

fontproblemc

I will gather more information if you tell me how.

Support of Google Fonts

Hello!

It would be GREAT to add support of the Google Fonts. This feature is especially actual for the books written in the non-English languages.

Responsive CSS layout.

Hey,

Cool project! Think I might use this to cover some tutorials.

I just noticed viewing on mobile that if the page has an exercise block that it must be overflowing out of the responsive container as you can horizontally scroll a little. It's just a little thing, but it tends to annoy me a little.

EDIT:: I opened up the laptop quick to take a look resizing the viewport etc. but you are using a fixed layout which then breaks at lower size viewports. This could be an issue for some users that say are looking at a book written in gitbook but have multiple windows open and only have one screen available. For example, imagine you get to a certain point in the book where there is some section that you just want to have open side by side with your IDE but you want your IDE to take up most of the screen real estate. Reducing a page showing gitbook to a smaller viewport breaks the layout and renders the book unusable unless they make the viewport bigger and compromise the IDE real estate. Of course, this is just my two cents but it's certainly a nice to have being able to use gitbook with any viewport size on any device.

@jh3y

Single page architecture

In site mode, as the layout of the book ultimately doesn't change, it would be good if once the site had loaded, proceeding through the pages just involved changing the main content pane, rather than reloading the entire window, which results in an annoying flicker, as well as incorrect animation on going backwards.

Remove reliance on github

At the moment, and apologies if I'm missing, but the build/server commands require me to use a Github repo which is fine. I was thinking, however, what if I have, say, customer sensitive documentation I want to build that is hosted on our local git servers? Am I able to use gitbook for that or is it only intended for Github use?

Cannot create html files

I've downloaded your example

then I use npm install gitbook -g to install gitbook from npm

and then I use gitbook serve, but I can only find *.md files in folder _book\chapter-1. No html file was created. So I got an error in http://localhost:4000/chapter-1/ARTICLE1.html

All these happened in Windows 7, where is my error?

I`d be very grateful for your help.

Defining "globals" for exercises?

Hi,

Is it currently possible to define "globals" for the examples/exercises?

E.g. if I would like to teach someone how to use a library, can I write a library skeleton and load it so that a user could interact with it? The "skeleton" would then return true/false when certain methods are called would allow me to assert whether something has been called correctly.

Cannot create pdf or single html page

Hi, I tried to generate a pdf or a single html page. I get the following error:

$ gitbook build ./runseb.github.io/ -f page
Starting build ...
TypeError: Cannot read property '0' of null
at GitBookRenderer.link (/Users/sebastiengoasguen/Documents/node_modules/gitbook/lib/parse/renderer.js:48:39)
at InlineLexer.outputLink (/Users/sebastiengoasguen/Documents/node_modules/gitbook/node_modules/marked/lib/marked.js:703:21)
at InlineLexer.output (/Users/sebastiengoasguen/Documents/node_modules/gitbook/node_modules/marked/lib/marked.js:618:19)
at Parser.tok (/Users/sebastiengoasguen/Documents/node_modules/gitbook/node_modules/marked/lib/marked.js:1064:50)
at Parser.parse (/Users/sebastiengoasguen/Documents/node_modules/gitbook/node_modules/marked/lib/marked.js:924:17)
at Function.Parser.parse as parser
at render (/Users/sebastiengoasguen/Documents/node_modules/gitbook/lib/parse/page.js:36:19)
at /Users/sebastiengoasguen/Documents/node_modules/gitbook/lib/parse/page.js:83:22
at Array.map (native)
at Object.parsePage as page

Might be me not installing the node packages properly, but I tried several ways...

thanks for looking into it,

-sebastien

Error when running gitbook build

I am getting the following error when I run gitbook build. Any pointers?

Starting build ...
TypeError: Cannot call method 'split' of null
    at /usr/local/lib/node_modules/gitbook/bin/gitbook.js:43:28
    at _fulfilled (/usr/local/lib/node_modules/gitbook/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/gitbook/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/gitbook/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/gitbook/node_modules/q/q.js:557:44
    at flush (/usr/local/lib/node_modules/gitbook/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:415:13)

Windows support?

Following the installation instructions exactly I am able to run gitbook serve and see the first page of the gitbook for Javascript (for example) but selecting a link on the sidebar throws a file not found error (there is no html file created in any of the subdirectories as part of the build). When I convert the README.md file in a subdirectory and navigate to it in the sidebar I get a very plain HTML page without the gitbook styling, sidebar, etc.

Is there an obvious solution to this or should I start troubleshooting?

Great work BTW! Works beautifully on my mac.

Multi-language books

Here is a format proposition for multi-language books:

repository/
    LANGS.md
    en/
        README.md
        SUMMARY.md
        ...
    fr/
        README.md
        SUMMARY.md
        ...

Since gitbook can generate a book from a directory like en or fr, it can detect the LANGS.md file which should follow the format:

* [French](fr/)
* [English](en/)

And generates a book for each language in the _book folder.

Plugin architecture

It would be good if gitbook supported extensions without having to fork the main application source.

For example:

  • Add extra JS/CSS resources without having to create a whole theme
  • app.js trigger a jQuery event on completion of its ready function
  • At build time, hooks for detection and rendering of different "section" types.

These could probably be automatically added in by loading a package.json file and processing the contents?

i18n in templates

Add an option for building the book in a specific language and add default value for this option for multi-languages book.

ebook

Ever thought about adding the possibility to create a real aka. ebook reader capable book (.mobi or .epub) in addition to the html book? Maybe it coud integrate this grunt task: https://github.com/mccormicka/md-book

Allow non-book content in the sidebar

I'd like to have several static pages in the sidebar that aren't linked to the progession of the book. For example: instructions for how to set up a lab, third-party resources to look through, a syllabus, a showcase of work built with the course, etc. None of these pages need the breadcrumbs at the top or green checkmarks next to them.

Cannot fetch gitbook

Hi, I am trying to reinstall gitbook on a fresh ubuntu 12.04 and I get this:

npm install gitbook -g

npm http GET https://registry.npmjs.org/gitbook

npm ERR! Error: failed to fetch from registry: gitbook
npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR! at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR! at Request. (/usr/lib/nodejs/request/main.js:212:58)
npm ERR! at Request.emit (events.js:88:20)
npm ERR! at ClientRequest. (/usr/lib/nodejs/request/main.js:412:12)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.onIncoming (http.js:1261:11)
npm ERR! at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR! http://bugs.debian.org/npm
npm ERR! or use
npm ERR! reportbug --attach /opt/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.2.0-58-generic
npm ERR! command "node" "/usr/bin/npm" "install" "gitbook" "-g"
npm ERR! cwd /opt
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: gitbook
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /opt/npm-debug.log
npm not ok

strange...

Hide sidebar by default on screens < 600px

The navigation fills the entire screen on screens < 600px. This is fine, but the problem is that it's toggled open by default, meaning if I load a gitbook link on a mobile device, the nav is all I'm going to see until I figure out that I have to click the "toggle" button to show the actual page contents.

Allow some Code Exercises to have test fixture code?

I'm trying gitbook out to make a little getting started book for gulp.js

I noticed that code exercises can have test code, but how would I check if the user makes the right gulp calls? Wouldn't I need to define some kind of mock gulp object before the user's code runs? Is this already possibly currently, or is this something that would need to be added?

Math support

I think that it would be really cool to support MathJAX for writing math formulas.

Next gen code execution

Right now our code execution system is pretty limited/primitive.

Here's what we are missing :

  • A fixture system for providing data
  • A way to import libraries
  • Execute other languages besides JavaScript

@SamyPesse and I will discuss this over the next few days on how to overcome those limitation with a simple solution.

If you have any ideas or feedback on this matter, they are more than welcome !

Recognize final --- as exercise snippet

Currently, introducing an --- anywhere else in the markdown breaks the build process. Two ways to handle this. Either introduce a unique marker to recognize an exercise block or recognize only the last --- block as exercise block.

Absolute links for image

When generating a single page or a PDF, relative links for images stays relative and the image are correctly shown.

It should convert all link to absolute path.

AJAX Page loading

Loading the main body of the page with AJAX instead of loading the entire page again would very much add to the experience.
This would make going to other pages smoother and adding a slide transition effect would not go amiss.

build sets the wrong symlink

Hi.
first of all thank you guys for such an awesome project.

i have following issue with that(i run v0.1.0):
after i build a "_book", the index.html sym link looks like that:

index.html -> _book/README.html

though it should do it without looking in _book subdirectory, it is already there.
with best regards, seva

Add search functionality

In order to use this beyond tutorial/walkthrough use-cases, we need the ability to search the contents of a gitbook. Having an optional searchbox in the navbar would make this a near complete tool for generating documentation sites.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.