textigniter 0.0.33 → 0.0.34

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ title: User Guide
2
+ layout: userguide/userguide
3
+ -- content
4
+ Textigniter is a command line tool used to generate static websites. Textigniter uses the power of "Textile":http://redcloth.org/ ("Markdown":http://kramdown.rubyforge.org/ is optional...), "Liquid":http://liquidmarkup.org/, "LESS CSS":http://lesscss.org/, and "Coffee Script":http://jashkenas.github.com/coffee-script/ for parsing different files and outputting "HTML5":http://www.html5rocks.com/en/ powered websites (Obviously you'll need to know HTML5, textigniter just helps with a development philosophy).
@@ -0,0 +1,6 @@
1
+ title: Textigniter 0.0.3
2
+ blog: userguide
3
+ layout: userguide/userguide
4
+ created_at: 2011-11-18
5
+ -- content
6
+ h3. Changes
@@ -0,0 +1,6 @@
1
+ title: Textigniter 0.0.31
2
+ blog: userguide
3
+ layout: userguide/userguide
4
+ created_at: 2011-11-18
5
+ -- content
6
+ h3. Changes
@@ -0,0 +1,6 @@
1
+ title: Textigniter 0.0.32
2
+ blog: userguide
3
+ layout: userguide/userguide
4
+ created_at: 2011-11-19
5
+ -- content
6
+ h3. Changes
@@ -0,0 +1,6 @@
1
+ title: Textigniter 0.0.33
2
+ blog: userguide
3
+ layout: userguide/userguide
4
+ created_at: 2011-11-20
5
+ -- content
6
+ h3. Changes
@@ -0,0 +1,50 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Textigniter - {{ title }}</title>
5
+ <link rel="stylesheet" media="screen" href="{{ site_url }}/styles/userguide.css">
6
+ </head>
7
+ <body>
8
+
9
+ <div id="wrapper">
10
+
11
+ <div id="header">
12
+
13
+ <h1><a href="{{ site_url }}/userguide">Textigniter User Guide</a></h1>
14
+
15
+ </div><!--/header-->
16
+
17
+ <div id="container">
18
+
19
+ <div id="content">
20
+
21
+ <h3>{{ title }}</h3>
22
+
23
+ {{ content }}
24
+
25
+ </div><!--/content-->
26
+
27
+ <div id="sidebar">
28
+
29
+ <h3>Change Log</h3>
30
+
31
+ {% for item in userguide %}
32
+
33
+ <p><a href="{{ site_url }}/{{ item.handle }}">{{ item.title }}</a></p>
34
+
35
+ {% endfor %}
36
+
37
+ </div><!--/sidebar-->
38
+
39
+ </div><!--/container-->
40
+
41
+ <div id="footer">
42
+
43
+ <p>Textigniter &copy; 2011</p>
44
+
45
+ </div><!--/footer-->
46
+
47
+ </div><!--/wrapper-->
48
+
49
+ </body>
50
+ </html>
@@ -0,0 +1,73 @@
1
+ /** Typography and Colors
2
+ */
3
+ body {
4
+ background: #fff;
5
+ font-family: Arial, sans-serif;
6
+ font-size: 14px;
7
+ line-height: 20px;
8
+ color: #777;
9
+ margin: 0 20px;
10
+ }
11
+ h1,h2,h3 {
12
+ font-family: "Verdana", sans-serif;
13
+ font-weight: 600;
14
+ }
15
+ a {
16
+ color: #dc974d;
17
+ text-decoration: none;
18
+ }
19
+
20
+ /** Wrapper
21
+ */
22
+ #wrapper {
23
+
24
+ /** Header
25
+ */
26
+ #header {
27
+
28
+ padding: 20px;
29
+ width: 760px;
30
+
31
+ h1 {
32
+ font-size: 32px;
33
+ }
34
+ h1 a {
35
+ color: #777
36
+ }
37
+
38
+ }
39
+
40
+ /** Container
41
+ */
42
+ #container {
43
+
44
+ width: 760px;
45
+ padding: 20px;
46
+ background: #efefef;
47
+ border: 1px solid #ddd;
48
+ overflow: hidden;
49
+
50
+ /** Content
51
+ */
52
+ #content {
53
+ float: left;
54
+ width: 500px;
55
+ margin-right: 40px;
56
+ }
57
+
58
+ /** Sidebar
59
+ */
60
+ #sidebar {
61
+ float: right;
62
+ width: 220px;
63
+ }
64
+
65
+ }
66
+
67
+ /** Footer
68
+ */
69
+ #footer {
70
+ width: 760px;
71
+ padding: 20px;
72
+ }
73
+ }
@@ -1,6 +1,7 @@
1
1
  # site configuration
