@ithaka/bonsai
ITHAKA core styling
Last updated 9 days ago by ithaka-jenkins .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ithaka/bonsai 
SYNC missed versions from official npm registry.

Bonsai

ITHAKA core styling and JavaScript functionality

Installation

$ npm install @ithaka/bonsai

Development

System Dependencies

This project requires Node.js and npm to be installed prior to development work.

Package Dependencies

Installing all necessary dependencies for building the package should be as simple as:

$ npm install

Building the package

Once you've installed all the dependencies, building the package can be accomplished with:

$ npm run build

To watch for changes:

$ npm run watch

To start a local development server with hot reloading:

$ npm run start  # or simply "npm start"

Testing

To run tests:

$ npm run test  # or simply "npm test"

Style Guide

The Bonsai Style Guide is dynamically generated using the zurb/supercollider library.

To contribute to the Bonsai documentation and style guide, you will want to run it locally.

Running Locally

You'll need node and git installed on your machine.

$ git clone https://github.com/ithaka/bonsai.git
$ cd bonsai
$ npm install # this could take a few minutes
$ npm run start

$ npm run start will launch the development server on http://localhost:8080. Navigate there and you will be redirected to the index of the style guide

Any time a file change is saved the documentation will recompile. Refresh the page to see your change.

Making a new page in the style guide

You might want to write the documentation in Markdown

Learn Markdown

Markdown Cheatsheet

Let's say that JSTOR is going to create a new feature giving esteemed researchers a plethora of new tools for their study of cats. Suddenly the style guide needs a page about cats! Here's how you'd make it.

Create a markdown file (cats.md) in documentation/pages/. At the very minimum it needs a title, description, and content.

documentation/pages/cats.md


---
title: Cats Cats Cats!
description: Guidelines for the JSTOR Cats feature set
---

<!-- here down can be a mix of HTML and Markdown -->

![](kitten.jpeg)

<div class="cat-container">
    <p class="cat">CAT</p>
</div>

The bulk of the content for each page can be markdown, html, or a mix of the two

If you want to dynamically include the sass or js documentation for the cats component, simply add it in the header of the markdown file. Both sass and js are optional.


---
title: Cats Cats Cats!
description: Guidelines for the JSTOR Cats feature set
sass: ./scss/_cats.scss
js: ./js/bonsai.cats.js
---

Additionally, supercollider allows the creation custom adapters if types of documentation other than html, sass, and js need to be dynamically generated.

HTML Examples

When documenting how to use a component, you may want to include example code. Giving the markdown block the language level of html_example will insert the rendered html directly after the markdown example.

For example this:

```html_example
<button>I am button</button>
```

will display the literal code, plus the rendered button afterwards.

Routing

After making the markdown file, but probably before you put all your content in there, you should add it to the routes. Go to documentation/routes/js, and add a line in the array that has the name of your markdown file.

routes.js before

module.exports = [
  "button",
  "modal"
]

routes.js after

module.exports = [
  "button",
  "modal",
  "cats"
]

By adding "cats" to this array, we enable hot reloading for the cats.md file as well as add an option for "Cats" in the navigation of the style guide

The Style Guide Build System

  • webpack
    • webpack-shell-plugin
    • raw-loader
  • supercollider
    • foundation-docs custom markdown interpreter
  • handlebars

What happens when running npm run start?

  1. Webpack is run, processing all the files defined in the entry object in webpack.config.js
  2. Once all the files are processed, the WebpackShellPlugin runs node generate-docs.js
  3. generate-docs.js contains the SuperCollider configuration and initialization.
  4. SuperCollider generates the html by taking all the markdown templates, running them through the markdown interpreter, getting the sassDocs and jsDocs associated with each markdown file, and running them all through the primary handlebars template. This is then all output as raw html to documentation/styleguide/. These settings are all in the generate-docs.js file
  5. A development server is launched at localhost:8080

