jekyll_outline 1.1.0 → 1.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3efed359f1a20b1b255dff89ae002fc464162ae11f2ffbaaf2463cfdce031cfa
4
- data.tar.gz: ba1a9378d1424cc673fb75bcc0bd8a0758b6861facb66474a24dad19a568940d
3
+ metadata.gz: 464b66396b0abd3369669875ca6b2be97b51e7823e31d5fa163b4248afc0dc50
4
+ data.tar.gz: 1253ef8b8218d0c4f76cb66d5f79ef0bc4fef48cec8d057ef33b0af0411e352f
5
5
  SHA512:
6
- metadata.gz: a1147061ffb817c16a64002a8b300380943a319eb44c0077c54f76b9d6cd2f6d4500778fd369deed65f7256357feb5140129bda26be08344b2149bce00861b06
7
- data.tar.gz: d03d8db73e90f7c39aa5b6f8f379ab2cfe8d47dae740e2e0a9d6355ac486713db28e02af07145e33279cba2d9aba982ae10f07c08087c192c953851d7fd51f25
6
+ metadata.gz: 96bf42bd9e24050bf05fc9c5d1a2094383f2dd3853c301da97ce5e8276969de31ddc98cc5102f3288e46cb84ae9032a2e8c40813993445d837a5a60ffd4b0559
7
+ data.tar.gz: 56facfe2c9305b0945ad1d315018b078f1a0402b1c91655ea01a2741f9f39d2975bce5de31eb84490126f4b19700e98a617a84d61a17fbc27a225cc750b941ba
data/.rubocop.yml CHANGED
@@ -1,6 +1,8 @@
1
1
  require:
2
- - rubocop-rspec
2
+ - rubocop-md
3
+ - rubocop-performance
3
4
  - rubocop-rake
5
+ - rubocop-rspec
4
6
 
5
7
  AllCops:
6
8
  Exclude:
@@ -17,7 +19,8 @@ Gemspec/RequireMFA:
17
19
  Enabled: false
18
20
 
19
21
  Layout/HashAlignment:
20
- Enabled: false
22
+ EnforcedColonStyle: table
23
+ EnforcedHashRocketStyle: table
21
24
 
22
25
  Layout/LineLength:
