jekyll-truty 0.1.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 +7 -0
- data/LICENSE +22 -0
- data/README.md +23 -0
- data/lib/jekyll-truty/jekyll.rb +26 -0
- data/lib/jekyll-truty/kramdown.rb +31 -0
- data/lib/jekyll-truty.rb +3 -0
- metadata +91 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 32ffa59f15446e674215bc73edaaa78cb658456e
|
4
|
+
data.tar.gz: d46d8168c1b3f737a211922a74a1a7f2a6086338
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6dba27f62c10ae2c948a8c0fb7d8655266f3231cc5f3c174a9b1e7ae8bae8649e4d24fc8caa85ef12816e4a387d2b14d0605570de8416d9ae7d65200c439e998
|
7
|
+
data.tar.gz: 7db8d23a52dabd25bfd3f05027de826f93422d969cd966788f1a688ac51f50c2b1d941f82952149fb3ab7fe55acbed04a7692eb2f8db5543d07b452ca907b5de
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Matěj Kašpar Jirásek
|
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.
|
22
|
+
|
data/README.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
jekyll-truty
|
2
|
+
============
|
3
|
+
|
4
|
+
True typography converter for Jekyll. Markdown files will be converted with various plain text improvements like hyphenation, typographic quotes, non-breaking spaces, ellipses, trailing spaces, widows, etc.
|
5
|
+
|
6
|
+
For more information about this plugin visit the [Truty project page](https://github.com/mkj-is/Truty).
|
7
|
+
|
8
|
+
## Configuration
|
9
|
+
|
10
|
+
Add this to your `_config.yml` file.
|
11
|
+
|
12
|
+
```yml
|
13
|
+
gems: [jekyll-truty]
|
14
|
+
markdown: KramdownTruty
|
15
|
+
kramdown:
|
16
|
+
truty_lang: czech
|
17
|
+
```
|
18
|
+
|
19
|
+
Language can be one of `czech`, `english` or `french`.
|
20
|
+
|
21
|
+
## Authors
|
22
|
+
|
23
|
+
- [Matěj Kašpar Jirásek](https://github.com/mkj-is) (http://mkj.is)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
class Jekyll::Converters::Markdown::KramdownTruty
|
3
|
+
|
4
|
+
def initialize(config)
|
5
|
+
require 'kramdown'
|
6
|
+
@config = config
|
7
|
+
rescue LoadError
|
8
|
+
STDERR.puts 'You are missing a library required for Markdown. Please run:'
|
9
|
+
STDERR.puts ' $ [sudo] gem install kramdown'
|
10
|
+
raise FatalException.new("Missing dependency: kramdown")
|
11
|
+
end
|
12
|
+
|
13
|
+
def convert(content)
|
14
|
+
html = Kramdown::Document.new(content, {
|
15
|
+
:truty_lang => @config['kramdown']['truty_lang'],
|
16
|
+
:auto_ids => @config['kramdown']['auto_ids'],
|
17
|
+
:footnote_nr => @config['kramdown']['footnote_nr'],
|
18
|
+
:entity_output => @config['kramdown']['entity_output'],
|
19
|
+
:toc_levels => @config['kramdown']['toc_levels'],
|
20
|
+
:smart_quotes => @config['kramdown']['smart_quotes'],
|
21
|
+
:kramdown_default_lang => @config['kramdown']['default_lang'],
|
22
|
+
:input => @config['kramdown']['input']
|
23
|
+
}).to_truty_html
|
24
|
+
return html;
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
|
2
|
+
module Kramdown
|
3
|
+
|
4
|
+
module Options
|
5
|
+
define(:truty_lang, Symbol, :general, <<EOF)
|
6
|
+
Sets the default language for highlighting code blocks
|
7
|
+
If no language is set for a code block, the default language is used
|
8
|
+
instead. The value has to be one of the languages supported by pygments
|
9
|
+
or nil if no default language should be used.
|
10
|
+
Default: :general
|
11
|
+
Used by: TrutyHtml converter
|
12
|
+
EOF
|
13
|
+
end
|
14
|
+
|
15
|
+
module Converter
|
16
|
+
class TrutyHtml < Html
|
17
|
+
|
18
|
+
begin
|
19
|
+
require 'truty'
|
20
|
+
rescue LoadError
|
21
|
+
STDERR.puts 'You are missing a library required for typography improvements. Please run:'
|
22
|
+
STDERR.puts ' $ [sudo] gem install truty'
|
23
|
+
raise FatalException.new("Missing dependency: Truty")
|
24
|
+
end
|
25
|
+
|
26
|
+
def convert_text(el, indent)
|
27
|
+
Truty.convert(el.value, :html, @options[:truty_lang])
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/jekyll-truty.rb
ADDED
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jekyll-truty
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Matěj Kašpar Jirásek
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: truty
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.3'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: kramdown
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.5'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.5'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: jekyll
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.5'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.5'
|
55
|
+
description: Kramdown extension for Jekyll, which improves typography.
|
56
|
+
email: matej.jirasek@me.com
|
57
|
+
executables: []
|
58
|
+
extensions: []
|
59
|
+
extra_rdoc_files: []
|
60
|
+
files:
|
61
|
+
- LICENSE
|
62
|
+
- README.md
|
63
|
+
- lib/jekyll-truty.rb
|
64
|
+
- lib/jekyll-truty/jekyll.rb
|
65
|
+
- lib/jekyll-truty/kramdown.rb
|
66
|
+
homepage: https://github.com/mkj-is/jekyll-truty
|
67
|
+
licenses:
|
68
|
+
- MIT
|
69
|
+
metadata: {}
|
70
|
+
post_install_message:
|
71
|
+
rdoc_options: []
|
72
|
+
require_paths:
|
73
|
+
- lib
|
74
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 2.0.0
|
79
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
requirements: []
|
85
|
+
rubyforge_project:
|
86
|
+
rubygems_version: 2.4.3
|
87
|
+
signing_key:
|
88
|
+
specification_version: 4
|
89
|
+
summary: True typography converter for Jekyll
|
90
|
+
test_files: []
|
91
|
+
has_rdoc:
|