mdown 42.0
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.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Rakefile +2 -0
- data/bin/mdown +11 -0
- data/lib/mdown/app.rb +23 -0
- data/lib/mdown/version.rb +5 -0
- data/lib/mdown.rb +6 -0
- data/mdown.gemspec +22 -0
- data/test.html +31 -0
- data/test.markdown +16 -0
- data/test.txt +15 -0
- metadata +88 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
data/bin/mdown
ADDED
data/lib/mdown/app.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
module Mdown
|
2
|
+
class App
|
3
|
+
def initialize(file)
|
4
|
+
check_file! file
|
5
|
+
@file = file
|
6
|
+
end
|
7
|
+
|
8
|
+
def preview!
|
9
|
+
preview = Maruku.new(File.open(@file).read).to_html
|
10
|
+
exec "echo \"#{preview}\" | bcat"
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def check_file!(file)
|
16
|
+
unless File.exists?(file)
|
17
|
+
raise "Unable to find file #{file}"
|
18
|
+
exit
|
19
|
+
end
|
20
|
+
return
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/mdown.rb
ADDED
data/mdown.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "mdown/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "mdown"
|
7
|
+
s.version = Mdown::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Aziz Light"]
|
10
|
+
s.email = ["aziiz.light@gmail.com"]
|
11
|
+
s.homepage = ""
|
12
|
+
s.summary = %q{Markdown preview}
|
13
|
+
s.description = %q{Preview markdown files in your default browser}
|
14
|
+
|
15
|
+
s.add_dependency "bcat", "0.6.0"
|
16
|
+
s.add_dependency "maruku", "0.6.0"
|
17
|
+
|
18
|
+
s.files = `git ls-files`.split("\n")
|
19
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
20
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
|
+
s.require_paths = ["lib"]
|
22
|
+
end
|
data/test.html
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC
|
3
|
+
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
|
4
|
+
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
|
5
|
+
<html xml:lang='en' xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/1999/xhtml'>
|
6
|
+
<head><meta content='application/xhtml+xml;charset=utf-8' http-equiv='Content-type' /><title>This is the Title</title></head>
|
7
|
+
<body>
|
8
|
+
<h1 id='this_is_the_title'>This is the Title</h1>
|
9
|
+
|
10
|
+
<p>This is a list</p>
|
11
|
+
|
12
|
+
<ul>
|
13
|
+
<li>item</li>
|
14
|
+
|
15
|
+
<li>item</li>
|
16
|
+
|
17
|
+
<li>item</li>
|
18
|
+
|
19
|
+
<li>item</li>
|
20
|
+
|
21
|
+
<li>item</li>
|
22
|
+
|
23
|
+
<li>item</li>
|
24
|
+
|
25
|
+
<li>item</li>
|
26
|
+
</ul>
|
27
|
+
|
28
|
+
<p>This is an some code:</p>
|
29
|
+
|
30
|
+
<pre><code>puts "Hello, World!"</code></pre>
|
31
|
+
</body></html>
|
data/test.markdown
ADDED
data/test.txt
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
md_el(:document,[
|
2
|
+
md_el(:header,["This is the Title"],{:level=>1},[]),
|
3
|
+
md_par(["This is a list"]),
|
4
|
+
md_el(:ul,[
|
5
|
+
md_el(:li_span,["item"],{:want_my_paragraph=>false},[]),
|
6
|
+
md_el(:li_span,["item"],{:want_my_paragraph=>false},[]),
|
7
|
+
md_el(:li_span,["item"],{:want_my_paragraph=>false},[]),
|
8
|
+
md_el(:li_span,["item"],{:want_my_paragraph=>false},[]),
|
9
|
+
md_el(:li_span,["item"],{:want_my_paragraph=>false},[]),
|
10
|
+
md_el(:li_span,["item"],{:want_my_paragraph=>false},[]),
|
11
|
+
md_el(:li_span,["item"],{:want_my_paragraph=>false},[])
|
12
|
+
],{},[]),
|
13
|
+
md_par(["This is an some code:"]),
|
14
|
+
md_el(:code,[],{:raw_code=>"puts \"Hello, World!\""},[])
|
15
|
+
],{},[])
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mdown
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: "42.0"
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Aziz Light
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-03-01 00:00:00 +01:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: bcat
|
18
|
+
prerelease: false
|
19
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
21
|
+
requirements:
|
22
|
+
- - "="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 0.6.0
|
25
|
+
type: :runtime
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: maruku
|
29
|
+
prerelease: false
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - "="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 0.6.0
|
36
|
+
type: :runtime
|
37
|
+
version_requirements: *id002
|
38
|
+
description: Preview markdown files in your default browser
|
39
|
+
email:
|
40
|
+
- aziiz.light@gmail.com
|
41
|
+
executables:
|
42
|
+
- mdown
|
43
|
+
extensions: []
|
44
|
+
|
45
|
+
extra_rdoc_files: []
|
46
|
+
|
47
|
+
files:
|
48
|
+
- .gitignore
|
49
|
+
- Gemfile
|
50
|
+
- Rakefile
|
51
|
+
- bin/mdown
|
52
|
+
- lib/mdown.rb
|
53
|
+
- lib/mdown/app.rb
|
54
|
+
- lib/mdown/version.rb
|
55
|
+
- mdown.gemspec
|
56
|
+
- test.html
|
57
|
+
- test.markdown
|
58
|
+
- test.txt
|
59
|
+
has_rdoc: true
|
60
|
+
homepage: ""
|
61
|
+
licenses: []
|
62
|
+
|
63
|
+
post_install_message:
|
64
|
+
rdoc_options: []
|
65
|
+
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: "0"
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: "0"
|
80
|
+
requirements: []
|
81
|
+
|
82
|
+
rubyforge_project:
|
83
|
+
rubygems_version: 1.5.2
|
84
|
+
signing_key:
|
85
|
+
specification_version: 3
|
86
|
+
summary: Markdown preview
|
87
|
+
test_files: []
|
88
|
+
|