2
2
  site_name: "Textigniter"
3
3
  site_description: "A textigniter powered website"
4
+ site_url: "http://localhost/textigniter/output"
4
5
  copyright: "2011 &copy; Textigniter"
5
6
 
6
7
  # textigniter configuration
@@ -0,0 +1,28 @@
1
+ class Textigniter::Build::BlogParser
2
+
3
+ def parse(blogs)
4
+ # blog keys
5
+ blog_keys = Hash.new
6
+ # create blog keys
7
+ blogs.each do |item|
8
+ blog_keys["#{item['blog']}"] = nil
9
+ end
10
+ # iterate through blog keys and assign appropriate posts
11
+ blog_keys.each do |key,value|
12
+ # create a blog item list
13
+ blog_items = Array.new
14
+ # iterate through blogs
15
+ blogs.each do |item|
16
+ # match keys
17
+ if item['blog'] == key
18
+ # push the item
19
+ blog_items.push item
20
+ end
21
+ end
22
+ blog_keys["#{key}"] = blog_items
23
+ end
24
+ # return the blogs keyed with correct info
25
+ return blog_keys
26
+ end
27
+
28
+ end
@@ -9,11 +9,11 @@ class Textigniter::Build::TemplateParser
9
9
  # iterate through the item list and parse templates
10
10
  item_list['items'].each do |item|
11
11
  # specifiy the template
12
- file = File.open(Dir::pwd + "/.textigniter/layouts/" + item['template'] + '.liquid', 'rb')
12
+ file = File.open(Dir::pwd + "/.textigniter/layouts/" + item['layout'] + '.liquid', 'rb')
13
13
  # load the template
14
14
  template_from_file = file.read
15
15
  # render the output
16
- item['output'] = parse(template_from_file, item, item_list['articles'])
16
+ item['output'] = parse(template_from_file, item, item_list['blogs'])
17
17
  # push the item onto the array
18
18
  items.push item
19
19
  end
@@ -21,16 +21,18 @@ class Textigniter::Build::TemplateParser
21
21
  return items
22
22
  end
23
23
 
24
- def parse(content, item, articles)
25
- # check for blog posts
26
- if item['type'] == $config['blog_type']
27
- # set a key with all articles
28
- item['articles'] = articles
24
+ def parse(layout_file, item, blogs)
25
+ # merge item and blogs if item has blog key
26
+ # if item.has_key? 'blog'
27
+ blogs.each do |key, value|
28
+ item["#{key}"] = value
29
29
  end
30
+ # end
31
+
30
32
  # require liquid lib
31
33
  require 'liquid'
32
34
  #parse the template
33
- template = Liquid::Template.parse(content)
35
+ template = Liquid::Template.parse(layout_file)
34
36
  # render the template
35
37
  output = template.render(item)
36
38
  # return the output
@@ -14,7 +14,7 @@ class Textigniter::Build::TextParser
14
14
  # create array to store processed items in
15
15
  items = Array.new
16
16
  # create an articles array for blog items
17
- articles = Array.new
17
+ blogs = Array.new
18
18
  # go through the build list and process
19
19
  build_list.each do |f|
20
20
 
@@ -48,7 +48,7 @@ class Textigniter::Build::TextParser
48
48
  @h['slug'] = "#{File.dirname(f)}/#{File.basename(f, ".#{$config['text_parser']}")}" unless @h.has_key? 'slug'
49
49
 
50
50
  # get the template if exists else default
51
- @h['template'] = 'default' unless @h.has_key? 'template'
51
+ @h['layout'] = 'default' unless @h.has_key? 'layout'
52
52
 
