2017 © Pedro Peláez
 

library themes

Bookdown.io With Bootswatch Styles And Prism Syntax Highlighting

image

bookdown/themes

Bookdown.io With Bootswatch Styles And Prism Syntax Highlighting

  • Sunday, September 17, 2017
  • by pmjones
  • Repository
  • 3 Watchers
  • 6 Stars
  • 1,204 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 200 % Grown

The README.md

Bookdown.io With Bootswatch Styles And Prism Syntax Highlighting

This package is now part of bookdown. You can enable it by setup your bookdown.json, (*1)

{
"template": "bookdown/themes"
}

Installation

Just install bookdown and setup your bookdown.json, (*2)

Configuration

At the moment you can setup the theme with the following settings per bookdown.json, (*3)

"theme": {
    "toc": {
      "collapsibleFromLevel": 1
    }
  }

Table of Contents (toc)

Property Type Description
collapsibleFromLevel integer The toc is collapsible from apart this value

Styles

Choose your preferred style by setting the CSS_BOOTSWATCH and CSS_PRISM environment variable before generating the book. The default Bootswatch style is cerulean and for Prism ghcolors. See the example below how to use another style., (*4)

Visit bootswatch.com to see how the style looks like., (*5)

  • cerulean
  • cosmo
  • cyborg
  • darkly
  • flatly
  • journal
  • lumen
  • paper
  • readable
  • sandstone
  • simplex
  • slate
  • spacelab
  • superhero
  • united
  • yeti

Visit prismjs.com / prism-styles to see how the Prism style looks like., (*6)

  • prism
  • dark
  • funky
  • okaidia
  • twilight
  • coy
  • atom-dark
  • base16-ateliersulphurpool.light
  • cb
  • ghcolors
  • hopscotch
  • pojoaque
  • xonokai

To add an individual logo instead of displaying Home you can set the environment variable MENU_LOGO which must be an absolute URI to an image., (*7)

Generate Documentation

Change the path to your bookdown.json file., (*8)

See the documentation example. It can be compiled using bookdown and Docker. The following example uses the Docker Bookdown and you can use it also out of the box for your project., (*9)

The style is set by an environment CSS_BOOTSWATCH variable and the PRISM style by CSS_PRISM. Here is an example for the superhero style with the prism coy style., (*10)

$ docker run -it --rm -e CSS_BOOTSWATCH=superhero -e CSS_PRISM=coy -v $(pwd):/app sandrokeil/bookdown doc/bookdown.json
$ docker run -it --rm -p 8080:8080 -v $(pwd):/app php:5.6-cli php -S 0.0.0.0:8080 -t /app/doc/html

or for Bookdown via Composer., (*11)

$ export CSS_BOOTSWATCH=superhero && export CSS_PRISM=coy && php ./vendor/bin/bookdown doc/bookdown.json
$ php -S 0.0.0.0:8080 -t doc/html/

Then browse to http://localhost:8080/, (*12)

Bookdown Bootswatch templates in action

Here are some documentation examples generated with this Bookdown.io template., (*13)

Further Information

The Versions

17/09 2017

dev-develop

dev-develop https://github.com/bookdown/Bookdown.Themes

Bookdown.io With Bootswatch Styles And Prism Syntax Highlighting

  Sources   Download

BSD-3-Clause

documentation markdown syntax templates docs static site docbook highlighting manual bookdown

17/09 2017

dev-master

9999999-dev https://github.com/bookdown/Bookdown.Themes

Bookdown.io With Bootswatch Styles And Prism Syntax Highlighting

  Sources   Download

BSD-3-Clause

documentation markdown syntax templates docs static site docbook highlighting manual bookdown

17/09 2017

1.1.3

1.1.3.0 https://github.com/bookdown/Bookdown.Themes

Bookdown.io With Bootswatch Styles And Prism Syntax Highlighting

  Sources   Download

BSD-3-Clause

documentation markdown syntax templates docs static site docbook highlighting manual bookdown

13/08 2017

dev-feature/ImproveToc

dev-feature/ImproveToc https://github.com/bookdown/Bookdown.Themes

Bookdown.io With Bootswatch Styles And Prism Syntax Highlighting

  Sources   Download

BSD-3-Clause

documentation markdown syntax templates docs static site docbook highlighting manual bookdown

29/07 2017

1.1.2

1.1.2.0 https://github.com/bookdown/Bookdown.Themes

Bookdown.io With Bootswatch Styles And Prism Syntax Highlighting

  Sources   Download

BSD-3-Clause

documentation markdown syntax templates docs static site docbook highlighting manual bookdown