jekyll-deploy-shosetsu 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rspec +3 -0
- data/.rubocop.yml +6 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +131 -0
- data/LICENSE.txt +21 -0
- data/README.md +48 -0
- data/Rakefile +6 -0
- data/bin/console +10 -0
- data/bin/setup +8 -0
- data/jekyll-deploy-shosetsu.gemspec +35 -0
- data/lib/jekyll-deploy-shosetsu.rb +14 -0
- data/lib/jekyll-deploy-shosetsu/deployers/kakuyomu.rb +49 -0
- data/lib/jekyll-deploy-shosetsu/version.rb +3 -0
- data/lib/jekyll/commands/deploy_kakuyomu.rb +68 -0
- metadata +173 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c941d8cf2d5a1324bcb16077fb797b1d379012636e1321c4115d9b80c97ef909
|
4
|
+
data.tar.gz: f88645e61e8e086ab14bb169266614b3dfb8a4648fdaa363a41d6c5b911ca56e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a7e8a7c576e4b00202d7eb9d71a81b492f82c42aff09a765569fcb63dc0a29a4ed7e5aae18a89e1564be4b80bfe6e64f3554731bf5575b0c11c0d9154b8bc8ac
|
7
|
+
data.tar.gz: 4b2ed4caa6599300c6fa6a796179b79b5624f3f0538379bde5453dea289936ab92f5f12009f79caae0111e6dff1d473439813234f6a50adb85ecba8b4359b377
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at fujinakahara2032@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
jekyll-deploy-shosetsu (0.1.0)
|
5
|
+
jekyll (~> 3.5)
|
6
|
+
jekyll-fuji_markdown
|
7
|
+
kakuyomu_client
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
addressable (2.5.2)
|
13
|
+
public_suffix (>= 2.0.2, < 4.0)
|
14
|
+
ast (2.4.0)
|
15
|
+
childprocess (0.9.0)
|
16
|
+
ffi (~> 1.0, >= 1.0.11)
|
17
|
+
coderay (1.1.2)
|
18
|
+
colorator (1.1.0)
|
19
|
+
commonmarker (0.18.1)
|
20
|
+
ruby-enum (~> 0.5)
|
21
|
+
concurrent-ruby (1.0.5)
|
22
|
+
diff-lcs (1.3)
|
23
|
+
em-websocket (0.5.1)
|
24
|
+
eventmachine (>= 0.12.9)
|
25
|
+
http_parser.rb (~> 0.6.0)
|
26
|
+
eventmachine (1.2.7)
|
27
|
+
ffi (1.9.25)
|
28
|
+
forwardable-extended (2.6.0)
|
29
|
+
fuji_markdown (0.2.1)
|
30
|
+
commonmarker (~> 0.17)
|
31
|
+
http_parser.rb (0.6.0)
|
32
|
+
i18n (0.9.5)
|
33
|
+
concurrent-ruby (~> 1.0)
|
34
|
+
jaro_winkler (1.5.1)
|
35
|
+
jekyll (3.8.4)
|
36
|
+
addressable (~> 2.4)
|
37
|
+
colorator (~> 1.0)
|
38
|
+
em-websocket (~> 0.5)
|
39
|
+
i18n (~> 0.7)
|
40
|
+
jekyll-sass-converter (~> 1.0)
|
41
|
+
jekyll-watch (~> 2.0)
|
42
|
+
kramdown (~> 1.14)
|
43
|
+
liquid (~> 4.0)
|
44
|
+
mercenary (~> 0.3.3)
|
45
|
+
pathutil (~> 0.9)
|
46
|
+
rouge (>= 1.7, < 4)
|
47
|
+
safe_yaml (~> 1.0)
|
48
|
+
jekyll-fuji_markdown (0.2.2)
|
49
|
+
fuji_markdown (~> 0.2.1)
|
50
|
+
jekyll-sass-converter (1.5.2)
|
51
|
+
sass (~> 3.4)
|
52
|
+
jekyll-watch (2.1.2)
|
53
|
+
listen (~> 3.0)
|
54
|
+
kakuyomu_client (0.2.0)
|
55
|
+
selenium-webdriver (~> 3.14)
|
56
|
+
kramdown (1.17.0)
|
57
|
+
liquid (4.0.1)
|
58
|
+
listen (3.1.5)
|
59
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
60
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
61
|
+
ruby_dep (~> 1.2)
|
62
|
+
meowcop (1.17.1)
|
63
|
+
rubocop (>= 0.57.0)
|
64
|
+
mercenary (0.3.6)
|
65
|
+
method_source (0.9.1)
|
66
|
+
parallel (1.12.1)
|
67
|
+
parser (2.5.3.0)
|
68
|
+
ast (~> 2.4.0)
|
69
|
+
pathutil (0.16.2)
|
70
|
+
forwardable-extended (~> 2.6)
|
71
|
+
powerpack (0.1.2)
|
72
|
+
pry (0.11.3)
|
73
|
+
coderay (~> 1.1.0)
|
74
|
+
method_source (~> 0.9.0)
|
75
|
+
public_suffix (3.0.3)
|
76
|
+
rainbow (3.0.0)
|
77
|
+
rake (10.5.0)
|
78
|
+
rb-fsevent (0.10.3)
|
79
|
+
rb-inotify (0.9.10)
|
80
|
+
ffi (>= 0.5.0, < 2)
|
81
|
+
rouge (3.3.0)
|
82
|
+
rspec (3.8.0)
|
83
|
+
rspec-core (~> 3.8.0)
|
84
|
+
rspec-expectations (~> 3.8.0)
|
85
|
+
rspec-mocks (~> 3.8.0)
|
86
|
+
rspec-core (3.8.0)
|
87
|
+
rspec-support (~> 3.8.0)
|
88
|
+
rspec-expectations (3.8.2)
|
89
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
90
|
+
rspec-support (~> 3.8.0)
|
91
|
+
rspec-mocks (3.8.0)
|
92
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
93
|
+
rspec-support (~> 3.8.0)
|
94
|
+
rspec-support (3.8.0)
|
95
|
+
rubocop (0.60.0)
|
96
|
+
jaro_winkler (~> 1.5.1)
|
97
|
+
parallel (~> 1.10)
|
98
|
+
parser (>= 2.5, != 2.5.1.1)
|
99
|
+
powerpack (~> 0.1)
|
100
|
+
rainbow (>= 2.2.2, < 4.0)
|
101
|
+
ruby-progressbar (~> 1.7)
|
102
|
+
unicode-display_width (~> 1.4.0)
|
103
|
+
ruby-enum (0.7.2)
|
104
|
+
i18n
|
105
|
+
ruby-progressbar (1.10.0)
|
106
|
+
ruby_dep (1.5.0)
|
107
|
+
rubyzip (1.2.2)
|
108
|
+
safe_yaml (1.0.4)
|
109
|
+
sass (3.6.0)
|
110
|
+
sass-listen (~> 4.0.0)
|
111
|
+
sass-listen (4.0.0)
|
112
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
113
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
114
|
+
selenium-webdriver (3.141.0)
|
115
|
+
childprocess (~> 0.5)
|
116
|
+
rubyzip (~> 1.2, >= 1.2.2)
|
117
|
+
unicode-display_width (1.4.0)
|
118
|
+
|
119
|
+
PLATFORMS
|
120
|
+
ruby
|
121
|
+
|
122
|
+
DEPENDENCIES
|
123
|
+
bundler (~> 1.17)
|
124
|
+
jekyll-deploy-shosetsu!
|
125
|
+
meowcop
|
126
|
+
pry
|
127
|
+
rake (~> 10.0)
|
128
|
+
rspec (~> 3.0)
|
129
|
+
|
130
|
+
BUNDLED WITH
|
131
|
+
1.17.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 Fuji Nakahara
|
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,48 @@
|
|
1
|
+
# jekyll-deploy-shosetsu
|
2
|
+
|
3
|
+
Jekyll plugin that adds subcommands to deploy your posts to [Kakuyomu](https://kakuyomu.jp/).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'jekyll-deploy-shosetsu', group: :jekyll_plugins
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
You can deploy your posts to Kakuyomu by the following command:
|
20
|
+
|
21
|
+
$ bundle exec jekyll deploy-kakuyomu --email YOUR_EMAIL --password YOUR_PASSWORD --work_id KAKUYOMU_WORK_ID
|
22
|
+
|
23
|
+
You can also edit the deploy settings in `_config.yml`
|
24
|
+
|
25
|
+
```yaml
|
26
|
+
kakuyomu:
|
27
|
+
work_id: 1234567890123456789
|
28
|
+
email: kakuyomu@example.com
|
29
|
+
password: YOUR_PASSWORD
|
30
|
+
```
|
31
|
+
|
32
|
+
## Development
|
33
|
+
|
34
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
35
|
+
|
36
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
37
|
+
|
38
|
+
## Contributing
|
39
|
+
|
40
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/fuji-nakahara/jekyll-deploy-shosetsu. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
41
|
+
|
42
|
+
## License
|
43
|
+
|
44
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
45
|
+
|
46
|
+
## Code of Conduct
|
47
|
+
|
48
|
+
Everyone interacting in the jekyll-deploy-shosetsu project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/fuji-nakahara/jekyll-deploy-shosetsu/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "jekyll-deploy-shosetsu"
|
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
|
+
require "pry"
|
10
|
+
Pry.start
|
data/bin/setup
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "jekyll-deploy-shosetsu/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "jekyll-deploy-shosetsu"
|
8
|
+
spec.version = JekyllDeployShosetsu::VERSION
|
9
|
+
spec.authors = ["Fuji Nakahara"]
|
10
|
+
spec.email = ["fujinakahara2032@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = "Jekyll plugin that adds command to deploy posts to Kakuyomu"
|
13
|
+
spec.homepage = "https://github.com/fuji-nakahara/jekyll-deploy-shosetsu"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
# Specify which files should be added to the gem when it is released.
|
17
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
18
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
19
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
+
end
|
21
|
+
spec.bindir = "exe"
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ["lib"]
|
24
|
+
|
25
|
+
spec.add_dependency "jekyll", "~> 3.5"
|
26
|
+
|
27
|
+
spec.add_dependency "jekyll-fuji_markdown"
|
28
|
+
spec.add_dependency "kakuyomu_client"
|
29
|
+
|
30
|
+
spec.add_development_dependency "bundler", "~> 1.17"
|
31
|
+
spec.add_development_dependency "meowcop"
|
32
|
+
spec.add_development_dependency "pry"
|
33
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
34
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
35
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'io/console'
|
2
|
+
|
3
|
+
require 'jekyll'
|
4
|
+
|
5
|
+
require 'jekyll-fuji_markdown'
|
6
|
+
require 'kakuyomu_client'
|
7
|
+
|
8
|
+
require_relative 'jekyll/commands/deploy_kakuyomu'
|
9
|
+
require_relative 'jekyll-deploy-shosetsu/deployers/kakuyomu'
|
10
|
+
require_relative 'jekyll-deploy-shosetsu/version'
|
11
|
+
|
12
|
+
module JekyllDeployShosetsu
|
13
|
+
class Error < StandardError; end
|
14
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module JekyllDeployShosetsu
|
2
|
+
module Deployers
|
3
|
+
class Kakuyomu
|
4
|
+
attr_reader :client
|
5
|
+
|
6
|
+
def initialize(client: KakuyomuClient.new)
|
7
|
+
@client = client
|
8
|
+
end
|
9
|
+
|
10
|
+
def deploy(site)
|
11
|
+
email = site.config['kakuyomu']['email']
|
12
|
+
password = site.config['kakuyomu']['password']
|
13
|
+
client.login!(email: email, password: password)
|
14
|
+
|
15
|
+
work_id = site.config['kakuyomu']['work_id']
|
16
|
+
|
17
|
+
site.posts.docs.each do |post|
|
18
|
+
post.output = Jekyll::Renderer.new(site, post).run
|
19
|
+
|
20
|
+
kakuyomu_config = post['kakuyomu'] || {}
|
21
|
+
next if kakuyomu_config['ignore']
|
22
|
+
|
23
|
+
if kakuyomu_config['url']
|
24
|
+
episode_id = KakuyomuClient::UrlUtils.extract_episode_id(kakuyomu_config['url'])
|
25
|
+
url = client.update_episode(work_id: work_id, episode_id: episode_id, title: post['title'], body: post.output)
|
26
|
+
Jekyll.logger.info 'Updated:', "#{post.basename} #{url}"
|
27
|
+
else
|
28
|
+
url = client.create_episode(work_id: work_id, title: post['title'], body: post.output)
|
29
|
+
Jekyll.logger.info 'Created:', "#{post.basename} #{url}"
|
30
|
+
add_kakuyomu_url_config(post, url)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def add_kakuyomu_url_config(post, url)
|
38
|
+
content = File.read(post.path)
|
39
|
+
config = content[Jekyll::Document::YAML_FRONT_MATTER_REGEXP, 1]
|
40
|
+
new_config = config + <<~YAML
|
41
|
+
kakuyomu:
|
42
|
+
url: #{url}
|
43
|
+
YAML
|
44
|
+
new_content = content.gsub(config, new_config)
|
45
|
+
File.write(post.path, new_content)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
module Jekyll
|
2
|
+
module Commands
|
3
|
+
class DeployKakuyomu < Command
|
4
|
+
KAKUYOMU_OPTIONS = %w[email password work_id]
|
5
|
+
|
6
|
+
class << self
|
7
|
+
def init_with_program(prog)
|
8
|
+
prog.command(:'deploy-kakuyomu') do |c|
|
9
|
+
c.syntax 'deploy-kakuyomu [options]'
|
10
|
+
c.description 'Deploy posts to kakuyomu'
|
11
|
+
c.alias :dk
|
12
|
+
|
13
|
+
c.option 'config', '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
14
|
+
c.option 'verbose', '-V', '--verbose', 'Print verbose output.'
|
15
|
+
|
16
|
+
c.option 'email', '--email EMAIL', 'Email of Kakuyomu account'
|
17
|
+
c.option 'password', '--password PASSWORD', 'Password of Kakuyomu account'
|
18
|
+
c.option 'work_id', '--work_id WORK_ID', Integer, 'The posts will be deployed into Kakuyomu work of WORK_ID'
|
19
|
+
|
20
|
+
c.action do |_args, options|
|
21
|
+
options['kakuyomu'] = {}
|
22
|
+
KAKUYOMU_OPTIONS.each do |key|
|
23
|
+
options['kakuyomu'][key] = options[key] unless options[key].nil?
|
24
|
+
end
|
25
|
+
|
26
|
+
process(options)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def process(options, deployer: JekyllDeployShosetsu::Deployers::Kakuyomu.new)
|
32
|
+
# Adjust verbosity quickly
|
33
|
+
Jekyll.logger.adjust_verbosity(options)
|
34
|
+
|
35
|
+
options = configuration_from_options(options)
|
36
|
+
|
37
|
+
# Rendering settings
|
38
|
+
options['markdown'] = 'FujiMarkdown'
|
39
|
+
options['FujiMarkdown'] ||= {}
|
40
|
+
options['FujiMarkdown']['output'] = 'kakuyomu'
|
41
|
+
Jekyll::Hooks.register :posts, :pre_render do |post, _payload|
|
42
|
+
post.merge_data!('layout' => 'none')
|
43
|
+
end
|
44
|
+
|
45
|
+
site = Jekyll::Site.new(options)
|
46
|
+
site.reset
|
47
|
+
site.read
|
48
|
+
|
49
|
+
deploy(site, options, deployer)
|
50
|
+
end
|
51
|
+
|
52
|
+
def deploy(site, options, deployer)
|
53
|
+
t = Time.now
|
54
|
+
source = options['source']
|
55
|
+
work_id = options['kakuyomu']['work_id']
|
56
|
+
|
57
|
+
Jekyll.logger.info 'Source:', source
|
58
|
+
Jekyll.logger.info 'Work id:', work_id
|
59
|
+
Jekyll.logger.info 'Deploying...'
|
60
|
+
|
61
|
+
deployer.deploy(site)
|
62
|
+
|
63
|
+
Jekyll.logger.info '', "done in #{(Time.now - t).round(3)} seconds."
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
metadata
ADDED
@@ -0,0 +1,173 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jekyll-deploy-shosetsu
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Fuji Nakahara
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-11-04 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.5'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: jekyll-fuji_markdown
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
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: kakuyomu_client
|
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
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.17'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.17'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: meowcop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '10.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '10.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '3.0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '3.0'
|
125
|
+
description:
|
126
|
+
email:
|
127
|
+
- fujinakahara2032@gmail.com
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- ".gitignore"
|
133
|
+
- ".rspec"
|
134
|
+
- ".rubocop.yml"
|
135
|
+
- ".travis.yml"
|
136
|
+
- CODE_OF_CONDUCT.md
|
137
|
+
- Gemfile
|
138
|
+
- Gemfile.lock
|
139
|
+
- LICENSE.txt
|
140
|
+
- README.md
|
141
|
+
- Rakefile
|
142
|
+
- bin/console
|
143
|
+
- bin/setup
|
144
|
+
- jekyll-deploy-shosetsu.gemspec
|
145
|
+
- lib/jekyll-deploy-shosetsu.rb
|
146
|
+
- lib/jekyll-deploy-shosetsu/deployers/kakuyomu.rb
|
147
|
+
- lib/jekyll-deploy-shosetsu/version.rb
|
148
|
+
- lib/jekyll/commands/deploy_kakuyomu.rb
|
149
|
+
homepage: https://github.com/fuji-nakahara/jekyll-deploy-shosetsu
|
150
|
+
licenses:
|
151
|
+
- MIT
|
152
|
+
metadata: {}
|
153
|
+
post_install_message:
|
154
|
+
rdoc_options: []
|
155
|
+
require_paths:
|
156
|
+
- lib
|
157
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
162
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
requirements: []
|
168
|
+
rubyforge_project:
|
169
|
+
rubygems_version: 2.7.6
|
170
|
+
signing_key:
|
171
|
+
specification_version: 4
|
172
|
+
summary: Jekyll plugin that adds command to deploy posts to Kakuyomu
|
173
|
+
test_files: []
|