Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

patternlab-php

The PHP version of Pattern Lab

Subscribe to updates I use patternlab-php


Statistics on patternlab-php

Number of watchers on Github 3130
Number of open issues 19
Average time to close an issue 3 months
Main language PHP
Average time to merge a PR 7 days
Open pull requests 14+
Closed pull requests 12+
Last commit over 3 years ago
Repo Created over 6 years ago
Repo Last Updated over 1 year ago
Size 18.3 MB
Homepage http://patternlab.io
Organization / Authorpattern-lab
Latest Releasev2.0.0
Contributors16
Page Updated
Do you use patternlab-php? Leave a review!
View open issues (19)
View patternlab-php activity
View on github
Fresh, new opensource launches πŸš€πŸš€πŸš€
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating patternlab-php for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

license Packagist Gitter

Pattern Lab Standard Edition for Mustache

The Pattern Lab Standard Edition for Mustache is the evolution of Pattern Lab 1. Pattern Lab is still, at its core, a prototyping tool focused on encouraging communication between content creators, designers, devs, and clients. It combines platform-agnostic assets, like the Mustache-based patterns, with a PHP-based builder. Pattern Lab 2 introduces the beginnings of an ecosystem that will allow teams to mix, match and extend Pattern Lab to meet their specific needs. It will also make it easier for the Pattern Lab team to push out new features. Pattern Lab Standard Edition for Mustache is just one of the four PHP-based Editions currently available.

Demo

You can play with a demo of the front-end of Pattern Lab at demo.patternlab.io.

Requirements

To use the basic features of Pattern Lab to compile patterns, you must have PHP 5.4+ installed. On Mac OS X Pattern Lab should work out of the box. If you're on Windows you can download PHP from PHP.net. Pattern Lab comes with its own built-in web server.

Pattern Lab uses Composer to manage project dependencies. It's required if you want to install Pattern Lab using Composer's create-project command or if you want to upgrade Pattern Lab in the future.

Installing

There are two methods for downloading and installing the Standard Edition for Mustache:

  • Download a pre-built project
  • Create a project based on this Edition with Composer

Download a pre-built project

The fastest way to get started with Pattern Lab's Standard Edition for Mustache is to download the latest pre-built version from the releases page.

Use Composer to create a project

Pattern Lab uses Composer to manage project dependencies.

1. Install Composer

Please follow the directions for installing Composer on the Composer website. We recommend you install it globally.

2. Install the Standard Edition for Mustache

Use Composer's create-project command to install the Standard Edition for Mustache into a location of your choosing. To create a project do the following:

  1. In a terminal window navigate to where you want to install Pattern Lab
  2. Type composer create-project pattern-lab/edition-mustache-standard patternlab2-example && cd $_
  3. When prompted, type 1 to install the demo StarterKit

This will install the Standard Edition for Mustache along with the demo StarterKit into a directory called patternlab2-example. You will be automatically dropped into patternlab2-example/ when the install is finished.

Note: If you clone or download this repository and use composer install to install the project dependencies you'll need to type the following to install the demo StarterKit:

composer install-demo

Otherwise you'll have a very bare set-up of Pattern Lab.

Get Up and Running

After installing do the following to start and view Pattern Lab:

  1. In a terminal window navigate to the root of your project if you aren't there already
  2. Type php core/console --server --with-watch

You should now be able to open http://localhost:8080 to see your generated site. Any changes you make in ./source/ will automatically rebuild your site and reload your browser.

As you get more comfortable with Pattern Lab you can integrate it with a Gulp or Grunt workflow and drop some of the native Pattern Lab features like automatic browser reload. You can also check out the list of plugins.

More Documentation

Obviously Pattern Lab is deeper than the install process. Check out the documentation to learn about how to use patterns, how to modify the data used to populate those patterns, and about some advanced features.

Migrating from Pattern Lab 1 to Pattern Lab 2

Pattern Lab 2 was a complete rewrite and reorganization of Pattern Lab 1. Learn about the changes. After installing the Standard Edition for Mustache do the following to migrate from Pattern Lab 1 to Pattern Lab 2:

  1. Copy ./source from your old project to your new install
  2. Copy ./source/_patterns/00-atoms/00-meta/_00-head.mustache to ./source/_meta/_00-head.mustache
  3. Copy ./source/_patterns/00-atoms/00-meta/_01-foot.mustache to ./source/_meta/_00-foot.mustache
  4. Copy ./source/_data/annotations.js to ./source/_annotations/annotations.js

