{"id":17402842,"url":"https://github.com/thlorenz/gitbookify","last_synced_at":"2025-07-20T14:34:52.099Z","repository":{"id":21119661,"uuid":"24420358","full_name":"thlorenz/gitbookify","owner":"thlorenz","description":"Generates gitbook chapters and sections from a given markdown file.","archived":false,"fork":false,"pushed_at":"2014-11-14T17:48:45.000Z","size":172,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-30T05:08:20.408Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/thlorenz/gitbookify","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thlorenz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-24T15:20:41.000Z","updated_at":"2020-05-05T03:21:16.000Z","dependencies_parsed_at":"2022-08-28T06:10:36.591Z","dependency_job_id":null,"html_url":"https://github.com/thlorenz/gitbookify","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fgitbookify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fgitbookify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fgitbookify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fgitbookify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thlorenz","download_url":"https://codeload.github.com/thlorenz/gitbookify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251644842,"owners_count":21620634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-16T18:30:08.677Z","updated_at":"2025-04-30T05:08:36.522Z","avatar_url":"https://github.com/thlorenz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gitbookify [![build status](https://secure.travis-ci.org/thlorenz/gitbookify.png)](http://travis-ci.org/thlorenz/gitbookify)\n\nGenerates gitbook chapters and sections from a given markdown file.\n\n## Installation\n\n    npm install -g gitbookify\n\n## Usage\n\n```\ngitbookify \u003cfile.md\u003e --outdir \u003coutdir\u003e \u003cgitbookify options\u003e\n\n  Generates gitbook chapters and sections from a given markdown file.\n\nOPTIONS:\n\n  -o, --outdir    the directory to which to write the generated files used to generate a gitbook\n  -l, --loglevel  level at which to log: silly|verbose|info|warn|error|silent -- default: info\n  -h, --help      Print this help message.\n\nEXAMPLES:\n  \n  Generate with default options and launch gitbook server afterwards:\n    \n    gitbookify README.md --outdir ./my-gitbook \u0026\u0026 gitbook serve ./my-gitbook\n\n  Override loglevel:\n\n    gitbookify API.md --loglevel silly -o ./my-gitbook\n```\n\nSections are created by separating on each `# ` header. If headers have the same name they go into the same chapter. For\nmore info [review this example](https://raw.githubusercontent.com/thlorenz/gitbookify/master/test/fixtures/addon-slides.md).\n\nAfter generating the chapters you can use [gitbook](https://github.com/GitbookIO/gitbook) to either serve them `gitbook\nserve ./my-gitbook` or [do all the other gitbook things](https://github.com/GitbookIO/gitbook#how-to-use-it).\n\n## Speaker Notes\n\nSimply enclose your speaker notes in a `notes` comment as shown below. The notes will be printed to the browser console\nwhen you open the particular page in the gitbook.\n\n```html\n\u003c!-- notes\n- first speaker note\n  - indented sub note\n--\u003e\n```\n\n## Images\n\nThere are two ways to add images to your gitbook.\n\n### Linking Remote URLS\n\nThat is easy since they take absolute paths like `https://path.to/img.png` and work at all times.\n\n**Disadvantage**: You have to be online when presenting/reading the book and as we all know good network is not a given\nat conferences\n\n### Linking to Local Directory\n\nYou can also link to a directory relative to the markdown file you create, i.e. `img/my-image.png`. \n\nThe problem is that the resulting pages of the book are placed somewhere else and cannot find that `img` directory. In\norder to fix that use this simple function in order to create softlinks from each book page to the main `img` directory.\n\n```sh\nlink_img() {\n  for D in *; do\n    if [ -d \"${D}\" ]; then\n      ln -s ../../img $D/img\n    fi\n  done\n}\n```\n\nYou can then use it in your script that builds the book:\n\n```sh\nrm -rf ./gitbook\ngitbookify slides.md -o gitbook      \u0026\u0026 \\\n  rm -rf ./book                      \u0026\u0026 \\\n  gitbook build ./gitbook -o  ./book \u0026\u0026 \\\n  cd ./book                          \u0026\u0026 \\\n  link_img\n```\n\n[here is a full example](https://github.com/thlorenz/talks/blob/e27198bc7ded08bb9513b47d510c8f01db51ce90/memory-profiling/build.sh) of such script.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthlorenz%2Fgitbookify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthlorenz%2Fgitbookify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthlorenz%2Fgitbookify/lists"}