jekyll-asciidoc 1.1.2 → 2.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.
@@ -0,0 +1,12 @@
1
+ module Jekyll
2
+ module AsciiDoc
3
+ Configured = ::Module.new
4
+ Document = ::Module.new
5
+
6
+ module NoLiquid
7
+ def render_with_liquid?
8
+ false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,86 @@
1
+ module Jekyll
2
+ module AsciiDoc
3
+ module Utils; extend self
4
+ NewLine = %(\n)
5
+ StandaloneOptionLine = %([%standalone]#{NewLine})
6
+ AttributeReferenceRx = /\\?\{(\w+(?:[\-]\w+)*)\}/
7
+
8
+ def has_front_matter? dlg_method, asciidoc_ext_re, path
9
+ (::File.extname path) =~ asciidoc_ext_re ? true : (dlg_method.call path)
10
+ end
11
+
12
+ begin # supports Jekyll >= 2.3.0
13
+ define_method :has_yaml_header?, &(::Jekyll::Utils.method :has_yaml_header?)
14
+ rescue ::NameError; end
15
+
16
+ def hashify_attributes attrs, initial = {}
17
+ if (is_array = ::Array === attrs) || ::Hash === attrs
18
+ attrs.each_with_object(initial) {|entry, new_attrs|
19
+ key, val = is_array ? ((entry.split '=', 2) + ['', ''])[0..1] : entry
20
+ if key.start_with? '!'
21
+ new_attrs[key[1..-1]] = nil
22
+ elsif key.end_with? '!'
23
+ new_attrs[key.chop] = nil
24
+ else
25
+ new_attrs[key] = val ? (resolve_attribute_refs val, new_attrs) : nil
26
+ end
27
+ }
28
+ else
29
+ initial
30
+ end
31
+ end
32
+
33
+ def resolve_attribute_refs text, table
34
+ if text.empty?
35
+ text
36
+ elsif text.include? '{'
37
+ text.gsub AttributeReferenceRx do
38
+ if $&.start_with? '\\'
39
+ $&[1..-1]
40
+ elsif (value = table[$1])
41
+ value
42
+ else
43
+ $&
44
+ end
45
+ end
46
+ else
47
+ text
48
+ end
49
+ end
50
+
51
+ def symbolize_keys hash
52
+ hash.each_with_object({}) {|(key, val), accum| accum[key.to_sym] = val }
53
+ end
54
+
55
+ def get_converter site
56
+ site.find_converter_instance Converter
57
+ end
58
+
59
+ # Parse the specified value as though it is a single-line value part of a
60
+ # YAML key/value pair.
61
+ #
62
+ # Attempt to parse the specified String value as though it is a
63
+ # single-line value part of a YAML key/value pair. If the value fails to
64
+ # parse, wrap the value in single quotes (after escaping any single
65
+ # quotes in the value) and parse it as a character sequence. If the value
66
+ # is empty, return an empty String.
67
+ #
68
+ # val - The String value to parse.
69
+ #
70
+ # Returns an [Object] parsed from the string-based YAML value or empty
71
+ # [String] if the specified value is empty.
72
+ def parse_yaml_value val
73
+ if val.empty?
74
+ ''
75
+ else
76
+ begin
77
+ ::SafeYAML.load %(--- #{val})
78
+ rescue
79
+ val = val.gsub '\'', '\'\'' if val.include? '\''
80
+ ::SafeYAML.load %(--- \'#{val}\')
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module AsciiDoc
3
- VERSION = '1.1.2'
3
+ VERSION = '2.0.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-asciidoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Allen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-11 00:00:00.000000000 Z
11
+ date: 2016-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -16,43 +16,57 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.4
19
+ version: 1.5.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.4
26
+ version: 1.5.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: jekyll
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 2.3.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 2.3.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rake
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - "~>"
45
+ - - ">="
32
46
  - !ruby/object:Gem::Version
33
- version: '10.0'
47
+ version: '0'
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - "~>"
52
+ - - ">="
39
53
  - !ruby/object:Gem::Version
40
- version: '10.0'
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
- name: jekyll
56
+ name: rspec
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - ">"
59
+ - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: 1.0.0
61
+ version: 3.5.0
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - ">"
66
+ - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: 1.0.0
55
- description: A Jekyll plugin that converts AsciiDoc files in your site source to HTML
68
+ version: 3.5.0
69
+ description: A Jekyll plugin that converts AsciiDoc source files in your site to HTML
56
70
  pages using Asciidoctor.
57
71
  email:
58
72
  - dan.j.allen@gmail.com
@@ -60,10 +74,16 @@ executables: []
60
74
  extensions: []
61
75
  extra_rdoc_files: []
62
76
  files:
63
- - LICENSE
77
+ - LICENSE.adoc
64
78
  - README.adoc
65
79
  - Rakefile
66
80
  - lib/jekyll-asciidoc.rb
81
+ - lib/jekyll-asciidoc/compat.rb
82
+ - lib/jekyll-asciidoc/converter.rb
83
+ - lib/jekyll-asciidoc/filters.rb
84
+ - lib/jekyll-asciidoc/integrator.rb
85
+ - lib/jekyll-asciidoc/mixins.rb
86
+ - lib/jekyll-asciidoc/utils.rb
67
87
  - lib/jekyll-asciidoc/version.rb
68
88
  homepage: https://github.com/asciidoctor/jekyll-asciidoc
69
89
  licenses:
@@ -88,6 +108,6 @@ rubyforge_project:
88
108
  rubygems_version: 2.5.1
89
109
  signing_key:
90
110
  specification_version: 4
91
- summary: A Jekyll plugin that converts AsciiDoc files in your site source to HTML
111
+ summary: A Jekyll plugin that converts AsciiDoc source files in your site to HTML
92
112
  pages using Asciidoctor.
93
113
  test_files: []