Skip to content

jayseeg/patternlab-node

 
 

Repository files navigation

#NOTE The official node port of patternlab is now found at https://github.com/pattern-lab/patternlab-node

About the Node Version of Pattern Lab

The Node version of Pattern Lab is, at its core, a static site generator. It combines platform-agnostic assets, like the Mustache-based patterns and the JavaScript-based viewer, with a Node-based "builder" that transforms and dynamically builds the Pattern Lab site. By making it a static site generator, the Node version of Pattern Lab strongly separates patterns, data, and presentation from build logic. The Node version is a work in progress, the PHP version should be seen as a reference for other developers to improve upon as they build their own Pattern Lab Builders in their language of choice.

Under Active Development

The Node version of Pattern Lab is under active development by @bmuenzenmeyer and (hopefully) @Wiscow. Contributions welcome. We both have kids under 2 years of age, so patience and coffee is requested :D

Getting Started

To run patternlab-node, just do the following from the command line at the root of patternlab-node:

  1. npm install
  2. npm install -g grunt-cli
  3. grunt

This creates all patterns, the styleguide, and the patternlab site. patternlab.json is a file created for debugging purposes. It tells you all the secrets in tidy json.

To have patternlab-node watch for changes to either a mustache template, data, or stylesheets, run grunt watch. The Gruntfile governs what is watched. It should be easy to add scss or whatever preprocessor you fancy.

Watching Progress

Patternlab Node has reached minimum viable product status. The main branch will always have the most up to date version of patternlab-node. Watch the dev branch for what it coming next!

Roadmap

  • Full Patternlab site support. (This is the uber cool navigation found at demo.pattern-lab.info).
  • More Documentation
  • Tests

THE FOLLOWING IS FROM THE PATTERNLAB-PHP PROJECT. A LOT STILL APPLIES TO PATTERNLAB-NODE, BUT IT HAS NOT BEEN ADAPTED YET. USE AT YOUR OWN PERIL

===

Demo

You can play with a demo of the front-end of the PHP version of Pattern Lab at demo.pattern-lab.info.

Getting Started

The PHP version of Pattern Lab should be relatively easy for anyone to get up and running.

Working with Patterns

Patterns are the core element of Pattern Lab. Understanding how they work is the key to getting the most out of the system. Patterns use Mustache so please read Mustache's docs as well.

Creating & Working With Dynamic Data for a Pattern

The PHP version of Pattern Lab utilizes Mustache as the template language for patterns. In addition to allowing for the inclusion of one pattern within another it also gives pattern developers the ability to include variables. This means that attributes like image sources can be centralized in one file for easy modification across one or more patterns. The PHP version of Pattern Lab uses a JSON file, source/_data/data.json, to centralize many of these attributes.

Using Pattern Lab's Advanced Features

By default, the Pattern Lab assets can be manually generated and the Pattern Lab site manually refreshed but who wants to waste time doing that? Here are some ways that the PHP version of Pattern Lab can make your development workflow a little smoother:

About

The (in progress) node version of Pattern Lab

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 53.8%
  • PHP 30.7%
  • CSS 15.2%
  • Ruby 0.3%