Skip to content

Commit 5c64647

Browse files
committed
Merge branch 'dev' into dev-3.0
# Conflicts: # README.md # core/lib/patternlab.js # package.json # test/files/_patterns/00-test/01-bar.md # test/parameter_hunter_tests.js
2 parents b638ad0 + e8f2e8a commit 5c64647

24 files changed

+336
-37
lines changed

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ This repository contains the core functionality for Pattern Lab Node. Pattern La
88

99
[Online Demo of Pattern Lab Output](http://demo.patternlab.io/)
1010

11+
## Support for Pattern Lab Node
12+
13+
Pattern Lab Node wouldn't be what it is today without the support of the community. It will always be free and open source. Continued development is made possible in part from the support of [these wonderful project supporters](https://github.com/pattern-lab/patternlab-node/wiki/Thanks). If you want to learn more about supporting the project, visit the [Pattern Lab Node Patreon page](https://www.patreon.com/patternlab).
14+
15+
**:100: Thanks for support from the following:**
16+
17+
* **[Brad Frost](http://bradfrost.com/)**
18+
* [Marcos Peebles](https://twitter.com/marcospeebles)
19+
* [Susan Simkins](https://twitter.com/susanmsimkins)
20+
1121
## Installation
1222

1323
Pattern Lab Node Core is designed to be consumed, and by default is included as a dependency within two example [Node Editions](https://github.com/pattern-lab?utf8=%E2%9C%93&query=edition-node).
@@ -80,19 +90,10 @@ Please read the guidelines: https://github.com/pattern-lab/patternlab-node/blob/
8090

8191
The Pattern Lab Node team uses [our gitter.im channel, pattern-lab/node](https://gitter.im/pattern-lab/node) to keep in sync, share updates, and talk shop. Please stop by to say hello or as a first place to turn if stuck. Other channels in the Pattern Lab organization can be found on gitter too.
8292

83-
There is also a dedicated Pattern Lab channel on the [design system slack](designsystems.herokuapp.com) run by [@jina](https://twitter.com/jina).
93+
There is also a dedicated Pattern Lab channel on the [design system slack](http://designsystems.herokuapp.com) run by [@jina](https://twitter.com/jina).
8494

8595
Ask or answer Pattern Lab questions on Stack Overflow: http://stackoverflow.com/questions/tagged/patternlab.io
8696

87-
## Support Pattern Lab Node
88-
89-
Pattern Lab Node is on [Patreon account](https://www.patreon.com/patternlab) to allow users and organizations to directly support continued work on the Pattern Lab Node project.
90-
91-
I (Brian talking) need help and support to make Pattern Lab Node a sustained success. I devote a lot of free time and would-be sleep to make the project what it is, but nothing compares to hearing back from users. It means the world to me when people find value in Pattern Lab Node. I am ridiculously humbled to hear and see what you all build with it.
92-
93-
If you find yourself here and balk and the idea of supporting open source software monetarily - I understand. Carry on, but please do share what you build - we all learn more together.
94-
- [Pattern Lab on Patreon](https://www.patreon.com/patternlab)
95-
9697
## License
9798

9899
[MIT](https://github.com/pattern-lab/patternlab-node/blob/master/LICENSE)

core/lib/parameter_hunter.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@ const parameter_hunter = function () {
270270
let allData = _.merge(globalData, localData);
271271
allData = _.merge(allData, paramData);
272272

273+
//if the partial has pattern parameters itself, we need to handle those
274+
findparameters(partialPattern, patternlab);
275+
273276
//if partial has style modifier data, replace the styleModifier value
274277
if (pattern.stylePartials && pattern.stylePartials.length > 0) {
275278
style_modifier_hunter.consume_style_modifier(partialPattern, pMatch, patternlab);

core/lib/pattern_assembler.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ const pattern_assembler = function () {
154154
currentPattern.patternDescExists = true;
155155
currentPattern.patternDesc = markdownObject.markdown;
156156

157+
//Add all markdown to the currentPattern, including frontmatter
158+
currentPattern.allMarkdown = markdownObject;
159+
157160
//consider looping through all keys eventually. would need to blacklist some properties and whitelist others
158161
if (markdownObject.state) {
159162
currentPattern.patternState = markdownObject.state;
@@ -170,6 +173,9 @@ const pattern_assembler = function () {
170173
if (markdownObject.tags) {
171174
currentPattern.tags = markdownObject.tags;
172175
}
176+
if (markdownObject.title) {
177+
currentPattern.patternName = markdownObject.title;
178+
}
173179
if (markdownObject.links) {
174180
currentPattern.links = markdownObject.links;
175181
}

core/lib/patternlab.js

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* patternlab-node - v2.8.0 - 2017
2+
* patternlab-node - v2.10.0 - 2017
33
*
44
* Brian Muenzenmeyer, Geoff Pursell, Raphael Okon, tburny and the web community.
55
* Licensed under the MIT license.
@@ -411,6 +411,13 @@ const patternlab_engine = function (config) {
411411

412412
// stringify this data for individual pattern rendering and use on the styleguide
413413
// see if patternData really needs these other duped values
414+
415+
// construct our extraOutput dump
416+
var extraOutput = Object.assign({}, pattern.extraOutput, pattern.allMarkdown);
417+
delete(extraOutput.title);
418+
delete(extraOutput.state);
419+
delete(extraOutput.markdown);
420+
414421
pattern.patternData = JSON.stringify({
415422
cssEnabled: false,
416423
patternLineageExists: pattern.patternLineageExists,
@@ -433,7 +440,7 @@ const patternlab_engine = function (config) {
433440
patternPartial: pattern.patternPartial,
434441
patternState: pattern.patternState,
435442
patternEngineName: pattern.engine.engineName,
436-
extraOutput: {}
443+
extraOutput: extraOutput
437444
});
438445

439446
//set the pattern-specific footer by compiling the general-footer with data, and then adding it to the meta footer
@@ -560,6 +567,10 @@ const patternlab_engine = function (config) {
560567

561568
patternlab.events.emit('patternlab-pattern-iteration-end', patternlab);
562569

570+
//now that all the main patterns are known, look for any links that might be within data and expand them
571+
//we need to do this before expanding patterns & partials into extendedTemplates, otherwise we could lose the data -> partial reference
572+
pattern_assembler.parse_data_links(patternlab);
573+
563574
//diveSync again to recursively include partials, filling out the
564575
//extendedTemplate property of the patternlab.patterns elements
565576
// TODO we can reduce the time needed by only processing changed patterns and their partials
@@ -569,10 +580,6 @@ const patternlab_engine = function (config) {
569580
processHeadPattern();
570581
processFootPattern();
571582

572-
//now that all the main patterns are known, look for any links that might be within data and expand them
573-
//we need to do this before expanding patterns & partials into extendedTemplates, otherwise we could lose the data -> partial reference
574-
pattern_assembler.parse_data_links(patternlab);
575-
576583
//cascade any patternStates
577584
lineage_hunter.cascade_pattern_states(patternlab);
578585

@@ -593,11 +600,6 @@ const patternlab_engine = function (config) {
593600
// rebuild all patterns
594601
let patternsToBuild = null;
595602

596-
//set the pattern-specific header by compiling the general-header with data, and then adding it to the meta header
597-
patternlab.data.patternLabHead = pattern_assembler.renderPattern(patternlab.header, {
598-
cacheBuster: patternlab.cacheBuster
599-
});
600-
601603
// If deletePatternDir == true or graph needs to be updated
602604
// rebuild all patterns
603605
patternsToBuild = null;
@@ -621,13 +623,8 @@ const patternlab_engine = function (config) {
621623
}
622624
}
623625

624-
//set the pattern-specific header by compiling the general-header with data, and then adding it to the meta header
625-
patternlab.data.patternLabHead = pattern_assembler.renderPattern(patternlab.header, {
626-
cacheBuster: patternlab.cacheBuster
627-
});
628-
629-
//render all patterns last, so lineageR works
630-
patternsToBuild.forEach(pattern => renderSinglePattern(pattern, head));
626+
//render all patterns last, so lineageR works
627+
patternsToBuild.forEach(pattern => renderSinglePattern(pattern, head));
631628

632629
// Saves the pattern graph when all files have been compiled
633630
PatternGraph.storeToFile(patternlab);

test/files/_data/listitems.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
2-
"test_list_item" : "izzn thizzle"
2+
"1": {
3+
"title": "Nullizzle shizznit velizzle, hizzle, suscipit own yo', gravida vizzle, arcu."
4+
},
5+
"2": {
6+
"title": "Veggies sunt bona vobis, proinde vos postulo"
7+
},
8+
"3": {
9+
"title": "Bacon ipsum dolor sit amet turducken strip steak beef ribs shank"
10+
}
311
}
4-

test/files/_meta/_00-head.mustache

Whitespace-only changes.

test/files/_meta/_01-foot.mustache

Whitespace-only changes.

test/files/_patterns/00-test/01-bar.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
state: complete
2+
status: complete
3+
title: An Atom Walks Into a Bar
4+
joke: bad
35
---
46
## A Simple Bit of Markup
57

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<b>a</b>
2+
{{ #a }}
3+
<i>a!</i>
4+
{{ /a }}

0 commit comments

Comments
 (0)