53
53
  # gather the rest of the components into key value and convert
54
54
  @h = components_parser(components, @h)
@@ -60,14 +60,12 @@ class Textigniter::Build::TextParser
60
60
  @h['directory'] = @h['slug']
61
61
 
62
62
  # delete the slug key after its been renamed to directory
63
- @h.delete("slug")
63
+ @h["handle"] = @h['slug'].sub($owd, '')[1..-1]
64
64
 
65
65
  # check if blog posts according to the type key
66
66
  # I feel like there is probably a better way to do this.
67
- if @h.has_key? 'type'
68
- if @h['type'] == $config['blog_type']
69
- articles.push @h
70
- end
67
+ if @h.has_key? 'blog'
68
+ blogs.push @h
71
69
  end
72
70
 
73
71
  # push processed item onto the array
@@ -79,9 +77,12 @@ class Textigniter::Build::TextParser
79
77
 
80
78
  # store files to process
81
79
  @results['items'] = items
82
-
80
+
81
+ # initialize a blog parser
82
+ blog_parser = Textigniter::Build::BlogParser.new
83
+
83
84
  # store blog posts to separate key
84
- @results['articles'] = articles
85
+ @results['blogs'] = blog_parser.parse(blogs)
85
86
 
86
87
  # return the items
87
88
  return @results
@@ -131,4 +132,5 @@ end
131
132
 
132
133
  # requirements
133
134
  require 'date'
135
+ require_relative '../build/blog_parser'
134
136
  require_relative '../plugins'
@@ -23,8 +23,8 @@ class Textigniter::Plugins::Slug
23
23
  # check for path name
24
24
  slug = "#{$owd}/#{slug}" unless slug.include? $twd
25
25
 
26
- # check for content/index
27
- slug = slug.sub('content/index', 'content')
26
+ # check for index
27
+ slug = slug.sub('index', '')
28
28
 
29
29
  # replace twd with owd
30
30
  slug = slug.sub("#{$twd}/content", "#{$owd}")
data/textigniter.gemspec CHANGED
@@ -2,13 +2,13 @@ Gem::Specification.new do |s|
2
2
  s.rubygems_version = '1.9.2'
3
3
 
4
4
  s.name = 'textigniter'
5
- s.version = '0.0.33'
5
+ s.version = '0.0.34'
6
6
  s.executables << 'textigniter'
7
7
  s.date = '2011-11-19'
8
8
 
9
9
  s.summary = 'A static site generator'
10
10
  s.description = <<-EOF
11
- Textigniter is a lightweight static site generator based on textile (markdown optional), liquid, less, and coffeescript. There are no plans for textigniter to support other parsers. Keeping it clean yet powerful.
11
+ Textigniter is a lightweight static site generator based on textile (markdown optional), liquid, less, and coffeescript. You can have as many blogs as you want and use your own custom meta tags in templates without having to write plugins for them (You can however write plugins to add more power to your text-based information)
12
12
  EOF
13
13
 
14
14
  s.authors = ["Kaleb Heitzman"]
@@ -33,16 +33,16 @@ Gem::Specification.new do |s|
33
33
  lib/skeleton/README.textile
34
34
  lib/skeleton/config.yml
35
35
  lib/skeleton/.textigniter/content/index.textile
36
- lib/skeleton/.textigniter/content/about.textile
37
- lib/skeleton/.textigniter/content/articles/2011-11-01-post-one.textile
38
- lib/skeleton/.textigniter/content/articles/2011-11-02-post-two.textile
39
- lib/skeleton/.textigniter/content/articles/2011-11-03-post-three.textile
36
+ lib/skeleton/.textigniter/content/userguide/index.textile
37
+ lib/skeleton/.textigniter/content/userguide/textigniter-0.0.3.textile
38
+ lib/skeleton/.textigniter/content/userguide/textigniter-0.0.31.textile
39
+ lib/skeleton/.textigniter/content/userguide/textigniter-0.0.32.textile
40
+ lib/skeleton/.textigniter/content/userguide/textigniter-0.0.33.textile
40
41
  lib/skeleton/.textigniter/scripts/functions.coffeescript
