gollum-descendant_tree 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06cb486b1c6ae128ce5319526771cdf445d34718
4
- data.tar.gz: c8f7bcb22b0436bc812f35d95d580bbdd7924071
3
+ metadata.gz: 66b23bf0c11e8cd471846d737a6df11e12fed559
4
+ data.tar.gz: 9582c5487b664f4ed9ae3ea3e4cabb05bd6c2b05
5
5
  SHA512:
6
- metadata.gz: bf7882c0fdabf3243dd70f975983fe7bbdfbcce097518a1bcde119a95f9239f6bb5f4ce85c82f8e4ef08e38b8f392b504cd469713b91e29b3e11c9b558732963
7
- data.tar.gz: cacf2e357dcd7d636143234d5e163d4b1a679f03116a9424bbf2666a15071e40a30d1ddbf0c4c6c327e23b96c5be31c56c1f681af01de25d0f782bea205294c7
6
+ metadata.gz: d216f1d4754a6b76b313f068c10b1ddaead6a26201620c2aca65dd3cabeaea4469bf56ca6e1952c81664b335c0e4815002140b07e47e7582e32178193e56fea2
7
+ data.tar.gz: 6c6be5962bada2356eb59b15bf91cfe345077b9eec16bdc2942410ebbedc21e1f741e8fe70c6c942594a1900286d2177fce37f81eaa81ef6395da2bd527e29bb
data/README.md CHANGED
@@ -16,6 +16,25 @@ Or install it yourself as:
16
16
 
17
17
  $ gem install gollum-descendant_tree
18
18
 
19
+ ## Setup
20
+
21
+ Then, add to your Gollum app's `config.ru`:
22
+
23
+ require 'gollum/descendant_tree'
24
+
25
+ Create a custom markup class if you don't already have one, or just `include Gollum::DescendantTree` in your existing class.
26
+
27
+ # lib/gollum/my_markup.rb
28
+ class MyMarkup < Gollum::Markup
29
+ include Gollum::DescendantTree
30
+ end
31
+
32
+ Finally, in `config.ru`, tell Gollum to use your class instead of its default one.
33
+
34
+ Precious::App.set(:wiki_options, {
35
+ :markup_classes => { :markdown => MyMarkup }
36
+ })
37
+
19
38
  ## Usage
20
39
 
21
40
  Simply add `[[_TREE_]]` to any page of your wiki to add an unordered list of descendants to the page. If you're using custom css, you can target `ul.tree` for styling the list.
@@ -1,4 +1 @@
1
- require "gollum/descendant_tree/version"
2
- require "gollum/markup"
3
- require "gollum/descendant_tree/tree_builder"
4
- require "gollum/descendant_tree/tree_renderer"
1
+ require "gollum/descendant_tree"
@@ -1,5 +1,16 @@
1
+ require "gollum/descendant_tree/version"
2
+ require "gollum/descendant_tree/tree_builder"
3
+ require "gollum/descendant_tree/tree_renderer"
4
+
1
5
  module Gollum
2
- class Markup
6
+ module DescendantTree
7
+
8
+ def self.included(base)
9
+ base.class_eval do
10
+ alias_method :render_without_descendant_tree, :render
11
+ alias_method :render, :render_with_descendant_tree
12
+ end
13
+ end
3
14
 
4
15
  def render_with_descendant_tree (no_follow = false, encoding = nil)
5
16
  data = render_without_descendant_tree(no_follow, encoding)
@@ -9,10 +20,10 @@ module Gollum
9
20
  #[[_TREE_]] is already rendered from Markup.render
10
21
  data.gsub(rendered_tree_link, tree_renderer.render(tree))
11
22
  end
12
- alias_method :render_without_descendant_tree, :render
13
- alias_method :render, :render_with_descendant_tree
14
23
 
15
- def rendered_tree_link
24
+ private
25
+
26
+ def rendered_tree_link
16
27
  '<a class="internal absent" href="/_TREE_">_TREE_</a>'
17
28
  end
18
29
  end
@@ -1,5 +1,5 @@
1
1
  module Gollum
2
2
  module DescendantTree
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum-descendant_tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Froehlich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-31 00:00:00.000000000 Z
11
+ date: 2013-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,14 +28,14 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
@@ -96,10 +96,10 @@ files:
96
96
  - Rakefile
97
97
  - gollum-descendant_tree.gemspec
98
98
  - lib/gollum-descendant_tree.rb
99
+ - lib/gollum/descendant_tree.rb
99
100
  - lib/gollum/descendant_tree/tree_builder.rb
100
101
  - lib/gollum/descendant_tree/tree_renderer.rb
101
102
  - lib/gollum/descendant_tree/version.rb
102
- - lib/gollum/markup.rb
103
103
  - spec/lib/gollum/descendant_tree/markup_spec.rb
104
104
  - spec/lib/gollum/descendant_tree/tree_builder_spec.rb
105
105
  - spec/lib/gollum/descendant_tree/tree_renderer_spec.rb
@@ -115,12 +115,12 @@ require_paths:
115
115
  - lib
116
116
  required_ruby_version: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - ! '>='
118
+ - - '>='
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - ! '>='
123
+ - - '>='
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []