markdown_html 0.1.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +36 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +26 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/index.html +28 -0
- data/bin/markdown_html +5 -0
- data/bin/setup +8 -0
- data/lib/markdown_html/cli.rb +45 -0
- data/lib/markdown_html/convert.rb +24 -0
- data/lib/markdown_html/version.rb +6 -0
- data/lib/markdown_html.rb +5 -0
- data/markdown_html.gemspec +23 -0
- metadata +73 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 85c3e166ed9035556e8e5b06489dea495f5eaa9b
|
4
|
+
data.tar.gz: e0d9117e3dfbd67eb788383177f55bf9e918df12
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5e03d9de30a63bf02e47982a5d832478ab564b05563dda4fec8e85e97773cafe148a8258b9fd6a49df98fca0fc785ee687852e9d180bd7f12a79e5bed0346115
|
7
|
+
data.tar.gz: 4e8e8f407b248e4097152f0f0ebef8de6c9104bf38dcec4a1fea4397a4350c1c059453a8020a6f8d9ee250c9afeef2a0bdce8a74ef222fe3db4db2a8060eddf0
|
data/.gitignore
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
11
|
+
/tmp/
|
12
|
+
|
13
|
+
## Specific to RubyMotion:
|
14
|
+
.dat*
|
15
|
+
.repl_history
|
16
|
+
build/
|
17
|
+
|
18
|
+
## Documentation cache and generated files:
|
19
|
+
/.yardoc/
|
20
|
+
/_yardoc/
|
21
|
+
/doc/
|
22
|
+
/rdoc/
|
23
|
+
|
24
|
+
## Environment normalization:
|
25
|
+
/.bundle/
|
26
|
+
/vendor/bundle
|
27
|
+
/lib/bundler/man/
|
28
|
+
|
29
|
+
# for a library or gem, you might want to ignore these files since the code is
|
30
|
+
# intended to run in multiple environments; otherwise, check them in:
|
31
|
+
# Gemfile.lock
|
32
|
+
# .ruby-version
|
33
|
+
# .ruby-gemset
|
34
|
+
|
35
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
36
|
+
.rvmrc
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# markdown_html
|
2
|
+
|
3
|
+
The simplest way to convert Markdown to HTML :zap:
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```shell
|
8
|
+
$ git clone https://github.com/dkhamsing/markdown_html.git
|
9
|
+
$ cd markdown_html/
|
10
|
+
$ rake install
|
11
|
+
```
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
```shell
|
16
|
+
$ markdown_html README.md index.html
|
17
|
+
```
|
18
|
+
|
19
|
+
## Contact
|
20
|
+
|
21
|
+
- [github.com/dkhamsing](https://github.com/dkhamsing)
|
22
|
+
- [twitter.com/dkhamsing](https://twitter.com/dkhamsing)
|
23
|
+
|
24
|
+
## License
|
25
|
+
|
26
|
+
This project is available under the MIT license. See the [LICENSE](LICENSE) file for more info.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "markdown_html"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/index.html
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
<h1>markdown_html</h1>
|
2
|
+
|
3
|
+
<p>The simplest way to convert Markdown to HTML :zap:</p>
|
4
|
+
|
5
|
+
<h2>Installation</h2>
|
6
|
+
|
7
|
+
<p><code>shell
|
8
|
+
$ git clone https://github.com/dkhamsing/markdown_html.git
|
9
|
+
$ cd markdown_html/
|
10
|
+
$ rake install
|
11
|
+
</code></p>
|
12
|
+
|
13
|
+
<h2>Usage</h2>
|
14
|
+
|
15
|
+
<p><code>shell
|
16
|
+
$ markdown_html README.md index.html
|
17
|
+
</code></p>
|
18
|
+
|
19
|
+
<h2>Contact</h2>
|
20
|
+
|
21
|
+
<ul>
|
22
|
+
<li><a href="https://github.com/dkhamsing">github.com/dkhamsing</a></li>
|
23
|
+
<li><a href="https://twitter.com/dkhamsing">twitter.com/dkhamsing</a></li>
|
24
|
+
</ul>
|
25
|
+
|
26
|
+
<h2>License</h2>
|
27
|
+
|
28
|
+
<p>This project is available under the MIT license. See the <a href="LICENSE">LICENSE</a> file for more info.</p>
|
data/bin/markdown_html
ADDED
data/bin/setup
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Command line interface
|
2
|
+
module MarkdownHtml
|
3
|
+
require 'markdown_html/version'
|
4
|
+
require 'markdown_html/convert'
|
5
|
+
|
6
|
+
OPTION_QUIET = 'quiet'
|
7
|
+
|
8
|
+
class << self
|
9
|
+
|
10
|
+
def cli
|
11
|
+
q = make_option OPTION_QUIET
|
12
|
+
quiet = ARGV.include? q
|
13
|
+
|
14
|
+
puts "#{PRODUCT} #{VERSION}" unless quiet
|
15
|
+
|
16
|
+
if ARGV.count == 0
|
17
|
+
usage
|
18
|
+
exit
|
19
|
+
end
|
20
|
+
|
21
|
+
argv = ARGV - [q]
|
22
|
+
|
23
|
+
markdown_file = argv[0]
|
24
|
+
html_file = argv[1]
|
25
|
+
|
26
|
+
unless File.exist? markdown_file
|
27
|
+
puts "#{markdown_file} does not exist"
|
28
|
+
usage
|
29
|
+
exit
|
30
|
+
end
|
31
|
+
|
32
|
+
html_file = 'index.html' if html_file.nil?
|
33
|
+
|
34
|
+
convert markdown_file, html_file, quiet
|
35
|
+
end
|
36
|
+
|
37
|
+
def make_option(option)
|
38
|
+
"--#{option}"
|
39
|
+
end
|
40
|
+
|
41
|
+
def usage
|
42
|
+
puts "Usage: #{PRODUCT} <markdown file> [html file] [#{make_option OPTION_VERBOSE}]"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Convert Markdown to HTML
|
2
|
+
module MarkdownHtml
|
3
|
+
require 'redcarpet'
|
4
|
+
|
5
|
+
class << self
|
6
|
+
def convert(markdown_file, html_file, quiet = false)
|
7
|
+
puts "Converting #{markdown_file} (md) to #{html_file} (html)" unless quiet
|
8
|
+
c = File.read markdown_file
|
9
|
+
|
10
|
+
puts 'README --------------------------------' unless quiet
|
11
|
+
puts c unless quiet
|
12
|
+
|
13
|
+
renderer = Redcarpet::Render::HTML
|
14
|
+
markdown = Redcarpet::Markdown.new(renderer)
|
15
|
+
html = markdown.render c
|
16
|
+
|
17
|
+
puts 'HTML ----------------------------------' unless quiet
|
18
|
+
puts html unless quiet
|
19
|
+
|
20
|
+
File.write html_file, html
|
21
|
+
puts "Converted #{markdown_file} to HTML, wrote #{html_file} :-)" unless quiet
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'markdown_html/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = MarkdownHtml::PRODUCT
|
8
|
+
spec.version = MarkdownHtml::VERSION
|
9
|
+
spec.authors = ["dkhamsing"]
|
10
|
+
spec.email = ["dkhamsing8@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = 'The simplest way to convert Markdown to HTML'
|
13
|
+
spec.description = spec.summary
|
14
|
+
spec.homepage = 'https://github.com/dkhamsing/markdown_html'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = 'bin'
|
19
|
+
spec.executables = [MarkdownHtml::PRODUCT]
|
20
|
+
spec.require_paths = ['lib']
|
21
|
+
|
22
|
+
spec.add_runtime_dependency 'redcarpet'
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: markdown_html
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.pre
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- dkhamsing
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-02-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: redcarpet
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: The simplest way to convert Markdown to HTML
|
28
|
+
email:
|
29
|
+
- dkhamsing8@gmail.com
|
30
|
+
executables:
|
31
|
+
- markdown_html
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files: []
|
34
|
+
files:
|
35
|
+
- .gitignore
|
36
|
+
- Gemfile
|
37
|
+
- LICENSE
|
38
|
+
- README.md
|
39
|
+
- Rakefile
|
40
|
+
- bin/console
|
41
|
+
- bin/index.html
|
42
|
+
- bin/markdown_html
|
43
|
+
- bin/setup
|
44
|
+
- lib/markdown_html.rb
|
45
|
+
- lib/markdown_html/cli.rb
|
46
|
+
- lib/markdown_html/convert.rb
|
47
|
+
- lib/markdown_html/version.rb
|
48
|
+
- markdown_html.gemspec
|
49
|
+
homepage: https://github.com/dkhamsing/markdown_html
|
50
|
+
licenses:
|
51
|
+
- MIT
|
52
|
+
metadata: {}
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options: []
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - '>'
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 1.3.1
|
67
|
+
requirements: []
|
68
|
+
rubyforge_project:
|
69
|
+
rubygems_version: 2.0.14
|
70
|
+
signing_key:
|
71
|
+
specification_version: 4
|
72
|
+
summary: The simplest way to convert Markdown to HTML
|
73
|
+
test_files: []
|