jekyll-markright 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/jekyll-markright.rb +42 -0
  3. metadata +87 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9a58831dc356ed413a276681cf3b07ed6a882330
4
+ data.tar.gz: 5d75b76b8f93f04973ffdd19f2164db99cc007b2
5
+ SHA512:
6
+ metadata.gz: 565d9460a95ec7897e7ca6ab62a741de1f2a444c1ececb8c0710387e4494d314489e09a35dc7f6eaa7ee2c75d8d01596fa3ec17419fc552b09533a0f70ed88e9
7
+ data.tar.gz: 4fe0596721cb8b5ebb4f79b67c77307a56949e2d0cf106ed3112e447f1018470f8541efc230b1f1654f21db5996018caba229e2291d27a1cfdef0547ca98a0b6
@@ -0,0 +1,42 @@
1
+ require 'kramdown'
2
+
3
+ class Jekyll::Converters::Markdown::Markright
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
+ ::Kramdown::Document.new(content, @config['kramdown']).to_RTL
15
+ end
16
+ end
17
+
18
+
19
+ module Kramdown
20
+ module Converter
21
+ class RTL < Html
22
+ def convert_codeblock(el, indent)
23
+ if not el.attr['dir']
24
+ el.attr['dir'] = 'ltr'
25
+ end
26
+ return super(el, indent)
27
+ end
28
+
29
+ def convert_codespan(el, indent)
30
+ if not el.attr['dir']
31
+ el.attr['dir'] = 'ltr'
32
+ end
33
+ return super(el, indent)
34
+ end
35
+
36
+ def add_code_tags(code)
37
+ code = code.sub(/<pre>/,'<pre><code dir="ltr">')
38
+ code = code.sub(/<\/pre>/,"</code></pre>")
39
+ end
40
+ end
41
+ end
42
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-markright
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Mehdi Sadeghi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-08-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: markdown
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.12'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.12'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description:
56
+ email:
57
+ - mehdi@mehdix.org
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - lib/jekyll-markright.rb
63
+ homepage: https://github.com/mehdisadeghi/jekyll-markright
64
+ licenses:
65
+ - MIT
66
+ metadata: {}
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubyforge_project:
83
+ rubygems_version: 2.6.11
84
+ signing_key:
85
+ specification_version: 4
86
+ summary: Jekyll plugin that patches kramdown to be RTL friendly.
87
+ test_files: []