Using GitBook for Secrets

Published by Christian Mohn · Read in about 2 min (311 words)

A while ago I decided to try and gather a bunch of non-public information in an easy to write and consume fashion. After a bit of fiddling, and testing different potential solutions, GitBook emerged as the best option. By using MarkDown as the markup language, it’s both cross-platform and easy to manage, as the content is nothing but raw text files.

GitBook is awesome, no question about it, but in this case I didn’t want the content hosted publicly on gitbook.com. Thankfully, GitBook is available for download as well, so I ended up running that locally on my MacBook. For details on how to run it locally, check out Setup and Installation of GitBook.

I then set up a private (free) repository on Bitbucket to host the content.

So far this has been a very good experience. Writing content in Markdown is easy and quick, and running this locally makes it easy to check that the edits and additions look like expected in my browser.

$ gitbook serve dummy
Live reload server started on port: 35729
Press CTRL+C to quit ...

info: 7 plugins are installed
info: loading plugin "livereload"... OK
info: loading plugin "highlight"... OK
info: loading plugin "search"... OK
info: loading plugin "lunr"... OK
info: loading plugin "sharing"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-default"... OK
info: found 13 pages
info: found 8 asset files
info: >> generation finished with success in 2.8s !

Starting server ...
Serving book on http://localhost:4000

This way I can have my browser open http://localhost:4000 on one screen, and edit the content on my second screen while the browser auto refreshes.

Once I’ve added some content I’m happy with, I push the changes back to the Bitbucket repository with my Git client. Once I’m happy with everything, GitBook makes it easy to create PDF and eBook versions for distribution.

We happy.

Post last updated on January 2, 2024: Add author

About

vNinja.net is the online hub of Christian Mohn and Stine Elise Larsen.

The site primarily focuses on IT architecture and data center technologies, with a strong emphasis on virtualization and related topics.
While the main content revolves around these areas, you'll also find a range of other subjects covered from time to time, reflecting the interests of authors.

Sponsors