flora 0.7.1 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5aad0573cb2ab398c995d0c4b52df0c85b6ddad503cf25ae3a69f9c84ee59068
4
- data.tar.gz: ff36bfc9b1a12ff134c568abfa0abb0c37f75425dcb2bd75d475b47af3d46000
3
+ metadata.gz: 9cfdeb62d2aad9997eab31672eadb7eba44f8fdb0e5141b712060c96933a7fd9
4
+ data.tar.gz: a065517fc55341d1de18325cae92327fb7e596d61e11a5087ab53aa78f4d3de4
5
5
  SHA512:
6
- metadata.gz: 2c333e1169af9dcaccf7d0c9492e07659db5dde8fbbf43b1107d1e8e48beb7ca75a2606f53f0c8a7ef54a812f287e5b928729215a41390c2fe69fa3f11b76e16
7
- data.tar.gz: 8f08d99a5eccb379f715bebd480151e1a29db0ea524bd29b5c3bdef0f416934143de5103b1ed521b203f118cb18d58183d59386e391f2dd6353bc0cec7665149
6
+ metadata.gz: 64afc1b7fae62a71bbf2ef980b8efa317b5c983a04f4ec9b7548529c272490e1b26e76b7b1916d72ac4aba873361486bcaaadda6b4c60d8819e2ec389083c838
7
+ data.tar.gz: 469bf074a3d3b435c6c2dbc83eed1d533ba86cd1ebf368dafb3e6e65b963d029b9ff312db36352d3478136001827ac288b476c8775b4ed29ac83224bbba02bde
data/lib/flora/factory.rb CHANGED
@@ -13,7 +13,7 @@ class Flora::Factory
13
13
 
14
14
  @project.blueprints.each do |blueprint|
15
15
  out_filename = out_dir.join(blueprint.page_name)
16
- out_filename.dirname.mkdir unless out_filename.dirname.exist?
16
+ FileUtils.mkdir_p(out_filename.dirname) unless out_filename.dirname.exist?
17
17
  out_filename.write(blueprint.render)
18
18
  end
19
19
  end
data/lib/flora/lilac.rb CHANGED
@@ -10,14 +10,14 @@ module Flora::Lilac
10
10
  h1 h2 h3 h4 h5 h6 head header hr html i iframe img input ins
11
11
  kbd keygen
12
12
  label legend li link
13
- main map mark menu meter
13
+ main map mark menu meta meter
14
14
  nav
15
15
  object ol optgroup option output
16
16
  p param pre progress
17
17
  q
18
18
  rp rt ruby
19
- s samp section select small source span strong sub summary sup
20
- table tbody td textarea tfoot th thead time tr track
19
+ s samp script section select small source span strong style sub summary sup
20
+ table tbody td textarea title tfoot th thead time tr track
21
21
  u ul
22
22
  var video
23
23
  wbr
@@ -1,9 +1,31 @@
1
1
  module Flora::Plugins::Blog
2
2
 
3
+ class BlogPost < Flora::Project::Blueprint::Markdown
4
+
5
+ def self.recognize(file, config)
6
+ file.fnmatch?('posts/*.md')
7
+ end
8
+
9
+
10
+ def initialize(file, project)
11
+ super(file, project)
12
+
13
+ @post = Post.new(file, project.dir)
14
+ end
15
+
16
+
17
+ private
18
+
19
+ def render_tree
20
+ end
21
+
22
+ end
23
+
24
+
3
25
  module ProjectMethods
4
26
 
5
27
  def posts
6
- @dir.glob('posts/**').map { Post.new(it, @dir) }.sort_by(&:date).reverse
28
+ @dir.glob('posts/**.md').map { Post.new(it, @dir) }.sort_by(&:date).reverse
7
29
  end
8
30
 
9
31
  end
@@ -12,7 +12,7 @@ class Flora::Project::Blueprint::Markdown < Flora::Project::Blueprint
12
12
 
13
13
  def render_lilac
14
14
  silence_warnings do
15
- raw_html(Kramdown::Document.new(@file.read).to_html)
15
+ raw_html(Kramdown::Document.new(skipping_frontmatter(@file.read), input: 'GFM').to_html)
16
16
  end
17
17
  end
18
18
 
@@ -25,4 +25,10 @@ class Flora::Project::Blueprint::Markdown < Flora::Project::Blueprint
25
25
  $VERBOSE = old_verbose
26
26
  end
27
27
 
28
+
29
+ # TODO: Maybe just make frontmatter fully supported by Markdown?
30
+ def skipping_frontmatter(str)
31
+ str.gsub(/---\n(.*)---\n/m, '')
32
+ end
33
+
28
34
  end
data/lib/flora/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Flora
2
- VERSION = '0.7.1'
2
+ VERSION = '0.8.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flora
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Vladimiroff
@@ -65,6 +65,20 @@ dependencies:
65
65
  - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
+ - !ruby/object:Gem::Dependency
69
+ name: kramdown-parser-gfm
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ type: :runtime
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
68
82
  - !ruby/object:Gem::Dependency
69
83
  name: rack
70
84
  requirement: !ruby/object:Gem::Requirement