jekyll_outline 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -2
- data/CHANGELOG.md +3 -0
- data/README.md +31 -19
- data/jekyll_outline.gemspec +2 -2
- data/lib/jekyll_outline/version.rb +1 -1
- data/lib/outline_tag.rb +8 -5
- data/spec/status_persistence.txt +3 -0
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 464b66396b0abd3369669875ca6b2be97b51e7823e31d5fa163b4248afc0dc50
|
4
|
+
data.tar.gz: 1253ef8b8218d0c4f76cb66d5f79ef0bc4fef48cec8d057ef33b0af0411e352f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96bf42bd9e24050bf05fc9c5d1a2094383f2dd3853c301da97ce5e8276969de31ddc98cc5102f3288e46cb84ae9032a2e8c40813993445d837a5a60ffd4b0559
|
7
|
+
data.tar.gz: 56facfe2c9305b0945ad1d315018b078f1a0402b1c91655ea01a2741f9f39d2975bce5de31eb84490126f4b19700e98a617a84d61a17fbc27a225cc750b941ba
|
data/.rubocop.yml
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require:
|
2
|
-
- rubocop-
|
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
|
-
|
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
|
-
|
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’s website](https://www.mslinn.com/jekyll/3000-jekyll-plugins.html#outline).
|
120
128
|
|
121
129
|
|
122
130
|
## Development
|
123
|
-
|
124
|
-
|
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
|
-
##
|
154
|
-
A test website is provided in the `demo` directory.
|
155
|
-
|
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
|
-
$
|
172
|
+
$ demo/_bin/debug
|
160
173
|
```
|
161
174
|
|
162
|
-
3. Once the `Fast Debugger` signon appears, launch the Visual Studio Code launch
|
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).
|
data/jekyll_outline.gemspec
CHANGED
@@ -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/
|
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.
|
39
|
+
spec.add_dependency 'jekyll_plugin_support', '~> 0.6.0'
|
40
40
|
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
|
-
|
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)
|
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
|
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
|
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.
|
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-
|
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.
|
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.
|
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
|
-
|
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/
|
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
|
...
|