octodown 0.1.0beta1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.rubocop.yml +15 -0
- data/.travis.yml +4 -1
- data/README.md +5 -5
- data/bin/octodown +6 -1
- data/lib/octodown/renderer/github_markdown.rb +1 -1
- data/lib/octodown/renderer/html.rb +5 -1
- data/lib/octodown/support/browser.rb +1 -1
- data/lib/octodown/support/html_file.rb +3 -3
- data/lib/octodown/version.rb +1 -1
- data/octodown.gemspec +2 -1
- data/spec/markdown_generation_spec.rb +6 -2
- data/spec/template_rendering_spec.rb +7 -2
- data.tar.gz.sig +0 -0
- metadata +20 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ae27659b96dc1aed9d8e54fc5fae1eb5af80ecb
|
4
|
+
data.tar.gz: a312690de332fd10839cc6d554c1caeb60043ed9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01102c2586155236c32827b65e9ec201ed96b32e90beb10ceb594a08a6a3318e2ff4cdce647f07cb3cecf61d36f5a8ab18b6762e5fd7e5df3030b9cfcc4dc85d
|
7
|
+
data.tar.gz: a27239bef742f5a5f4d42b63c0558f478428fe2e6992e671945cb5f181584db336c057e82970bd2a9d4961ad4dfb2304871ba5fbb61e3ced8a0bbb6f6e2695e4
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- 'octodown.gemspec'
|
4
|
+
- 'Rakefile'
|
5
|
+
|
6
|
+
Style/Documentation:
|
7
|
+
Description: 'Document classes and non-namespace modules.'
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
Style/HashSyntax:
|
11
|
+
Description: >-
|
12
|
+
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
13
|
+
{ :a => 1, :b => 2 }.
|
14
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
|
15
|
+
Enabled: false
|
data/.travis.yml
CHANGED
@@ -4,8 +4,11 @@ before_install:
|
|
4
4
|
- gem update --system
|
5
5
|
- sudo apt-get install -y libicu-dev build-essential
|
6
6
|
install: 'bundle install'
|
7
|
-
script:
|
7
|
+
script:
|
8
|
+
- 'bundle exec rspec --format documentation'
|
9
|
+
- 'bundle exec rubocop'
|
8
10
|
rvm:
|
11
|
+
- '2.2.0'
|
9
12
|
- '2.1.4'
|
10
13
|
- '2.0.0'
|
11
14
|
- '1.9.3'
|
data/README.md
CHANGED
@@ -21,8 +21,8 @@ you. Dead simple. Never get caught writing ugly markdown again.
|
|
21
21
|
|
22
22
|
## Installation
|
23
23
|
|
24
|
-
1. Install `
|
25
|
-
* Mac: `$ brew install
|
24
|
+
1. Install `icu4c` and `cmake`:
|
25
|
+
* Mac: `$ brew install icu4c cmake`
|
26
26
|
* Apt: `$ sudo apt-get install -y libicu-dev cmake`
|
27
27
|
2. If you have a non-system Ruby (*highly recommended*):
|
28
28
|
* `$ gem install octodown`
|
@@ -32,11 +32,11 @@ you. Dead simple. Never get caught writing ugly markdown again.
|
|
32
32
|
## Usage
|
33
33
|
|
34
34
|
1. Basic:
|
35
|
-
|
35
|
+
* `$ octodown README.md`
|
36
36
|
2. Markdown preview styling
|
37
|
-
|
37
|
+
* `$ octodown --style atom README.md`
|
38
38
|
3. *nix lovers
|
39
|
-
|
39
|
+
* `$ echo '# Hello world!' | octodown --raw > index.html`
|
40
40
|
|
41
41
|
## Notes
|
42
42
|
|
data/bin/octodown
CHANGED
@@ -10,7 +10,12 @@ options = {}
|
|
10
10
|
OptionParser.new do |opts|
|
11
11
|
opts.banner = 'Usage: octodown [options]'
|
12
12
|
|
13
|
-
opts.on(
|
13
|
+
opts.on(
|
14
|
+
'-s',
|
15
|
+
'--style [STYLE]',
|
16
|
+
[:github, :atom],
|
17
|
+
'Choose style (atom, github)'
|
18
|
+
) do |s|
|
14
19
|
options[:style] = s
|
15
20
|
end
|
16
21
|
|
data/lib/octodown/version.rb
CHANGED
data/octodown.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Octodown::VERSION
|
9
9
|
spec.authors = ['Ian Ker-Seymer']
|
10
10
|
spec.email = ['i.kerseymer@gmail.com']
|
11
|
-
spec.summary =
|
11
|
+
spec.summary = 'Github markdown straight from your shell.'
|
12
12
|
spec.homepage = 'https://github.com/ianks/octodown'
|
13
13
|
spec.license = 'MIT'
|
14
14
|
|
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_dependency 'pygments.rb', '~> 0.6.0'
|
27
27
|
|
28
28
|
spec.add_development_dependency 'rspec', '~> 3.1.0'
|
29
|
+
spec.add_development_dependency 'rubocop', '~> 0.28.0'
|
29
30
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
30
31
|
spec.add_development_dependency 'rake', '~> 10.0'
|
31
32
|
end
|
@@ -2,11 +2,15 @@ require 'tempfile'
|
|
2
2
|
|
3
3
|
describe Octodown::Renderer::GithubMarkdown do
|
4
4
|
let(:dummy_path) { File.join(File.dirname(__FILE__), 'dummy', 'test.md') }
|
5
|
-
let(:html)
|
5
|
+
let(:html) do
|
6
|
+
Octodown::Renderer::GithubMarkdown.new(File.read(dummy_path)).to_html
|
7
|
+
end
|
6
8
|
|
7
9
|
it 'create HTML from markdown file' do
|
8
10
|
expect(html).to include '<h1>Hello world!</h1>'
|
9
|
-
expect(html).to include
|
11
|
+
expect(html).to include(
|
12
|
+
'<p>You are now reading markdown. How lucky you are!</p>'
|
13
|
+
)
|
10
14
|
end
|
11
15
|
|
12
16
|
it 'highlights the code' do
|
@@ -2,15 +2,20 @@ require 'tempfile'
|
|
2
2
|
|
3
3
|
describe Octodown::Renderer::HTML do
|
4
4
|
let(:dummy_path) { File.join(File.dirname(__FILE__), 'dummy', 'test.md') }
|
5
|
-
let(:html)
|
5
|
+
let(:html) do
|
6
|
+
Octodown::Renderer::GithubMarkdown.new(File.read(dummy_path)).to_html
|
7
|
+
end
|
8
|
+
|
6
9
|
subject { Octodown::Renderer::HTML.new(html, 'github').render }
|
7
10
|
|
8
11
|
before { allow(Octodown).to receive(:root) { '.' } }
|
9
12
|
|
10
13
|
it 'includes HTML from markdown rendering phase' do
|
11
14
|
expect(subject).to include '<h1>Hello world!</h1>'
|
12
|
-
expect(subject).to include '<p>You are now reading markdown. How lucky you are!</p>'
|
13
15
|
expect(subject).to include 'highlight-ruby'
|
16
|
+
expect(subject).to include(
|
17
|
+
'<p>You are now reading markdown. How lucky you are!</p>'
|
18
|
+
)
|
14
19
|
end
|
15
20
|
|
16
21
|
it 'sets the title' do
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octodown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Ker-Seymer
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
YGBeYMyEy7Q4wf7k4k5yyDUZyyaeg0DF/kNEN5llspJ9DHMP2cQqOiH+IQSNiUhR
|
31
31
|
32sJqaZRHeJLDhZPLi5yXItTsQnPy6uob2oyypwFYTM=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
33
|
+
date: 2015-01-02 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: github-markup
|
@@ -144,6 +144,20 @@ dependencies:
|
|
144
144
|
- - "~>"
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: 3.1.0
|
147
|
+
- !ruby/object:Gem::Dependency
|
148
|
+
name: rubocop
|
149
|
+
requirement: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - "~>"
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: 0.28.0
|
154
|
+
type: :development
|
155
|
+
prerelease: false
|
156
|
+
version_requirements: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - "~>"
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: 0.28.0
|
147
161
|
- !ruby/object:Gem::Dependency
|
148
162
|
name: bundler
|
149
163
|
requirement: !ruby/object:Gem::Requirement
|
@@ -182,6 +196,7 @@ extra_rdoc_files: []
|
|
182
196
|
files:
|
183
197
|
- ".gitignore"
|
184
198
|
- ".rspec"
|
199
|
+
- ".rubocop.yml"
|
185
200
|
- ".travis.yml"
|
186
201
|
- Gemfile
|
187
202
|
- LICENSE.txt
|
@@ -220,15 +235,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
220
235
|
version: '0'
|
221
236
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
222
237
|
requirements:
|
223
|
-
- - "
|
238
|
+
- - ">="
|
224
239
|
- !ruby/object:Gem::Version
|
225
|
-
version:
|
240
|
+
version: '0'
|
226
241
|
requirements: []
|
227
242
|
rubyforge_project:
|
228
243
|
rubygems_version: 2.4.5
|
229
244
|
signing_key:
|
230
245
|
specification_version: 4
|
231
|
-
summary:
|
246
|
+
summary: Github markdown straight from your shell.
|
232
247
|
test_files:
|
233
248
|
- spec/browser_spec.rb
|
234
249
|
- spec/dummy/test.md
|
metadata.gz.sig
CHANGED
Binary file
|