guard-toc 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -3
- data/guard-toc.gemspec +2 -2
- data/lib/guard/toc/templates/index.html.erb +11 -0
- data/lib/guard/toc/version.rb +1 -1
- metadata +12 -9
- data/lib/guard/toc/templates/README.md +0 -45
data/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# Guard::Toc #
|
2
|
-
Toc guard will watch a folder for changes and add each of the files in the specified folder to a specified file as links.
|
2
|
+
Toc guard will watch a folder for changes and add each of the files in the specified folder to a specified file as links... sort of like a table of contents, hence the name 'guard-toc'.
|
3
3
|
|
4
4
|
## Install ##
|
5
5
|
|
6
|
-
You'
|
6
|
+
You'll need [Guard](https://github.com/guard/guard) first.
|
7
7
|
|
8
|
-
|
8
|
+
Once you have guard, install this gem with
|
9
9
|
|
10
10
|
$ gem install guard-toc
|
11
11
|
|
@@ -20,6 +20,7 @@ Go see the [Guard usage doc](https://github.com/guard/guard#readme) for general
|
|
20
20
|
## The Guardfile - where the magic happens
|
21
21
|
|
22
22
|
The Guardfile is where you define your desired input and output paths.
|
23
|
+
|
23
24
|
Create it with:
|
24
25
|
|
25
26
|
$ guard init toc
|
data/guard-toc.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.authors = ["Jon Kinney"]
|
9
9
|
s.email = ["jonkinney@gmail.com"]
|
10
10
|
s.homepage = "https://github.com/j2fly/guard-toc"
|
11
|
-
s.summary = %q{
|
12
|
-
s.description = %q{Watches a
|
11
|
+
s.summary = %q{Build html file linking to all other files in a specified dir like a table of contents.}
|
12
|
+
s.description = %q{Watches a specified folder of html files and creates an html file containing links to each file in the specified folder (like a table of contents). You can optionally pass an erb template for formatting the output. This gem is heavily inspired by the guard-markdown gem.}
|
13
13
|
|
14
14
|
s.rubyforge_project = "guard-toc"
|
15
15
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<link rel='stylesheet' href='../stylesheets/gh-like.css' type='text/css' media='screen'>
|
5
|
+
</head>
|
6
|
+
<body>
|
7
|
+
<img src='../images/logo.png' style='float:right;' />
|
8
|
+
<div style='clear:both;'></div>
|
9
|
+
<%= @body %>
|
10
|
+
</body>
|
11
|
+
</html>
|
data/lib/guard/toc/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-toc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-02-01 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: guard
|
16
|
-
requirement: &
|
16
|
+
requirement: &70356413289180 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.2.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70356413289180
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: kramdown
|
27
|
-
requirement: &
|
27
|
+
requirement: &70356413287500 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,9 +32,11 @@ dependencies:
|
|
32
32
|
version: 0.13.3
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
36
|
-
description: Watches a
|
37
|
-
|
35
|
+
version_requirements: *70356413287500
|
36
|
+
description: Watches a specified folder of html files and creates an html file containing
|
37
|
+
links to each file in the specified folder (like a table of contents). You can optionally
|
38
|
+
pass an erb template for formatting the output. This gem is heavily inspired by
|
39
|
+
the guard-markdown gem.
|
38
40
|
email:
|
39
41
|
- jonkinney@gmail.com
|
40
42
|
executables: []
|
@@ -49,7 +51,7 @@ files:
|
|
49
51
|
- guard-toc.gemspec
|
50
52
|
- lib/guard/toc.rb
|
51
53
|
- lib/guard/toc/templates/Guardfile
|
52
|
-
- lib/guard/toc/templates/
|
54
|
+
- lib/guard/toc/templates/index.html.erb
|
53
55
|
- lib/guard/toc/version.rb
|
54
56
|
homepage: https://github.com/j2fly/guard-toc
|
55
57
|
licenses: []
|
@@ -74,5 +76,6 @@ rubyforge_project: guard-toc
|
|
74
76
|
rubygems_version: 1.8.10
|
75
77
|
signing_key:
|
76
78
|
specification_version: 3
|
77
|
-
summary:
|
79
|
+
summary: Build html file linking to all other files in a specified dir like a table
|
80
|
+
of contents.
|
78
81
|
test_files: []
|
@@ -1,45 +0,0 @@
|
|
1
|
-
# Guard::Toc #
|
2
|
-
Toc guard will watch a folder for changes and add each of the files in the specified folder to a specified file as links.
|
3
|
-
|
4
|
-
## Install ##
|
5
|
-
|
6
|
-
You're going to need [Guard](https://github.com/guard/guard) too.
|
7
|
-
|
8
|
-
Install with
|
9
|
-
|
10
|
-
$ gem install guard-toc
|
11
|
-
|
12
|
-
Or add it to your Gemfile
|
13
|
-
|
14
|
-
gem 'guard-toc'
|
15
|
-
|
16
|
-
## Usage ##
|
17
|
-
|
18
|
-
Go see the [Guard usage doc](https://github.com/guard/guard#readme) for general instructions
|
19
|
-
|
20
|
-
## The Guardfile - where the magic happens
|
21
|
-
|
22
|
-
The Guardfile is where you define your desired input and output paths.
|
23
|
-
Create it with:
|
24
|
-
|
25
|
-
$ guard init toc
|
26
|
-
|
27
|
-
Then tweak the watch statements to your hearts content. It'll look a lot like this:
|
28
|
-
|
29
|
-
guard 'toc', :convert_on_start => true, :dry_run => true do
|
30
|
-
# Will not convert while :dry_run is true. Once you're happy with your watch statements remove it
|
31
|
-
watch (/source_dir\/(.+\/)*(.+\.)(html_or_other_extension)/i) {"input_dir|output_dir|output_file|path_to_optional_template.html.erb"}
|
32
|
-
end
|
33
|
-
|
34
|
-
The guard statement defines which guard your configuring and sets any optional parameters.
|
35
|
-
|
36
|
-
* :convert_on_start - if true will run all conversions when you start the guard. Defaults to true
|
37
|
-
* :dry_run - if true won't actually run the conversion process, but it will output the files being watched and the file it would write to. Use it to tweak your watch statements and when you're happy set it to false.
|
38
|
-
|
39
|
-
## Have Fun ##
|
40
|
-
|
41
|
-
Go see the other [great guards available](https://github.com/guard/guard/wiki/List-of-available-Guards)
|
42
|
-
|
43
|
-
# TODO #
|
44
|
-
|
45
|
-
* Test
|