jekyll_outline 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 296c5201e11daec7ec2e91ae703662ba44cfb7ca592da27adf61c23943a3c100
4
- data.tar.gz: 246e14ecb99ecf5a7510e7bcbd40eb5cfa58eb8e3cd740f33a726bc7b42cda78
3
+ metadata.gz: a31ba9e3b1f1b0962f5ac28695f41b2594acde555195fdcbbf0460fa220be66e
4
+ data.tar.gz: bdd1e6536607a24271019aa3cc24e5de35e71b1ac4c61b925f286bb41dd5521c
5
5
  SHA512:
6
- metadata.gz: a3667c2afb14fb58fb6192149d51265ea54cbb745968ce0a04ba208bbf7a1cf807994a2f2057d38a57759d5679a89ac2a69cd52f829b1e61034c7daea158d02f
7
- data.tar.gz: 04e34bcdd95b84affb8b9a73e7a638c9013bc978ba393d11591772a132e4191237c168374fc6d203ce51525945a76350c2f79e6b31f140723f988296678c2585
6
+ metadata.gz: e815455631865429afb66cfffce54187e4696e0ecb7e3571050ab98fa6991bd679791a212cdc9915b4e9a9d0c199bf6af0ca9d77a09babe89d7d5fa83a88fa4d
7
+ data.tar.gz: bcc3910b01ca8d3c99ed101764350f17c95826f3b375733215f35659a6027605452881b528197709d1143b576c7c52cf2b51aad3971c1781b03b97c414f8d1dc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.2.5 / 2024-08-20
4
+
5
+ * Added configurable error handling
6
+ * Updated to jekyll_plugin_support v1.0.2
7
+ * Defined `outline_error` CSS class in `demo/assets/css/jekyll_outline.css`.
8
+
9
+
3
10
  ## 1.2.4 / 2024-07-23
4
11
 
5
12
  * Updated dependencies to rely on current `jekyll_draft`.
@@ -36,5 +36,5 @@ Gem::Specification.new do |spec|
36
36
 
37
37
  spec.add_dependency 'jekyll', '>= 3.5.0'
38
38
  spec.add_dependency 'jekyll_draft', '>= 2.0.2'
39
- spec.add_dependency 'jekyll_plugin_support', '>= 1.0.0'
39
+ spec.add_dependency 'jekyll_plugin_support', '>= 1.0.2'
40
40
  end
@@ -1,3 +1,3 @@
1
1
  module JekyllOutlineVersion
2
- VERSION = '1.2.4'.freeze
2
+ VERSION = '1.2.5'.freeze
3
3
  end
data/lib/outline_tag.rb CHANGED
@@ -62,6 +62,10 @@ module JekyllSupport
62
62
  headers = make_headers(super) # Process the block content.
63
63
 
64
64
  @helper.gem_file __FILE__
65
+
66
+ @die_on_outline_error = @tag_config['die_on_outline_error'] == true if @tag_config
67
+ @pry_on_outline_error = @tag_config['pry_on_outline_error'] == true if @tag_config
68
+
65
69
  @fields = @helper.parameter_specified?('fields')&.split || ['title']
66
70
  @sort_by = @helper.parameter_specified?('sort_by_title') ? 'title' : 'order'
67
71
  @collection_name = @helper.remaining_markup
@@ -70,6 +74,12 @@ module JekyllSupport
70
74
  @docs = obtain_docs(@collection_name)
71
75
  collection = headers + @docs
72
76
  render_outline collection
77
+ rescue OutlineError => e # jekyll_plugin_support handles StandardError
78
+ @logger.error { JekyllPluginHelper.remove_html_tags e.logger_message }
79
+ binding.pry if @pry_on_outline_error # rubocop:disable Lint/Debugger
80
+ exit! 1 if @die_on_outline_error
81
+
82
+ e.html_message
73
83
  end
74
84
 
75
85
  # Overload this for a subclass
@@ -95,11 +105,18 @@ module JekyllSupport
95
105
  yaml = YAML.safe_load content
96
106
  yaml.map { |entry| Header.new entry }
97
107
  rescue NoMethodError => e
98
- raise OutlineError, "Invalid YAML within {% outline %} tag;<br>\nNoMethodError #{e.message}"
108
+ raise OutlineError, <<~END_MSG
109
+ Invalid YAML within {% outline %} tag. The offending content was:
110
+
111
+ <pre>#{content}</pre>
112
+ END_MSG
99
113
  rescue Psych::SyntaxError => e
100
- raise OutlineError, "Invalid YAML within {% outline %} tag;<br>\nPsych::SyntaxError #{e.message}"
101
- rescue StandardError => e
102
- raise OutlineError, e.message
114
+ msg = <<~END_MSG
115
+ Invalid YAML found within {% outline %} tag:<br>
116
+ <pre>#{e.message}</pre>
117
+ END_MSG
118
+ @logger.error { e.message }
119
+ raise OutlineError, msg
103
120
  end
104
121
 
105
122
  # @section_state can have values: :head, :in_body
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_outline
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Slinn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-27 00:00:00.000000000 Z
11
+ date: 2024-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 1.0.0
47
+ version: 1.0.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 1.0.0
54
+ version: 1.0.2
55
55
  description: 'Jekyll tag plugin that creates a clickable table of contents.
56
56
 
57
57
  '
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  requirements: []
105
- rubygems_version: 3.5.16
105
+ rubygems_version: 3.5.17
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Jekyll tag plugin that creates a clickable table of contents.