pasta 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +57 -0
  6. data/Rakefile +9 -0
  7. data/bin/pasta +40 -0
  8. data/lib/pasta.rb +18 -0
  9. data/lib/pasta/cookbook.rb +13 -0
  10. data/lib/pasta/dish.rb +62 -0
  11. data/lib/pasta/error.rb +3 -0
  12. data/lib/pasta/ingredients.rb +49 -0
  13. data/lib/pasta/ingredients/anything.rb +12 -0
  14. data/lib/pasta/ingredients/atx_headings.rb +21 -0
  15. data/lib/pasta/ingredients/automatic_links.rb +14 -0
  16. data/lib/pasta/ingredients/blockquotes.rb +23 -0
  17. data/lib/pasta/ingredients/code.rb +15 -0
  18. data/lib/pasta/ingredients/codeblocks.rb +19 -0
  19. data/lib/pasta/ingredients/emphasis.rb +14 -0
  20. data/lib/pasta/ingredients/empty_lines.rb +13 -0
  21. data/lib/pasta/ingredients/html_entities.rb +17 -0
  22. data/lib/pasta/ingredients/links.rb +58 -0
  23. data/lib/pasta/ingredients/lists.rb +31 -0
  24. data/lib/pasta/ingredients/page_breaks.rb +14 -0
  25. data/lib/pasta/ingredients/paragraphs.rb +27 -0
  26. data/lib/pasta/ingredients/setext_headings.rb +20 -0
  27. data/lib/pasta/recipes/base.rb +40 -0
  28. data/lib/pasta/recipes/gruber.rb +27 -0
  29. data/lib/pasta/recipes/markdown.rb +11 -0
  30. data/lib/pasta/version.rb +3 -0
  31. data/pasta.gemspec +24 -0
  32. data/specs/base_spec.rb +8 -0
  33. data/specs/dish_spec.rb +30 -0
  34. data/specs/dsl_spec.rb +12 -0
  35. data/specs/recipes/gruber/automatic_links.yml +12 -0
  36. data/specs/recipes/gruber/blockquotes.yml +112 -0
  37. data/specs/recipes/gruber/code.yml +48 -0
  38. data/specs/recipes/gruber/codeblocks.yml +47 -0
  39. data/specs/recipes/gruber/emphasis.yml +57 -0
  40. data/specs/recipes/gruber/gruber_spec.rb +22 -0
  41. data/specs/recipes/gruber/headers.yml +88 -0
  42. data/specs/recipes/gruber/images.yml +49 -0
  43. data/specs/recipes/gruber/links.yml +184 -0
  44. data/specs/recipes/gruber/lists.yml +171 -0
  45. data/specs/recipes/gruber/page_breaks.yml +31 -0
  46. data/specs/recipes/gruber/paragraphs.yml +44 -0
  47. data/specs/spec_helper.rb +3 -0
  48. metadata +149 -0
@@ -0,0 +1,171 @@
1
+ overview: |
2
+ Markdown supports ordered (numbered) and unordered (bulleted) lists.
3
+
4
+ Unordered lists use asterisks, pluses, and hyphens — interchangably — as list markers.
5
+
6
+ Ordered lists use numbers followed by periods.
7
+
8
+ It’s important to note that the actual numbers you use to mark the list have no effect on the HTML output Markdown produces. The point is, if you want to, you can use ordinal numbers in your ordered Markdown lists, so that the numbers in your source match the numbers in your published HTML. But if you want to be lazy, you don’t have to.
9
+
10
+ If you do use lazy list numbering, however, you should still start the list with the number 1. At some point in the future, Markdown may support starting ordered lists at an arbitrary number.
11
+
12
+ List markers typically start at the left margin, but may be indented by up to three spaces. List markers must be followed by one or more spaces or a tab.
13
+
14
+ To make lists look nice, you can wrap items with hanging indents but if you want to be lazy, you don’t have to.
15
+
16
+ --- implemented to here ---
17
+
18
+ If list items are separated by blank lines, Markdown will wrap the items in <p> tags in the HTML output.
19
+
20
+
21
+ * Bird
22
+
23
+ * Magic
24
+
25
+ will turn into:
26
+
27
+ <ul>
28
+ <li><p>Bird</p></li>
29
+ <li><p>Magic</p></li>
30
+ </ul>
31
+
32
+ List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab:
33
+
34
+ 1. This is a list item with two paragraphs. Lorem ipsum dolor
35
+ sit amet, consectetuer adipiscing elit. Aliquam hendrerit
36
+ mi posuere lectus.
37
+
38
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet
39
+ vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
40
+ sit amet velit.
41
+
42
+ 2. Suspendisse id sem consectetuer libero luctus adipiscing.
43
+
44
+ It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy:
45
+
46
+ * This is a list item with two paragraphs.
47
+
48
+ This is the second paragraph in the list item. You're
49
+ only required to indent the first line. Lorem ipsum dolor
50
+ sit amet, consectetuer adipiscing elit.
51
+
52
+ * Another item in the same list.
53
+
54
+ To put a blockquote within a list item, the blockquote’s > delimiters need to be indented:
55
+
56
+ * A list item with a blockquote:
57
+
58
+ > This is a blockquote
59
+ > inside a list item.
60
+
61
+ To put a code block within a list item, the code block needs to be indented twice — 8 spaces or two tabs:
62
+
63
+ * A list item with a code block:
64
+
65
+ <code goes here>
66
+
67
+ It’s worth noting that it’s possible to trigger an ordered list by accident, by writing something like this:
68
+
69
+ 1986. What a great season.
70
+
71
+ In other words, a number-period-space sequence at the beginning of a line. To avoid this, you can backslash-escape the period:
72
+
73
+ 1986\. What a great season.
74
+
75
+ http://daringfireball.net/projects/markdown/syntax
76
+ tests:
77
+ - name: Unordered dash lists
78
+ desc: An unordered list using dashes '-'
79
+ text: |
80
+ - Red
81
+ - Green
82
+ - Blue
83
+ html: |
84
+ <ul>
85
+ <li>Red</li>
86
+ <li>Green</li>
87
+ <li>Blue</li>
88
+ </ul>
89
+
90
+ - name: Unordered asterix lists
91
+ desc: An unordered list using asterixes '*'
92
+ text: |
93
+ * Red
94
+ * Green
95
+ * Blue
96
+ html: |
97
+ <ul>
98
+ <li>Red</li>
99
+ <li>Green</li>
100
+ <li>Blue</li>
101
+ </ul>
102
+
103
+ - name: Unordered plus lists
104
+ desc: An unordered list using pluses '+'
105
+ text: |
106
+ + Red
107
+ + Green
108
+ + Blue
109
+ html: |
110
+ <ul>
111
+ <li>Red</li>
112
+ <li>Green</li>
113
+ <li>Blue</li>
114
+ </ul>
115
+
116
+ - name: Ordered lists
117
+ desc: An ordered list using decimals
118
+ text: |
119
+ 1. Bird
120
+ 2. McHale
121
+ 3. Parish
122
+ html: |
123
+ <ol>
124
+ <li>Bird</li>
125
+ <li>McHale</li>
126
+ <li>Parish</li>
127
+ </ol>
128
+
129
+ - name: Ordered lists any order
130
+ desc: An ordered list using decimals in the wrong order
131
+ text: |
132
+ 5. Bird
133
+ 31. McHale
134
+ 3. Parish
135
+ html: |
136
+ <ol>
137
+ <li>Bird</li>
138
+ <li>McHale</li>
139
+ <li>Parish</li>
140
+ </ol>
141
+
142
+ - name: Hanging indents
143
+ desc: An unordered list with a hanging indent
144
+ text: |
145
+ * Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
146
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
147
+ viverra nec, fringilla in, laoreet vitae, risus.
148
+ * Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
149
+ Suspendisse id sem consectetuer libero luctus adipiscing.
150
+ html: |
151
+ <ul>
152
+ <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.</li>
153
+ <li>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.</li>
154
+ </ul>
155
+
156
+ - name: Non hanging indents
157
+ desc: Multiline lists without hanging indent
158
+ text: |
159
+ * Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
160
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
161
+ viverra nec, fringilla in, laoreet vitae, risus.
162
+ * Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
163
+ Suspendisse id sem consectetuer libero luctus adipiscing.
164
+ html: |
165
+ <ul>
166
+ <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
167
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
168
+ viverra nec, fringilla in, laoreet vitae, risus.</li>
169
+ <li>Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
170
+ Suspendisse id sem consectetuer libero luctus adipiscing.</li>
171
+ </ul>
@@ -0,0 +1,31 @@
1
+ overview: |
2
+ Horizontal Rules
3
+
4
+ You can produce a horizontal rule tag (<hr />) by placing three or more hyphens, asterisks, or underscores on a line by themselves. If you wish, you may use spaces between the hyphens or asterisks. Each of the following lines will produce a horizontal rule:
5
+
6
+ http://daringfireball.net/projects/markdown/syntax
7
+ tests:
8
+ - name: Asterisks
9
+ desc: Non spaced asterisks
10
+ text: "***"
11
+ html: <hr />
12
+
13
+ - name: Asterisks
14
+ desc: Non spaced asterisks
15
+ text: "**********"
16
+ html: <hr />
17
+
18
+ - name: Hyphens
19
+ desc: Non spaced hyphens
20
+ text: "---"
21
+ html: <hr />
22
+
23
+ - name: Underscores
24
+ desc: Non spaced underscores
25
+ text: "___"
26
+ html: <hr />
27
+
28
+ - name: Asterisks
29
+ desc: Spaced asterisks
30
+ text: "* * *"
31
+ html: <hr />
@@ -0,0 +1,44 @@
1
+ overview: |
2
+ A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line — a line containing nothing but spaces or tabs is considered blank.) Normal paragraphs should not be indented with spaces or tabs.
3
+
4
+ The implication of the “one or more consecutive lines of text” rule is that Markdown supports “hard-wrapped” text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type’s “Convert Line Breaks” option) which translate every line break character in a paragraph into a <br /> tag.
5
+
6
+ When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return.
7
+
8
+ Yes, this takes a tad more effort to create a <br />, but a simplistic “every line break is a <br />” rule wouldn’t work for Markdown. Markdown’s email-style blockquoting and multi-paragraph list items work best — and look better — when you format them with hard breaks.
9
+
10
+ http://daringfireball.net/projects/markdown/syntax
11
+ tests:
12
+ - name: Single Line
13
+ desc: A single line of text
14
+ text: 'This is a paragraph.'
15
+ html: '<p>This is a paragraph.</p>'
16
+
17
+ - name: Double Line
18
+ desc: A double line of text
19
+ text: |
20
+ This is the first line.
21
+ And this is the second.
22
+ html: |
23
+ <p>This is the first line.
24
+ And this is the second.</p>
25
+
26
+ - name: Double Line with trailing spaces
27
+ desc: A double line of text with trailing spaces to create a <br />
28
+ text: |
29
+ This is the first line.
30
+ And this is the second.
31
+ html: |
32
+ <p>This is the first line.<br />
33
+ And this is the second.</p>
34
+
35
+ - name: Two Paragraphs
36
+ desc: Two lines of text separated by a blank line
37
+ text: |
38
+ This is the first line.
39
+
40
+ And this is the second.
41
+ html: |
42
+ <p>This is the first line.</p>
43
+
44
+ <p>And this is the second.</p>
@@ -0,0 +1,3 @@
1
+ require 'minitest/autorun'
2
+ require 'pasta'
3
+ require 'yaml'
metadata ADDED
@@ -0,0 +1,149 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pasta
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Dave Kinkead
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-07-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: markdown-testsuite
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: À la carte markdown parsing
56
+ email:
57
+ - dave@kinkead.com.au
58
+ executables:
59
+ - pasta
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - .gitignore
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - bin/pasta
69
+ - lib/pasta.rb
70
+ - lib/pasta/cookbook.rb
71
+ - lib/pasta/dish.rb
72
+ - lib/pasta/error.rb
73
+ - lib/pasta/ingredients.rb
74
+ - lib/pasta/ingredients/anything.rb
75
+ - lib/pasta/ingredients/atx_headings.rb
76
+ - lib/pasta/ingredients/automatic_links.rb
77
+ - lib/pasta/ingredients/blockquotes.rb
78
+ - lib/pasta/ingredients/code.rb
79
+ - lib/pasta/ingredients/codeblocks.rb
80
+ - lib/pasta/ingredients/emphasis.rb
81
+ - lib/pasta/ingredients/empty_lines.rb
82
+ - lib/pasta/ingredients/html_entities.rb
83
+ - lib/pasta/ingredients/links.rb
84
+ - lib/pasta/ingredients/lists.rb
85
+ - lib/pasta/ingredients/page_breaks.rb
86
+ - lib/pasta/ingredients/paragraphs.rb
87
+ - lib/pasta/ingredients/setext_headings.rb
88
+ - lib/pasta/recipes/base.rb
89
+ - lib/pasta/recipes/gruber.rb
90
+ - lib/pasta/recipes/markdown.rb
91
+ - lib/pasta/version.rb
92
+ - pasta.gemspec
93
+ - specs/base_spec.rb
94
+ - specs/dish_spec.rb
95
+ - specs/dsl_spec.rb
96
+ - specs/recipes/gruber/automatic_links.yml
97
+ - specs/recipes/gruber/blockquotes.yml
98
+ - specs/recipes/gruber/code.yml
99
+ - specs/recipes/gruber/codeblocks.yml
100
+ - specs/recipes/gruber/emphasis.yml
101
+ - specs/recipes/gruber/gruber_spec.rb
102
+ - specs/recipes/gruber/headers.yml
103
+ - specs/recipes/gruber/images.yml
104
+ - specs/recipes/gruber/links.yml
105
+ - specs/recipes/gruber/lists.yml
106
+ - specs/recipes/gruber/page_breaks.yml
107
+ - specs/recipes/gruber/paragraphs.yml
108
+ - specs/spec_helper.rb
109
+ homepage: https://github.com/davekinkead
110
+ licenses:
111
+ - MIT
112
+ metadata: {}
113
+ post_install_message:
114
+ rdoc_options: []
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - '>='
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - '>='
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ requirements: []
128
+ rubyforge_project:
129
+ rubygems_version: 2.0.2
130
+ signing_key:
131
+ specification_version: 4
132
+ summary: Pasta is an extensible markdown text parser with a delicious menu of options
133
+ test_files:
134
+ - specs/base_spec.rb
135
+ - specs/dish_spec.rb
136
+ - specs/dsl_spec.rb
137
+ - specs/recipes/gruber/automatic_links.yml
138
+ - specs/recipes/gruber/blockquotes.yml
139
+ - specs/recipes/gruber/code.yml
140
+ - specs/recipes/gruber/codeblocks.yml
141
+ - specs/recipes/gruber/emphasis.yml
142
+ - specs/recipes/gruber/gruber_spec.rb
143
+ - specs/recipes/gruber/headers.yml
144
+ - specs/recipes/gruber/images.yml
145
+ - specs/recipes/gruber/links.yml
146
+ - specs/recipes/gruber/lists.yml
147
+ - specs/recipes/gruber/page_breaks.yml
148
+ - specs/recipes/gruber/paragraphs.yml
149
+ - specs/spec_helper.rb