23
26
  Max: 150
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 1.1.1 / 2023-04-02
2
+ * Added [`attribution` support](https://github.com/mslinn/jekyll_plugin_support#subclass-attribution).
3
+
1
4
  ## 1.1.0 / 2023-03-14
2
5
  * `outline_js` tag added, for including Javascript necessary to position images relating to the outline.
3
6
  * Now generates a series of divs, instead of one big div.
data/README.md CHANGED
@@ -6,11 +6,12 @@
6
6
 
7
7
 
8
8
  ## Installation
9
-
10
- Add this line to your application's Gemfile:
9
+ Add the following line to your Jekyll project's Gemfile, within the `jekyll_plugins` group:
11
10
 
12
11
  ```ruby
13
- gem 'jekyll_outline'
12
+ group :jekyll_plugins do
13
+ gem 'jekyll_outline'
14
+ end
14
15
  ```
15
16
 
16
17
  And then execute:
@@ -45,7 +46,6 @@ If passed the `wrap_in_script_tag` parameter, it wraps the JavaScript in `<scrip
45
46
 
46
47
 
47
48
  ## Explanation
48
-
49
49
  Given an outline that looks like this:
50
50
  ```html
51
51
  {% outline stuff %}
@@ -85,7 +85,10 @@ and have `id`s that correspond to outline sections.
85
85
 
86
86
  Each of following image's `id`s have a `outline_` prefix, followed by a number, which corresponds to one of the sections.
87
87
  Note that leading zeros in the first column above are not present in the `id`s below.
88
+
89
+ The images are wrapped within an invisible `div` so the web page does not jump around as the images are loaded.
88
90
  ```html
91
+ <div style="display: none;">
89
92
  {% img align="right"
90
93
  id="outline_0"
91
94
  size="quartersize"
@@ -107,6 +110,7 @@ Note that leading zeros in the first column above are not present in the `id`s b
107
110
  style="margin-top: 0"
108
111
  wrapper_class="clear"
109
112
  %}
113
+ </div>
110
114
  ```
111
115
  The JavaScript identifies the images and repositions them in the DOM such that they follow the appropriate heading.
112
116
  If no image corresponds to a heading, no error or warning is generated.
@@ -114,20 +118,18 @@ The images can be located anywhere on the page; they will be relocated appropria
114
118
  If an image does not correspond to a heading, it is deleted.
115
119
 
116
120
 
121
+ ## Attribution
122
+ See [`jekyll_plugin_support` for `attribution`](https://github.com/mslinn/jekyll_plugin_support#subclass-attribution)
123
+
124
+
117
125
  ## Additional Information
118
126
  More information is available on
119
127
  [Mike Slinn&rsquo;s website](https://www.mslinn.com/jekyll/3000-jekyll-plugins.html#outline).
120
128
 
121
129
 
122
130
  ## Development
123
-
124
- After checking out the repo, run `bin/setup` to install dependencies.
125
- You can also run `bin/console` for an interactive prompt that will allow you to experiment.
126
-
127
- Install development dependencies like this:
128
- ```
129
- $ BUNDLE_WITH="development" bundle install
130
- ```
131
+ After checking out the repo, run `bin/setup` to install development dependencies.
132
+ Then you can run `bin/console` for an interactive prompt that will allow you to experiment with `irb`.
131
133
 
132
134
  To build and install this gem onto your local machine, run:
133
135
  ```shell
@@ -150,16 +152,28 @@ jekyll_outline (0.1.0)
150
152
  ```
151
153
 
152
154
 
153
- ## Test
154
- A test website is provided in the `demo` directory.
155
- 1. Set breakpoints.
155
+ ## Demo
156
+ A demo / test website is provided in the `demo` directory.
157
+ It can be used to debug the plugin or to run freely.
158
+
159
+ ### Run Freely
160
+ 1. Run from the command line:
161
+ ```shell
162
+ $ demo/_bin/debug -r
163
+ ```
164
+
165
+ 2. View the generated website at [`http://localhost:4444`](http://localhost:4444)
166
+
167
+ ### Plugin Debugging
168
+ 1. Set breakpoints in Visual Studio Code.
156
169
 
157
170
  2. Initiate a debug session from the command line:
158
171
  ```shell
159
- $ bin/attach demo
172
+ $ demo/_bin/debug
160
173
  ```
161
174
 
162
- 3. Once the `Fast Debugger` signon appears, launch the Visual Studio Code launch configuration called `Attach rdebug-ide`.
175
+ 3. Once the `Fast Debugger` signon appears, launch the Visual Studio Code launch
176
+ configuration called `Attach rdebug-ide`.
163
177
 
164
178
  4. View the generated website at [`http://localhost:4444`](http://localhost:4444)
165
179
 
@@ -178,10 +192,8 @@ To release a new version,
178
192
 
179
193
 
180
194
  ## Contributing
181
-
182
195
  Bug reports and pull requests are welcome on GitHub at https://github.com/mslinn/jekyll_outline.
183
196
 
184
197
 
185
198
  ## License
186
-
187
199
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  '.rubocop.yml', 'LICENSE.*', 'Rakefile', '{lib,spec}/**/*', '*.gemspec', '*.md',
14
14
  'demo/assets/js/jekyll_outline.js'
15
15
  ]
16
- spec.homepage = 'https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#outline'
16
+ spec.homepage = 'https://www.mslinn.com/jekyll/3000-jekyll-plugins.html#outline'
17
17
  spec.license = 'MIT'
18
18
  spec.metadata = {
19
19
  'allowed_push_host' => 'https://rubygems.org',
@@ -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', '~> 1.1.0'
39
- spec.add_dependency 'jekyll_plugin_support', '~> 0.5.0'
39
+ spec.add_dependency 'jekyll_plugin_support', '~> 0.6.0'
40
40
  end
@@ -1,3 +1,3 @@
1
1
  module JekyllOutlineVersion
2
- VERSION = '1.1.0'.freeze
2
+ VERSION = '1.1.1'.freeze
3
3
  end
data/lib/outline_tag.rb CHANGED
@@ -20,7 +20,7 @@ module OutlineTag
20
20
  end
21
21
 
22
22
  def to_s
23
- " <h3 class='post_title clear' id=\"title_#{order}\">#{title}</h3>"
23
+ " <h3 class='post_title clear' id=\"title_#{@order}\">#{@title}</h3>"
24
24
  end
25
25
  end
26
26
 
@@ -30,15 +30,18 @@ module OutlineTag
30
30
  FIXNUM_MAX = (2**((0.size * 8) - 2)) - 1
31
31
 
32
32
  def render_impl(text)
33
- @collection_name = argument_string.strip
33
+ headers = make_headers(super) # Process the block content.
34
+
35
+ @helper.gem_file __FILE__
36
+ @collection_name = @helper.remaining_markup
34
37
  abort 'OutlineTag: collection_name was not specified' unless @collection_name
35
38
 
36
- headers = make_headers(super) # Process the block content.
37
39
  collection = headers + obtain_docs(@collection_name)
38
40
  <<~HEREDOC
39
41
  <div class="outer_posts">
40
- #{make_entries(collection).join("\n")}
42
+ #{make_entries(collection)&.join("\n")}
41
43
  </div>
44
+ #{@helper.attribute if @helper.attribution}
42
45
  HEREDOC
43
46
  end
44
47
 
@@ -56,7 +59,7 @@ module OutlineTag
56
59
  # @section_state can have values: :head, :in_body
57
60
  # @param collection Array of Jekyll::Document and Outline::Header
58
61
  # @return Array of String
59
- def make_entries(collection) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Layout/LineEndStringConcatenationIndentation
62
+ def make_entries(collection) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
60
63
  sorted = collection.sort_by(&obtain_order)
61
64
  pruned = remove_empty_headers(sorted)
62
65
  @section_state = :head
@@ -0,0 +1,3 @@
1
+ example_id | status | run_time |
2
+ ---------------------------------- | ------ | --------------- |
3
+ ./spec/jekyll_outline_spec.rb[1:1] | passed | 0.00023 seconds |
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.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Slinn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-15 00:00:00.000000000 Z
11
+ date: 2023-04-06 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: 0.5.0
47
+ version: 0.6.0
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: 0.5.0
54
+ version: 0.6.0
55
55
  description: 'Jekyll tag plugin that creates a clickable table of contents.
56
56
 
57
57
  '
@@ -74,14 +74,15 @@ files:
74
74
  - lib/outline_tag.rb
75
75
  - spec/outline_spec.rb
76
76
  - spec/spec_helper.rb
77
- homepage: https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#outline
77
+ - spec/status_persistence.txt
78
+ homepage: https://www.mslinn.com/jekyll/3000-jekyll-plugins.html#outline
78
79
  licenses:
79
80
  - MIT
80
81
  metadata:
81
82
  allowed_push_host: https://rubygems.org
82
83
  bug_tracker_uri: https://github.com/mslinn/jekyll_outline/issues
83
84
  changelog_uri: https://github.com/mslinn/jekyll_outline/CHANGELOG.md
84
- homepage_uri: https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#outline
85
+ homepage_uri: https://www.mslinn.com/jekyll/3000-jekyll-plugins.html#outline
85
86
  source_code_uri: https://github.com/mslinn/jekyll_outline
86
87
  post_install_message: |2+
87
88
 
@@ -108,4 +109,5 @@ summary: Jekyll tag plugin that creates a clickable table of contents.
108
109
  test_files:
109
110
  - spec/outline_spec.rb
110
111
  - spec/spec_helper.rb
112
+ - spec/status_persistence.txt
111
113
  ...