Giter Club home page Giter Club logo

patternlab-node's Introduction

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.

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 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

Build Status The Node version of Pattern Lab is under active development by @bmuenzenmeyer and contributors. Pull requests welcome, but please take a moment to read the guidelines.

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

===

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:

patternlab-node's People

Contributors

bmuenzenmeyer avatar colynb avatar joemcgill avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.