Skip to content

Commit 4199642

Browse files
committed
documented cli, help command improvements
closes #43 closes #37
1 parent 98da307 commit 4199642

File tree

2 files changed

+72
-10
lines changed

2 files changed

+72
-10
lines changed

README.md

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,69 @@ To run patternlab-node, just do the following from the command line at the root
1010
2. `npm install -g grunt-cli`
1111
3. `grunt`
1212

13-
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.
13+
This creates all patterns, the styleguide, and the pattern lab site.
1414

15+
### Command Line Interface
16+
17+
The following are grunt task arguments you may execute:
18+
19+
##### `patternlab`
20+
With no arguments, patternlab runs the full builder, compiling patterns, and constructing the front-end site.
21+
22+
##### `patternlab:only_patterns`
23+
Compile the patterns only, outputting to ./public/patterns
24+
25+
##### `patternlab:v`
26+
Retrieve the version of patternlab-node you have installed
27+
28+
##### `patternlab:help`
29+
Get more information about patternlab-node, pattern lab in general, and where to report issues.
30+
31+
### Config Options
32+
33+
##### Watching Changes
1534
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.
1635

36+
##### Nav Bar Controls
37+
If you don't have a need for some of the nav-bar tools in the patternlab frontend, you can turn them off in `config.json`.
38+
39+
The current selection is as follows. It reflects support versus patternlab-php.
40+
41+
```
42+
"ishControlsVisible": {
43+
"s": true,
44+
"m": true,
45+
"l": true,
46+
"full": true,
47+
"ranndom": true,
48+
"disco": true,
49+
"hay": true,
50+
"mqs": false,
51+
"find": false,
52+
"views-all": true,
53+
"views-annotations": true,
54+
"views-code": true,
55+
"views-new": true,
56+
"tools-all": true,
57+
"tools-follow": false,
58+
"tools-reload": false,
59+
"tools-shortcuts": false,
60+
"tools-docs": true
61+
}
62+
```
63+
64+
##### Verbose Mode
65+
`patternlab.json` is a file created for debugging purposes. Set `debug` to true in `.config.json` to see all the secrets.
66+
1767
### Under Active Development
1868

1969
[![Build Status](https://travis-ci.org/pattern-lab/patternlab-node.png?branch=master)](https://travis-ci.org/pattern-lab/patternlab-node) The Node version of Pattern Lab is under active development by [@bmuenzenmeyer](https://twitter.com/bmuenzenmeyer) and contributors. Pull requests welcome, but please take a moment to read the [guidelines](https://github.com/pattern-lab/patternlab-node/blob/master/CONTRIBUTING.md).
2070

21-
#### Forward, To the Specification!
71+
### Forward, To the Specification!
2272

2373
Dave Olsen has published the [specification](https://github.com/pattern-lab/the-spec/blob/draft/SPEC.md) for Pattern Lab ports. Development will be oriented toward compliance with this as the spec and the port mature together.
2474

25-
#### Is Pattern Lab a Platform or a Build Tool?
75+
### Is Pattern Lab a Platform or a Build Tool?
2676

2777
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.
2878

@@ -34,16 +84,17 @@ grunt.registerTask('default', ['clean', 'concat', 'patternlab:only_patterns', /*
3484

3585
This will output compiled patterns to ./public/patterns/
3686

37-
**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**
87+
===
3888

89+
**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**
3990

4091
===
4192

42-
## Demo
93+
### Demo
4394

4495
You can play with a demo of the front-end of the PHP version of Pattern Lab at [demo.pattern-lab.info](http://demo.pattern-lab.info).
4596

46-
## Getting Started
97+
### Getting Started
4798

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

@@ -53,7 +104,7 @@ The PHP version of Pattern Lab should be relatively easy for anyone to get up an
53104
* [Editing the Pattern Lab Website Source Files](https://github.com/pattern-lab/patternlab-php/wiki/Editing-the-Pattern-Lab-Website-Source-Files)
54105
* [Using the Command-line Options](https://github.com/pattern-lab/patternlab-php/wiki/Using-the-Command-line-Options)
55106

56-
## Working with Patterns
107+
### Working with Patterns
57108

58109
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](http://mustache.github.io/) so please read [Mustache's docs](http://mustache.github.io/mustache.5.html) as well.
59110

@@ -67,7 +118,7 @@ Patterns are the core element of Pattern Lab. Understanding how they work is the
67118
* [Managing Assets for a Pattern: JavaScript, images, CSS, etc.](https://github.com/pattern-lab/patternlab-php/wiki/Managing-Assets-for-a-Pattern)
68119
* [Modifying the Standard Header & Footer for Patterns](https://github.com/pattern-lab/patternlab-php/wiki/Modifying-the-Standard-Header-&-Footer-for-Patterns)
69120

70-
## Creating & Working With Dynamic Data for a Pattern
121+
### Creating & Working With Dynamic Data for a Pattern
71122

72123
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](https://github.com/pattern-lab/patternlab-php/wiki/Including-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.
73124

@@ -76,7 +127,7 @@ The PHP version of Pattern Lab utilizes Mustache as the template language for pa
76127
* [Linking to Patterns with Pattern Lab's Default `link` Variable](https://github.com/pattern-lab/patternlab-php/wiki/Linking-to-Patterns-with-Pattern-Lab's-Default-%60link%60-Variable)
77128
* [Creating Lists with Pattern Lab's Default `listItems` Variable](https://github.com/pattern-lab/patternlab-php/wiki/Creating-Lists-with-Pattern-Lab's-Default-%60listItems%60-Variable)
78129

79-
## Using Pattern Lab's Advanced Features
130+
### Using Pattern Lab's Advanced Features
80131

81132
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:
82133

builder/patternlab.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,18 @@ var patternlab_engine = function(grunt){
2323
}
2424

2525
function help(){
26-
grunt.log.ok('patternlab-node help coming soon \n Until then, visit http://patternlab.io/docs/index.html for general help on pattern-lab \n Visit https://github.com/pattern-lab/patternlab-node/issues to open a bug.');
26+
grunt.log.subhead('Patternlab Node Help');
27+
grunt.log.writeln('===============================');
28+
grunt.log.writeln('Command Line Arguments');
29+
grunt.log.writeln('patternlab:only_patterns');
30+
grunt.log.writeln(' > Compiles the patterns only, outputting to ./public/patterns');
31+
grunt.log.writeln('patternlab:v');
32+
grunt.log.writeln(' > Retrieve the version of patternlab-node you have installed');
33+
grunt.log.writeln('patternlab:help');
34+
grunt.log.writeln(' > Get more information about patternlab-node, pattern lab in general, and where to report issues.');
35+
grunt.log.writeln('===============================');
36+
grunt.log.writeln('Visit http://patternlab.io/docs/index.html for general help on pattern-lab');
37+
grunt.log.writeln('Visit https://github.com/pattern-lab/patternlab-node/issues to open a bug.');
2738
}
2839

2940
function printDebug() {

0 commit comments

Comments
 (0)