jekyll-w2m 1.0.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8b4cbf7a4f23e3f156f9d89e5c936fcd319b15ea78c4485bca028f1bd31c924d
4
+ data.tar.gz: 332d4f0c410180424ad7d776c7685ef8d8899d3724ebe45dbe3a359ebf2a39e0
5
+ SHA512:
6
+ metadata.gz: 151680a45bc77cfdf83c195eab722151247f3974d0971b32fbba303481d4b57c66a0cb2f5fd6a64db313f1a9075481528fd9e20887585517ffddfeaeae410dc8
7
+ data.tar.gz: 852ab6e30dba78e7e02f1aae32176c81caedd3d196f063ba6e61539f3ea5aa9eededf1fcca32af3d1d1d4791df85c87108d0b8d9986765151ec653e193470cab
data/.gitignore ADDED
@@ -0,0 +1,24 @@
1
+ *.gem
2
+ *.swp
3
+ *~
4
+ .DS_Store
5
+ .analysis
6
+ .bundle/
7
+ .byebug_history
8
+ .jekyll-metadata
9
+ .ruby-gemset
10
+ .ruby-version
11
+ .sass-cache
12
+ /test/source/file_name.txt
13
+ /vendor
14
+ Gemfile.lock
15
+ _site/
16
+ .idea/
17
+ bin/
18
+ bbin/
19
+ coverage
20
+ gh-pages/
21
+ pkg/
22
+ site/_site/
23
+ test/dest
24
+ tmp/*
data/.travis.yml ADDED
@@ -0,0 +1,15 @@
1
+ sudo: false
2
+ language: ruby
3
+
4
+ before_install:
5
+ - gem update --system
6
+
7
+ matrix:
8
+ include:
9
+ - rvm: 2.5.0
10
+ - rvm: 2.4.3
11
+ - rvm: 2.3.6
12
+ - rvm: 2.2.9
13
+
14
+ notfications:
15
+ email: false
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018-present Kacper Duras
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
13
+ all 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
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # jekyll-w2m [![Build Status](https://travis-ci.org/kacperduras/jekyll-w2m.svg?branch=master)](https://travis-ci.org/kacperduras/jekyll-w2m) [![Gem Version](https://badge.fury.io/rb/jekyll-w2m.svg)](https://badge.fury.io/rb/jekyll-w2m)
2
+
3
+ A Jekyll plugin to liberate content from Microsoft Word documents (powered by [word-to-markdown](https://github.com/benbalter/word-to-markdown)).
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+ ```
9
+ $ gem 'jekyll-w2m'
10
+ ```
11
+
12
+ And then execute:
13
+ ```
14
+ $ bundle
15
+ ```
16
+
17
+ Or install it yourself as:
18
+ ```
19
+ $ gem install jekyll-w2m
20
+ ```
21
+
22
+ Then add the following to your site's `_config.yml`
23
+ ```yaml
24
+ plugins:
25
+ - "jekyll-w2m"
26
+ ```
27
+
28
+ ## Usage
29
+ Use the tag as follows in your Jekyll pages, posts and collections:
30
+ ```
31
+ {% w2m /path/to/document.docx %}
32
+ ```
33
+
34
+ ## License
35
+ [MIT](LICENSE)
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << 'test'
6
+ t.libs << 'lib'
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ end
9
+
10
+ task default: :test
@@ -0,0 +1,39 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ Gem::Specification.new do |spec|
5
+ spec.name = 'jekyll-w2m'
6
+ spec.version = '1.0.0'
7
+ spec.authors = ['Kacper Duras']
8
+ spec.email = ['git@kacperduras.pl']
9
+
10
+ spec.summary = 'A Jekyll plugin to liberate content from Microsoft Word documents (powered by word-to-markdown).'
11
+ spec.homepage = 'https://github.com/kacperduras/jekyll-w2m'
12
+ spec.license = 'MIT'
13
+
14
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
15
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
16
+ if spec.respond_to?(:metadata)
17
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
18
+ else
19
+ raise 'RubyGems 2.0 or newer is required to protect against ' \
20
+ 'public gem pushes.'
21
+ end
22
+
23
+ spec.required_ruby_version = '>= 2.2'
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
26
+ f.match(%r{^(test|spec|features)/})
27
+ end
28
+ spec.bindir = 'exe'
29
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ['lib']
31
+
32
+ spec.add_dependency 'jekyll', '~> 3.7.3'
33
+ spec.add_dependency 'word-to-markdown', '~> 1.1.7'
34
+
35
+ spec.add_development_dependency 'bundler', '~> 1.16.1'
36
+
37
+ spec.add_development_dependency 'rake', '~> 12.3'
38
+ spec.add_development_dependency 'minitest', '~> 5.11.3'
39
+ end
data/lib/jekyll-w2m.rb ADDED
@@ -0,0 +1,34 @@
1
+ require 'jekyll'
2
+ require 'liquid'
3
+
4
+ require 'word-to-markdown'
5
+
6
+ module Jekyll
7
+
8
+ module W2M
9
+
10
+ class Tag < Liquid::Tag
11
+
12
+ def initialize(tag_name, txt, tokens)
13
+ @context = txt
14
+ end
15
+
16
+ def render(context)
17
+ Jekyll::W2M.parse(@context)
18
+ end
19
+
20
+ end
21
+
22
+ class << self
23
+
24
+ def parse(file_path)
25
+ WordToMarkown.new(file_path)
26
+ end
27
+
28
+ end
29
+
30
+ end
31
+
32
+ end
33
+
34
+ Liquid::Template.register_tag('w2m', Jekyll::W2M::Tag)
metadata ADDED
@@ -0,0 +1,130 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-w2m
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Kacper Duras
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-03-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.7.3
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 3.7.3
27
+ - !ruby/object:Gem::Dependency
28
+ name: word-to-markdown
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.1.7
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.1.7
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 1.16.1
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.16.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '12.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '12.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 5.11.3
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 5.11.3
83
+ description:
84
+ email:
85
+ - git@kacperduras.pl
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - ".idea/jekyll-w2m.iml"
92
+ - ".idea/misc.xml"
93
+ - ".idea/modules.xml"
94
+ - ".idea/workspace.xml"
95
+ - ".travis.yml"
96
+ - Gemfile
97
+ - LICENSE
98
+ - README.md
99
+ - Rakefile
100
+ - bin/console
101
+ - bin/setup
102
+ - jekyll-w2m.gemspec
103
+ - lib/jekyll-w2m.rb
104
+ homepage: https://github.com/kacperduras/jekyll-w2m
105
+ licenses:
106
+ - MIT
107
+ metadata:
108
+ allowed_push_host: https://rubygems.org
109
+ post_install_message:
110
+ rdoc_options: []
111
+ require_paths:
112
+ - lib
113
+ required_ruby_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '2.2'
118
+ required_rubygems_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ requirements: []
124
+ rubyforge_project:
125
+ rubygems_version: 2.7.3
126
+ signing_key:
127
+ specification_version: 4
128
+ summary: A Jekyll plugin to liberate content from Microsoft Word documents (powered
129
+ by word-to-markdown).
130
+ test_files: []