Everything else should work without changes.

Need Pattern Lab 1?

The source code for Pattern Lab 1 is still available for download.

Packaged Components

The Standard Edition for Mustache installs the following components:

List All of the Available Commands and Their Options

To list all available commands type:

php core/console --help

To list the options for a particular command type:

php core/console --help --[command]
patternlab-php open issues Ask a question     (View All Issues)
  • almost 3 years [docs] Upgrade: wrong path for patternlab-foot
  • about 3 years More control over export
  • about 3 years Does Pattern Lab β€œnot mix well” with Angular?
  • about 3 years Page not always Auto Reloading?
  • about 3 years Data Override Not Working As Expected
  • about 3 years Strange, differing behaviour on view all
  • about 3 years Watch process doesn’t regenerate site
  • about 3 years 'View All' menu navigation issue
  • about 3 years pattern lab processes automatically time out
  • about 3 years pattern-lab-plugin-reload.json path problem
patternlab-php open pull requests (View All Pulls)
  • add raw URL option for QR generation
  • Atoms color
  • Add line numbers and details to JSON parse errors
  • Add lambda support
  • Making source and public folders a setting in config.ini
  • The viewport iframe is now fluid
  • Fix #181: `.sg-code-contains code` color is the same as background-color
  • reset: remove no longer existent hgroup element
  • Use offset().top to calculate .sg-acc-panel dynamic height
  • Fix wrong URLs
  • Replaced "/" with DIRECTORY_SEPARATOR
  • fix documentation links in the header bar
  • Use 10x numbering for easier reordering
  • Correct links that point to old pattern-lab.info domain.
patternlab-php list of languages used
patternlab-php latest release notes
v2.0.0 v2.0.0: Unleashing Pattern Lab 2 for Mustache

It's been a long wait but Pattern Lab 2 for Mustache is now out. For the most part a Pattern Lab 1 project should work with minimal changes in Pattern Lab 2. Here is a non-exhaustive list of new features in Pattern Lab 2:

  • complete rebuilding of core
  • support for Composer
  • support for more template languages (currently Mustache and Twig)
  • support for StarterKits allowing separation of a teams unique needs from Pattern Lab proper
  • event notification system, getters, setters, and a clean install process to allow for plugins
  • redesigned and rebuilt modal view
  • redesigned and rebuilt styleguide view
  • multi-source directory support
  • support for YAML in global data, pattern-specific data, and pseudo-patterns
  • can have multiple JSON/YAML files in ./_data/
  • support for JSON/YAML linting to find errors
  • can set multiple classes using the style modifier
  • can use link.[pattern-name] within data to link to other patterns
  • pattern parameters support simple lists
  • pattern parameters act more like mustache (but not exactly!)
  • patternParameters can over listItem loop numbers
  • global pattern header and footer is now in ./source/_meta
  • upgraded console utility
  • patterns and pattern subtypes can be documented in the styleguide by using [pattern-name].md or [pattern-subtype].md
  • view all pages for pattern sub-types
  • annotations can be defined using Markdown
  • patterns can be exported minus Pattern Lab mark-up
  • can hide individual patterns from view all view still available via the nav
  • can set a pattern to be the default pattern when loading Pattern Lab
  • can turn on modal view by default
  • implemented server
  • sayings can now be defined in the config
  • install process that makes it easier to install various components

These are the features of Pattern Lab 1 that have become plugins:

  • Automatic Browser Reload

These are the features of Pattern Lab 1 that have been removed in Pattern Lab 2:

  • QR Code Generator
  • Page Follow
  • MQs
v1.1.0 v1.1.0: Pattern Lab 1

This release wraps up all of the minor changes that have been made to Pattern Lab 1 since the last release in August 2014.

v1.0.0 v1.0.0: Semantically Versioned

Pattern Lab is now using semantic versioning for release versioning. This is being done for two reasons. The first is an acknowledgment that Pattern Lab is being used by a number of people in production environments. The second reason is that the next release will break backwards compatibility and we want to be able to clearly convey that. There are no real differences between v0.7.12 of Pattern Lab and v1.0.0.

Other projects in PHP