The development server is now watching the sass, javascript, markdown, and main template for changes. It does this because all these files are run through webpack (even though they're not all compiled)

In js/index.js the main handlebar template is imported, as well as an array of all the names of the individual components that are a part of the style guide. Iterating through the array, every markdown file is also imported into the js/index.js.

We don't tell webpack what to do with these files, but we do have to give webpack a loader for .html and .md files. There are rules setup to run html and md through the raw-loader. Now webpack is aware of everything, and anytime something it's aware of changes it runs through the above steps again, minus launching a duplicate server.

Publishing to NPM

Everything that gets merged into the develop branch will become a beta release

Everything that gets merged into the master branch will become a latest release.

Please note that each pull request that is being merged into either of these branches need to have an updated version in the package.json file so that the npm publish can succeed.

Jenkins jobs that automate these releases exist here: http://jenkins.test.cirrostratus.org:8080/job/build-bonsai-develop/ http://jenkins.test.cirrostratus.org:8080/job/build-bonsai-master/

Current Tags

  • 1.17.1                                ...           beta (a year ago)
  • 1.17.3                                ...           dev (9 days ago)
  • 1.17.3                                ...           latest (9 days ago)

119 Versions

  • 1.17.3                                ...           9 days ago
  • 1.17.2                                ...           5 months ago
  • 1.17.1                                ...           a year ago
  • 1.17.0                                ...           a year ago
  • 1.16.10                                ...           a year ago
  • 1.16.9                                ...           a year ago
  • 1.16.8                                ...           a year ago
  • 1.16.7                                ...           a year ago
  • 1.16.6                                ...           2 years ago
  • 1.16.5                                ...           2 years ago
  • 1.16.4                                ...           2 years ago
  • 1.16.3                                ...           2 years ago
  • 1.16.2                                ...           2 years ago
  • 1.16.1                                ...           2 years ago
  • 1.16.0                                ...           2 years ago
  • 1.15.1                                ...           2 years ago
  • 1.15.0                                ...           2 years ago
  • 1.14.0                                ...           2 years ago
  • 1.13.1                                ...           2 years ago
  • 1.13.0                                ...           2 years ago
  • 1.12.0                                ...           2 years ago
  • 1.11.0                                ...           2 years ago
  • 1.10.0                                ...           2 years ago
  • 1.10.0-rc2                                ...           2 years ago
  • 1.10.0-rc1                                ...           2 years ago
  • 1.9.17                                ...           2 years ago
  • 1.9.16                                ...           2 years ago
  • 1.9.15-rc1                                ...           2 years ago
  • 1.9.14                                ...           2 years ago
  • 1.9.13                                ...           2 years ago
  • 1.9.12                                ...           2 years ago
  • 1.9.11                                ...           2 years ago
  • 1.9.10                                ...           2 years ago
  • 1.9.9                                ...           2 years ago
  • 1.9.8                                ...           2 years ago
  • 1.9.7                                ...           2 years ago
  • 1.9.6                                ...           2 years ago
  • 1.9.5                                ...           2 years ago
  • 1.9.4                                ...           2 years ago
  • 1.9.3                                ...           2 years ago
  • 1.9.2                                ...           2 years ago
  • 1.9.1                                ...           2 years ago
  • 1.9.0                                ...           2 years ago
  • 1.8.3                                ...           2 years ago
  • 1.8.2                                ...           2 years ago
  • 1.8.1                                ...           2 years ago
  • 1.8.0                                ...           2 years ago
  • 1.7.1                                ...           2 years ago
  • 1.7.0                                ...           2 years ago
  • 1.6.2                                ...           2 years ago
  • 1.6.1                                ...           2 years ago
  • 1.6.1-rc2                                ...           2 years ago
  • 1.6.1-rc1                                ...           2 years ago
  • 1.6.0                                ...           2 years ago
  • 1.5.5                                ...           2 years ago
  • 1.5.5-rc1                                ...           2 years ago
  • 1.5.4                                ...           2 years ago
  • 1.5.4-rc1                                ...           2 years ago
  • 1.5.3                                ...           2 years ago
  • 1.5.2                                ...           2 years ago
  • 1.5.2-rc1                                ...           2 years ago
  • 1.5.1                                ...           2 years ago
  • 1.5.0                                ...           2 years ago
  • 1.5.0-rc1                                ...           2 years ago
  • 1.4.2                                ...           2 years ago
  • 0.0.13                                ...           2 years ago
  • 0.0.12                                ...           2 years ago
  • 0.0.11                                ...           2 years ago
  • 1.4.2-rc2                                ...           2 years ago
  • 1.4.2-rc1                                ...           2 years ago
  • 0.0.8                                ...           2 years ago
  • 0.0.7                                ...           2 years ago
  • 0.0.6                                ...           2 years ago
  • 0.0.5                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
  • 1.4.1                                ...           2 years ago
  • 1.4.1-rc1                                ...           3 years ago
  • 1.4.0                                ...           3 years ago
  • 1.2.9                                ...           3 years ago
  • 1.3.0                                ...           3 years ago
  • 1.3.0-rc3                                ...           3 years ago
  • 1.3.0-rc2                                ...           3 years ago
  • 1.2.5                                ...           3 years ago
  • 1.2.5-rc1                                ...           3 years ago
  • 1.2.4                                ...           3 years ago
  • 1.2.4-rc2                                ...           3 years ago
  • 1.3.0-rc1                                ...           3 years ago
  • 1.2.3                                ...           3 years ago
  • 1.2.3-rc3                                ...           3 years ago
  • 1.2.3-rc2                                ...           3 years ago
  • 1.2.3-rc1                                ...           3 years ago
  • 1.2.2                                ...           3 years ago
  • 1.2.2-rc1                                ...           3 years ago
  • 1.2.1                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.1.0-rc1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
  • 1.0.0-rc10                                ...           3 years ago
  • 1.0.0-rc9                                ...           3 years ago
  • 1.0.0-rc8                                ...           3 years ago
  • 1.0.0-rc7                                ...           3 years ago
  • 1.0.0-rc6                                ...           3 years ago
  • 1.0.0-rc5                                ...           3 years ago
  • 1.0.0-rc4                                ...           3 years ago
  • 1.0.0-rc3                                ...           3 years ago
  • 1.0.0-rc2                                ...           3 years ago
  • 1.0.0-rc1                                ...           3 years ago
  • 0.3.0                                ...           3 years ago
  • 0.2.0                                ...           3 years ago
  • 0.1.4                                ...           3 years ago
  • 0.1.3                                ...           3 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
  • 0.0.0                                ...           3 years ago
Downloads
Today 0
This Week 119
This Month 136
Last Day 0
Last Week 16
Last Month 0
Dependencies (6)
Dev Dependencies (32)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |