About the Node Version of Pattern Lab
To run patternlab-node, just do the following from the command line at the root of patternlab-node:
npm install -g grunt-cli
This creates all patterns, the styleguide, and the pattern lab 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.
Under Active Development
Forward, To the Specification!
Dave Olsen has published the specification for Pattern Lab ports. Development will be oriented toward compliance with this as the spec and the port mature together.
Is Pattern Lab a Platform or a Build Tool?
A lot of good conversation has revolved around whether Pattern Lab is a platform or a tool in the toolbox, part of a larger solution. It's my goal to #1) adhere to the specification and #2) meet the needs of both use cases.
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
You can play with a demo of the front-end of the PHP version of Pattern Lab at demo.pattern-lab.info.
The PHP version of Pattern Lab should be relatively easy for anyone to get up and running.
- Installing the PHP Version of Pattern Lab
- Generating the Pattern Lab Website for the First Time
- Editing the Pattern Lab Website Source Files
- Using the Command-line Options
Working with Patterns
- How Patterns Are Organized
- Adding New Patterns
- Reorganizing Patterns
- Converting Old Patterns
- "Hiding" Patterns in the Navigation
- Including One Pattern Within Another via Partials
- Linking Directly to a Pattern
- Modifying the Standard Header & Footer for Patterns
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.
- Introduction to JSON & Mustache Variables
- Overriding the Central
data.jsonValues with Pattern-specific Values
- Linking to Patterns with Pattern Lab's Default
- Creating Lists with Pattern Lab's Default
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: