These days, I’m writing instruction manuals. After that, I would like to publish it as a website. So I’ve investigated about solutions, which suit below needs.
- Writing a document based on markdown syntax
- Embedding a video
- Generating a website
- Searching documents
- Custom theme
After that, you can initialize with
gitbook init command. That will generate two files:README.md and SUMMARY.md.
- README.md is the first page and contains an introduction.
- SUMMARY.md contains the table of content, which is shown as a left slide menu.
After modifying a document, run the
gitbook serve command. If your document is modified, that will detect it and automatically update the static site.
If you just want to build a static site only, run
gitbook buidinstead of
When you open the site (either open the
http://localhost:4000), you will see a similar page like this.
Last but not least thing is publishing as a website. Github Pages allows us to publish a static website freely. What you need to do is to add files into the
gh-pages branch. We already have generated files for that. So, remaining thing is to add those fils into the
gh-pages branch. Unfortunately,
gitbook doesn’t support it as a command line option. You need to do it manually. To do it easily, I’ve created a shell script.
Whenever you run this script, it will generate files for the static website and push into the
gh-pages branch. With a continuous integration, such as TeamCity, it can be triggered hourly or when the repository file is changed.
Your site will be available at
If you want to use GitBook but are not interested in publishing your github pages, check GitBook site. You can easily create manuals on the site with nice wysiwyg(what you see is what you get) editor.