41
42
  lib/skeleton/.textigniter/styles/style.less
42
- lib/skeleton/.textigniter/layouts/about.liquid
43
- lib/skeleton/.textigniter/layouts/blog.liquid
43
+ lib/skeleton/.textigniter/styles/userguide.less
44
44
  lib/skeleton/.textigniter/layouts/default.liquid
45
- lib/skeleton/.textigniter/layouts/partials
45
+ lib/skeleton/.textigniter/layouts/userguide/userguide.liquid
46
46
  lib/skeleton/plugins/README.textile
47
47
  lib/textigniter.rb
48
48
  lib/textigniter/build.rb
@@ -50,6 +50,7 @@ Gem::Specification.new do |s|
50
50
  lib/textigniter/init.rb
51
51
  lib/textigniter/plugins.rb
52
52
  lib/textigniter/scrub.rb
53
+ lib/textigniter/build/blog_parser.rb
53
54
  lib/textigniter/build/render_files.rb
54
55
  lib/textigniter/build/script_parser.rb
55
56
  lib/textigniter/build/style_parser.rb
@@ -57,9 +58,6 @@ Gem::Specification.new do |s|
57
58
  lib/textigniter/build/text_parser.rb
58
59
  lib/textigniter/plugins/created_at.rb
59
60
  lib/textigniter/plugins/slug.rb
60
- lib/textigniter/plugins/type.rb
61
- lib/textigniter/plugins/tags.rb
62
- lib/textigniter/plugins/twitter.rb
63
61
  ]
64
62
  # = MANIFEST =
65
63
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: textigniter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33
4
+ version: 0.0.34
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-11-19 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: RedCloth
16
- requirement: &70119255384020 !ruby/object:Gem::Requirement
16
+ requirement: &70244492864240 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 4.2.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70119255384020
24
+ version_requirements: *70244492864240
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: kramdown
27
- requirement: &70119255382600 !ruby/object:Gem::Requirement
27
+ requirement: &70244492863600 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.13.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70119255382600
35
+ version_requirements: *70244492863600
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: liquid
38
- requirement: &70119255380940 !ruby/object:Gem::Requirement
38
+ requirement: &70244492863020 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.3.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70119255380940
46
+ version_requirements: *70244492863020
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: less
49
- requirement: &70119255380280 !ruby/object:Gem::Requirement
49
+ requirement: &70244492862140 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 2.0.0
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70119255380280
57
+ version_requirements: *70244492862140
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: coffee-script
60
- requirement: &70119255379760 !ruby/object:Gem::Requirement
60
+ requirement: &70244492860980 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 2.2.0
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70119255379760
68
+ version_requirements: *70244492860980
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: colored
71
- requirement: &70119255379000 !ruby/object:Gem::Requirement
71
+ requirement: &70244492860180 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,12 @@ dependencies:
76
76
  version: '1.0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70119255379000
79
+ version_requirements: *70244492860180
80
80
  description: ! " Textigniter is a lightweight static site generator based on textile
81
- (markdown optional), liquid, less, and coffeescript. There are no plans for textigniter
82
- to support other parsers. Keeping it clean yet powerful. \n"
81
+ (markdown optional), liquid, less, and coffeescript. You can have as many blogs
82
+ as you want and use your own custom meta tags in templates without having to write
83
+ plugins for them (You can however write plugins to add more power to your text-based
84
+ information) \n"
83
85
  email: jkheitzman@gmail.com
84
86
  executables:
85
87
  - textigniter
@@ -95,15 +97,16 @@ files:
95
97
  - lib/skeleton/README.textile
96
98
  - lib/skeleton/config.yml
97
99
  - lib/skeleton/.textigniter/content/index.textile
