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 +4 -4
- data/README.md +19 -0
- data/lib/gollum-descendant_tree.rb +1 -4
- data/lib/gollum/{markup.rb → descendant_tree.rb} +15 -4
- data/lib/gollum/descendant_tree/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66b23bf0c11e8cd471846d737a6df11e12fed559
|
4
|
+
data.tar.gz: 9582c5487b664f4ed9ae3ea3e4cabb05bd6c2b05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,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
|
-
|
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
|
-
|
24
|
+
private
|
25
|
+
|
26
|
+
def rendered_tree_link
|
16
27
|
'<a class="internal absent" href="/_TREE_">_TREE_</a>'
|
17
28
|
end
|
18
29
|
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.
|
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-
|
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: []
|