markdown_to_simple_html 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6de54e819420f16a85ffa02a971d8796a1f2d39a
4
+ data.tar.gz: b2bdb3dc595f1f1fdb09610a503f9666aff7b97d
5
+ SHA512:
6
+ metadata.gz: 53132244e17b34c524dc30313e75a84aefbd2db7a1a52dd0695e0236e2ac90971af8837be82c2bdf7cb3c2dac2104b1b346abcc4b2147a1da7656d6c416885b6
7
+ data.tar.gz: ca51cdddab62c9cf8af51e73deea3b9968558cd608698f523a217f2fbbcd97d81b7d1bfc979f7dbff61f39ee69a82b3c716948d61d3e71584b434651ccf9cbad
data/.gitignore ADDED
@@ -0,0 +1,23 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
23
+ .DS_Store
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in markdown_to_simple_html.gemspec
4
+ gemspec
5
+
6
+ gem 'redcarpet'
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 WithGJR
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # Markdown To Simple Html
2
+
3
+ This is just a simple Ruby Gem for parsing any Markdown File to a Simple HTML FILE.
4
+
5
+ ## Installation
6
+
7
+ You can install it in just one command:
8
+
9
+ $ gem install markdown_to_simple_html
10
+
11
+ ## Usage
12
+
13
+ Type this in your terminal:
14
+
15
+ $ md
16
+
17
+ and you will see a message like folloing:
18
+
19
+ $ Please type your markdown file name:
20
+
21
+ just type your markdown filename but no .md, for example(test.md), type:
22
+
23
+ $ test
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
32
+
33
+ ## About Author
34
+
35
+ I'm Kevin, a Web Developer living in Taiwan. If you want to know more about me, you can visit my [blog](http://blog.cgmlife.net/).
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/md ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'markdown_to_simple_html'
5
+
6
+ puts "Please type your markdown file name:"
7
+
8
+ filename = STDIN.gets.chomp()
9
+
10
+ html_file = File.open("#{filename}.html", "w")
11
+
12
+ markdown_parser = MarkdownToSimpleHtml::MarkdownParser.new(filename)
13
+
14
+ html_file.write(markdown_parser.to_html)
15
+
16
+ html_file.close()
17
+
18
+ puts "Created Successfully!"
@@ -0,0 +1,3 @@
1
+ module MarkdownToSimpleHtml
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,18 @@
1
+ require "markdown_to_simple_html/version"
2
+ require 'redcarpet'
3
+
4
+ module MarkdownToSimpleHtml
5
+
6
+ class MarkdownParser
7
+ def initialize(filename)
8
+ @contents = IO.readlines("#{filename}.md").join
9
+ @parser = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :hard_wrap => true)
10
+
11
+ end
12
+
13
+ def to_html
14
+ @parser.render(@contents)
15
+ end
16
+ end
17
+
18
+ end
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ #lib = File.expand_path('../lib', __FILE__)
5
+ #$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
+ require 'markdown_to_simple_html/version'
7
+
8
+ Gem::Specification.new do |spec|
9
+ spec.name = "markdown_to_simple_html"
10
+ spec.version = MarkdownToSimpleHtml::VERSION
11
+ spec.authors = ["Kevin"]
12
+ spec.email = ["kevin3372000@gmail.com"]
13
+ spec.summary = %q{Markdown to HTML.}
14
+ spec.description = %q{Parsing a Markdown File and transform it to a Simple HTML File.}
15
+ spec.homepage = "https://github.com/WithGJR/markdown_to_simple_html"
16
+ spec.license = "MIT"
17
+
18
+ spec.files = `git ls-files -z`.split("\x0")
19
+ spec.executables = ["md"]
20
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.6"
24
+ spec.add_development_dependency "rake"
25
+
26
+ spec.add_runtime_dependency "redcarpet"
27
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: markdown_to_simple_html
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kevin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-06-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: redcarpet
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Parsing a Markdown File and transform it to a Simple HTML File.
56
+ email:
57
+ - kevin3372000@gmail.com
58
+ executables:
59
+ - md
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - .gitignore
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - bin/md
69
+ - lib/markdown_to_simple_html.rb
70
+ - lib/markdown_to_simple_html/version.rb
71
+ - markdown_to_simple_html.gemspec
72
+ homepage: https://github.com/WithGJR/markdown_to_simple_html
73
+ licenses:
74
+ - MIT
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.3.0
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Markdown to HTML.
96
+ test_files: []