docface 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/docface.gemspec +2 -2
- data/lib/docface/base.rb +16 -10
- data/lib/docface/cli.rb +7 -2
- data/lib/docface/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzE1N2UwNjNlZjFhNGFlMjQzZmFjN2EwMTZlMGMzMDJkNGJiYjlhZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTIzNzYxYjlmNDExYjVkMmJiNjMwMDFkNGYwNWYwZDU1NDJkYmU5NQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTEwZjc5N2M4ZmYwZWJkZTVmYzk3OGM5ZmM0YjQzZjA2N2JkMDNmMzVhNDM3
|
10
|
+
MmM3ZjRlNjI4ZjkzYzQwNGY5OTk3MWQ4ODk4NTk4MTNiZjQzYTAxODc3ZTA4
|
11
|
+
NjM3ODJhZjAyYjE4NmFjMGM0ZjI3ZWVlMDliZmM5Mjk1NjlhYjY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWUxZWY3ZDIxOWNmZmYxYmYzNGM1MDU4ZWIwZmMyYjhjZmUxOGQxMDJiYTZl
|
14
|
+
YjE3ZGVlNjA4MTFmNWNmOTNlMzc0ZmIzZjhhOGMxYjE0Nzg2ODQ1NWVkNWMz
|
15
|
+
NmQwMmNkYWFmMTgyZjRkYjU0OWZkYjExZWE1OGE2NTVlMTczZTg=
|
data/docface.gemspec
CHANGED
@@ -5,12 +5,12 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.version = DocFace::VERSION
|
6
6
|
s.platform = Gem::Platform::RUBY
|
7
7
|
s.summary = "A markdown documentation generator/viewer."
|
8
|
-
s.description = "View your markdown files as a structured website."
|
8
|
+
s.description = "A markdown documentation generator/viewer. View your markdown files as a structured website."
|
9
9
|
s.authors = ["Bryan Brandau"]
|
10
10
|
s.email = 'agent462@gmail.com'
|
11
11
|
s.has_rdoc = false
|
12
12
|
|
13
|
-
s.homepage ='http://github.com/agent462/
|
13
|
+
s.homepage ='http://github.com/agent462/docface'
|
14
14
|
s.add_dependency('rainbow', '1.1.4')
|
15
15
|
s.add_dependency('trollop', '2.0')
|
16
16
|
s.add_dependency('kramdown', '1.0.1')
|
data/lib/docface/base.rb
CHANGED
@@ -11,8 +11,17 @@ module DocFace
|
|
11
11
|
cli
|
12
12
|
@troll = FileTroll.new
|
13
13
|
@writer = Writer.new
|
14
|
-
@
|
15
|
-
|
14
|
+
@parser = Parser.new
|
15
|
+
@short_files = Array.new
|
16
|
+
all_the_things
|
17
|
+
end
|
18
|
+
|
19
|
+
def all_the_things
|
20
|
+
@directory.each do |dir|
|
21
|
+
files = @troll.troll(dir)
|
22
|
+
parse(files,dir)
|
23
|
+
end
|
24
|
+
@index_hash = @troll.index_hash(@short_files)
|
16
25
|
cleanup(@index_hash)
|
17
26
|
assets
|
18
27
|
write_index(build_index("templates/index.erb"))
|
@@ -25,17 +34,14 @@ module DocFace
|
|
25
34
|
@output_dir = @cli[:output] ? @cli[:output] : "#{Dir.pwd}/docface"
|
26
35
|
end
|
27
36
|
|
28
|
-
def parse
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
content = parser.to_html(File.read(file))
|
33
|
-
dir = @directory.gsub(@directory.split('/').last, "")
|
37
|
+
def parse(files,directory)
|
38
|
+
files.each do |file|
|
39
|
+
content = @parser.to_html(File.read(file))
|
40
|
+
dir = directory.gsub(directory.split('/').last, "")
|
34
41
|
file = file.gsub(dir, "")
|
35
|
-
short_files << file
|
42
|
+
@short_files << file
|
36
43
|
build(file,content)
|
37
44
|
end
|
38
|
-
@index_hash = @troll.index_hash(short_files)
|
39
45
|
end
|
40
46
|
|
41
47
|
def build(file,content)
|
data/lib/docface/cli.rb
CHANGED
@@ -11,7 +11,7 @@ module DocFace
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.opts
|
14
|
-
|
14
|
+
p = Trollop::Parser.new do
|
15
15
|
version "DocFace version: #{DocFace::VERSION} (c) 2013 Bryan Brandau"
|
16
16
|
banner <<-EOS.gsub(/^ {10}/, '')
|
17
17
|
#
|
@@ -30,11 +30,16 @@ module DocFace
|
|
30
30
|
Example Usage: docface -d ~/git/chef -o ~/my_build
|
31
31
|
For help use: docface --help
|
32
32
|
EOS
|
33
|
-
opt :dir, "The directories to scan for markdown files", :short => "d", :type => :
|
33
|
+
opt :dir, "The directories to scan for markdown files", :short => "d", :type => :strings, :required => true
|
34
34
|
opt :output, "The directory to write the generated output to", :short => "o", :type => :string
|
35
35
|
opt :title, "The title of the page", :short => "t", :type => :string
|
36
36
|
opt :description, "A custom description for the page", :short => "D", :type => :string
|
37
37
|
end
|
38
|
+
|
39
|
+
opts = Trollop::with_standard_exception_handling p do
|
40
|
+
raise Trollop::HelpNeeded if ARGV.empty? # show help screen
|
41
|
+
p.parse ARGV
|
42
|
+
end
|
38
43
|
end
|
39
44
|
|
40
45
|
end
|
data/lib/docface/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docface
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Brandau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|
@@ -66,7 +66,8 @@ dependencies:
|
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.0.9
|
69
|
-
description: View your markdown files as
|
69
|
+
description: A markdown documentation generator/viewer. View your markdown files as
|
70
|
+
a structured website.
|
70
71
|
email: agent462@gmail.com
|
71
72
|
executables:
|
72
73
|
- docface
|
@@ -95,7 +96,7 @@ files:
|
|
95
96
|
- lib/docface.rb
|
96
97
|
- docface.gemspec
|
97
98
|
- README.md
|
98
|
-
homepage: http://github.com/agent462/
|
99
|
+
homepage: http://github.com/agent462/docface
|
99
100
|
licenses: []
|
100
101
|
metadata: {}
|
101
102
|
post_install_message:
|