markd 0.2.1 → 0.2.2
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 +8 -8
- data/README.md +5 -0
- data/VERSION +1 -1
- data/lib/markd.rb +11 -5
- data/lib/markd/markd.rb +2 -2
- data/markd.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDI2ZGJhZTA1NzIyODg3OGRiMjhhODQzMDZiMDA5ZjE0OTQ2ZjYzNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTYwZjgwMTI5OGU3MmE2N2U5ZmNmM2NmMmE5OTdlZDNlOTY1OWQzZQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDZlMjMyZWU5NGE4MTRiODYyMGQwNGQ0Njk4MTlkZDM2ZTdmZWIyZjY0ZjMw
|
10
|
+
NTNmM2M2NmYzYmU1ZjQ4YmY5MjAxNzk3YTc2MGY5ZGFlZTZmY2ZhNmUyODhm
|
11
|
+
NWYyOTBiZTUzMzc5OTYwN2U1NjcwY2ZjMmJhOGM0NGY0MTE0MDY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZmEzYjRhZTM4ZjZmODlkMjM5OGZhMzMzNjdlOTZiNTFhZjFiZDRmOWUxZDA4
|
14
|
+
NWIxYzY4N2Q1YWU4NzE4NDdlMTE2NTJlZGU0MjIwYmU0YTNlOTczNzA4OGI1
|
15
|
+
MDI0N2NjYmQ4NTk2ZWMzN2Y1NWE3NzM5ZWQ5MDQ1NTg1ZGYyYzk=
|
data/README.md
CHANGED
@@ -32,6 +32,11 @@ Build html from markdown:
|
|
32
32
|
where *markdown.md* is target markdown file and *out_dir* is directory
|
33
33
|
that html/css/js files are generated into.
|
34
34
|
|
35
|
+
$ markd *.md
|
36
|
+
|
37
|
+
Or simply give source markdwon file(s). Multiple files are acceptable.
|
38
|
+
Default output directory is "docs".
|
39
|
+
|
35
40
|
Use -h (or --help) option to show detail.
|
36
41
|
|
37
42
|
$ markd -h
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/lib/markd.rb
CHANGED
@@ -54,14 +54,20 @@ USAGE
|
|
54
54
|
puts reason
|
55
55
|
exit 0
|
56
56
|
end
|
57
|
+
|
58
|
+
def publish(filename, out_filename)
|
59
|
+
force_exit("#{filename} not file or exists") unless File.file? filename
|
60
|
+
out_dir = @options[:out_dir] || "docs"
|
61
|
+
MarkD.new.publish(filename, out_dir, out_filename)
|
62
|
+
end
|
57
63
|
|
58
64
|
def run(argv)
|
59
65
|
init argv
|
60
66
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
67
|
+
argv.each do |filename|
|
68
|
+
# use 'index.html' as output if one input file given
|
69
|
+
out_filename = (argv.size == 1) ? "index.html" : File.basename(filename, ".*") + ".html"
|
70
|
+
publish filename, out_filename
|
71
|
+
end
|
66
72
|
end
|
67
73
|
end
|
data/lib/markd/markd.rb
CHANGED
@@ -18,7 +18,7 @@ class MarkD
|
|
18
18
|
ENGINES[nil].new
|
19
19
|
end
|
20
20
|
|
21
|
-
def publish(filename, out_dir_path)
|
21
|
+
def publish(filename, out_dir_path, out_filename)
|
22
22
|
ext = File.extname(filename)
|
23
23
|
engine = create_engine ext
|
24
24
|
src = File.read filename
|
@@ -36,7 +36,7 @@ class MarkD
|
|
36
36
|
|
37
37
|
# output
|
38
38
|
FileUtils.mkdir_p out_dir_path
|
39
|
-
File.open("#{out_dir_path}
|
39
|
+
File.open("#{out_dir_path}/#{out_filename}", "w") { |f| f.puts html }
|
40
40
|
dirs = ::RESOURCES.map { |d| "#{APP_ROOT}/template/#{d}"}
|
41
41
|
FileUtils.cp_r(dirs, out_dir_path)
|
42
42
|
end
|
data/markd.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "markd"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["daisuke sugimori"]
|
12
|
-
s.date = "2013-04-
|
12
|
+
s.date = "2013-04-08"
|
13
13
|
s.description = "markd is html builder for markdown, textile and wiki. markd makes well-formatted html with CSS and prittfied code by Google Code Prettify."
|
14
14
|
s.email = "daixque@gmail.com"
|
15
15
|
s.executables = ["markd", "markd"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: markd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- daisuke sugimori
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erubis
|