98
- - lib/skeleton/.textigniter/content/about.textile
99
- - lib/skeleton/.textigniter/content/articles/2011-11-01-post-one.textile
100
- - lib/skeleton/.textigniter/content/articles/2011-11-02-post-two.textile
101
- - lib/skeleton/.textigniter/content/articles/2011-11-03-post-three.textile
100
+ - lib/skeleton/.textigniter/content/userguide/index.textile
101
+ - lib/skeleton/.textigniter/content/userguide/textigniter-0.0.3.textile
102
+ - lib/skeleton/.textigniter/content/userguide/textigniter-0.0.31.textile
103
+ - lib/skeleton/.textigniter/content/userguide/textigniter-0.0.32.textile
104
+ - lib/skeleton/.textigniter/content/userguide/textigniter-0.0.33.textile
102
105
  - lib/skeleton/.textigniter/scripts/functions.coffeescript
103
106
  - lib/skeleton/.textigniter/styles/style.less
104
- - lib/skeleton/.textigniter/layouts/about.liquid
105
- - lib/skeleton/.textigniter/layouts/blog.liquid
107
+ - lib/skeleton/.textigniter/styles/userguide.less
106
108
  - lib/skeleton/.textigniter/layouts/default.liquid
109
+ - lib/skeleton/.textigniter/layouts/userguide/userguide.liquid
107
110
  - lib/skeleton/plugins/README.textile
108
111
  - lib/textigniter.rb
109
112
  - lib/textigniter/build.rb
@@ -111,6 +114,7 @@ files:
111
114
  - lib/textigniter/init.rb
112
115
  - lib/textigniter/plugins.rb
113
116
  - lib/textigniter/scrub.rb
117
+ - lib/textigniter/build/blog_parser.rb
114
118
  - lib/textigniter/build/render_files.rb
115
119
  - lib/textigniter/build/script_parser.rb
116
120
  - lib/textigniter/build/style_parser.rb
@@ -118,9 +122,6 @@ files:
118
122
  - lib/textigniter/build/text_parser.rb
119
123
  - lib/textigniter/plugins/created_at.rb
120
124
  - lib/textigniter/plugins/slug.rb
121
- - lib/textigniter/plugins/type.rb
122
- - lib/textigniter/plugins/tags.rb
123
- - lib/textigniter/plugins/twitter.rb
124
125
  - LICENSE
125
126
  homepage: http://github.com/kalebheitzman/textigniter
126
127
  licenses:
@@ -1,7 +0,0 @@
1
- title: About
2
- slug: about
3
- template: about
4
- -- content
5
- This is a sample about page generated by "textigniter":http://github.com/kalebheitzman/textigniter
6
- -- sidebar
7
- This could be a bit of sidebar content
@@ -1,6 +0,0 @@
1
- title: Post One
2
- created_at: 2011-11-01T15:00:00
3
- type: article
4
- template: blog
5
- -- content
6
- This is a sample blog post
@@ -1,4 +0,0 @@
1
- title: Post Two
2
- type: article
3
- -- content
4
- This is a sample blog post
@@ -1,4 +0,0 @@
1
- title: Post One
2
- type: article
3
- -- content
4
- This is a sample blog post
@@ -1,11 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>{{ title }}</title>
5
- </head>
6
- <body>
7
- {{ content }}
8
-
9
- {{ sidebar }}
10
- </body>
11
- </html>
@@ -1,21 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>{{ title }}</title>
5
- </head>
6
- <body>
7
-
8
- <h1>{{ title }}</h1>
9
-
10
- {{ content }}
11
-
12
- <h2>Other entries</h2>
13
-
14
- {% for article in articles %}
15
-
16
- <h3>{{ article.title }}</h3>
17
-
18
- {% endfor %}
19
-
20
- </body>
21
- </html>
@@ -1,12 +0,0 @@
1
- class Textigniter::Plugins::Tags
2
-
3
- def initialize
4
-
5
- end
6
-
7
- def parse(value)
8
-
9
- return value
10
- end
11
-
12
- end
@@ -1,12 +0,0 @@
1
- class Textigniter::Plugins::Twitter
2
-
3
- def initialize
4
-
5
- end
6
-
7
- def parse(value)
8
-
9
- return value
10
- end
11
-
12
- end
@@ -1,12 +0,0 @@
1
- class Textigniter::Plugins::Type
2
-
3
- def initialize
4
-
5
- end
6
-
7
- def parse(value)
8
-
9
- return value
10
- end
11
-
12
- end