grunt-patternprimer

by asciidisco

Grunting grunts with grunt & serving a pattern catalogue

123 Stars 16 Forks Last release: Not found MIT License 20 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

grunt-patternprimer v0.1.1 Build Status devDependency Status

Grunt enabled port of adactios Pattern-Primer

What?!

As stated in the original docs:

Create little snippets of markup and save them to the "patterns folder." The pattern primer will generate a list of all the patterns in that folder. You will see the pattern rendered as HTML. You will also get the source displayed in a textarea.

Check also the related Blog Post & example from Jeremy.

Getting Started

This plugin requires Grunt

~0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-patternprimer --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-patternprimer');

Patternprimer task

Run this task with the

grunt patternprimer
command.

Task targets, files and options may be specified according to the grunt Configuring tasks guide.

Options

wwwroot

Type:

String

Default:
public

This is the Place all your HTML extracts (the pattern files) live it is relative to the

 folder of your project.

css

Type:

Array

Default:
['global.css']

Array with all the css files you that should be loaded in the parttern primer.

Note: You can also specify remote ressources like

http://my.domain.com/style.css
. They will be downloaded and stored locally in case of a snapshot. Does not work with ressorces from
https
sites.

dest

Type:

String

Default:
docs

Specifies the destination of the pattern files when running a snapshot build and/or running the live server.

ports

Type:

Array

Default:
[7020, 7030]

Ports that should be used when running the live server. The first index of that array will be used to serve the contents of the

patterns
folder live, the second port will be used to serve your last snapshot build (if one exists).

src

Type:

String
Default:
public/patterns

The location of your pattern catalogue, this source will be used to deliver the pattern catalogue from the live server and to generate snapshots from it.

snapshot

Type:

Boolean

Default:
false

Determines if a live server should be fired up, or if the output ends up in the via

dest
configured snapshot directory.

index

Type:

Boolean
String
Default:
false

Define your own index template for the patterns. Should be a file ending with the

.html
extension. Please omit the closing

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.