You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* annotations exporter - built with TDD
* annotations.md parsing with tests
* merge both annotations formats.
covers the majority of pattern-lab/edition-node-gulp#12
console.log('annotations.md file not formatted as expected. Error parsing frontmatter and markdown out of '+annotationSnippet);
84
+
}
85
+
}
86
+
returnannotations;
27
87
}
28
88
29
89
functiongatherAnnotations(){
30
-
//todo: merge markdown too https://github.com/pattern-lab/patternlab-php-core/blob/c2c4bc6a8bda2b2f9c08b197669ebc94c025e7c6/src/PatternLab/Annotations.php
'converts old JS annotations into new format': function(test){
27
+
//arrange
28
+
//act
29
+
varannotations=ae.gatherJS();
30
+
31
+
//assert
32
+
test.equals(annotations.length,2);
33
+
test.equals(annotations[1].el,'.logo');
34
+
test.equals(annotations[1].title,'Logo');
35
+
test.equals(annotations[1].comment,"The logo image is an SVG file, which ensures that the logo displays crisply even on high resolution displays. A PNG fallback is provided for browsers that don't support SVG images.</p><p>Further reading: <a href=\"http://bradfrostweb.com/blog/mobile/hi-res-optimization/\">Optimizing Web Experiences for High Resolution Screens</a></p>");
36
+
37
+
test.done();
38
+
},
39
+
40
+
'converts new markdown annotations into an array': function(test){
41
+
//arrange
42
+
//act
43
+
varannotations=ae.gatherMD();
44
+
45
+
//assert
46
+
test.equals(annotations.length,3);
47
+
test.equals(annotations[1].el,'.logo');
48
+
test.equals(annotations[1].title,'Logo');
49
+
test.equals(annotations[1].comment.replace(/\r?\n|\r/gm,""),'<p>The <em>logo image</em> is an SVG file.</p>');
50
+
51
+
test.done();
52
+
},
53
+
54
+
'merges both annotation methods into one array' : function(test){
55
+
//arrange
56
+
57
+
//act
58
+
varannotations=ae.gather();
59
+
60
+
//assert
61
+
test.equals(annotations.length,3);
62
+
test.equals(annotations[2].el,'#nav');
63
+
test.equals(annotations[2].title,'Navigation');
64
+
test.equals(annotations[2].comment.replace(/\r?\n|\r/gm,""),'<p>Navigation for adaptive web experiences can be tricky. Refer to <a href="https://bradfrost.github.io/this-is-responsive/patterns.html#navigation">these repsonsive patterns</a> when evaluating solutions.</p>');
"comment": "The main header of the site doesn't take up too much screen real estate in order to keep the focus on the core content. It's using a linear CSS gradient instead of a background image to give greater design flexibility and reduce HTTP requests."
7
+
},
8
+
{
9
+
"el": ".logo",
10
+
"title" : "Logo",
11
+
"comment": "The logo image is an SVG file, which ensures that the logo displays crisply even on high resolution displays. A PNG fallback is provided for browsers that don't support SVG images.</p><p>Further reading: <a href=\"http://bradfrostweb.com/blog/mobile/hi-res-optimization/\">Optimizing Web Experiences for High Resolution Screens</a></p>"
The main header of the site doesn't take up *too much screen real estate* in order to keep the focus on the core content.
6
+
It's using a linear CSS gradient instead of a background image to give greater design flexibility and reduce HTTP requests.
7
+
~*~
8
+
---
9
+
selector: ".logo"
10
+
title: "Logo"
11
+
---
12
+
The _logo image_ is an SVG file.
13
+
~*~
14
+
---
15
+
el: "#nav"
16
+
title : "Navigation"
17
+
---
18
+
Navigation for adaptive web experiences can be tricky. Refer to [these repsonsive patterns](https://bradfrost.github.io/this-is-responsive/patterns.html#navigation) when evaluating solutions.
0 commit comments