jekyll_outline 1.2.5 → 1.2.6
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +189 -15
- data/jekyll_outline.gemspec +9 -8
- data/lib/jekyll_outline/version.rb +1 -1
- data/lib/outline_tag.rb +5 -3
- metadata +3 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 789f862a50e91feb22e61715574c1358dfac651dd0029617333032d89bd3920a
|
4
|
+
data.tar.gz: 327437833f654e62df9e71540be12985eb98e518d4c87edd5f632aa4f5b9028a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac54e627cf7a5e839dff378e2d85c2c1d89ae6cad12fcdd1fa728591b0d3ed597d93c0af78787ef27ca15a4a4212b6f02156897b988f98c27587d9d73f297c1b
|
7
|
+
data.tar.gz: 4d6725aae2d9c428f9dcfbc2128918ca2bf43c626a26d235af7d183cb04d17252b8f1333ad125202e3c2fe8ef1a5880594bf68e1e52dfd3122e7d014116efc8b
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,11 +3,190 @@
|
|
3
3
|
`jekyll_outline` Jekyll tag plugin that creates a clickable table of contents.
|
4
4
|
|
5
5
|
|
6
|
+
## Order
|
7
|
+
|
8
|
+
This plugin requires every page in a collection to have an entry for
|
9
|
+
<code>order</code> in its front matter.
|
10
|
+
The value of <code>order</code> must be an integer.
|
11
|
+
This entry is normally used for sorting the pages.
|
12
|
+
|
13
|
+
The front matter for [this page](https://mslinn.com/jekyll_plugins/jekyll_outline.html) is:
|
14
|
+
|
15
|
+
```yaml
|
16
|
+
---
|
17
|
+
categories: [Jekyll]
|
18
|
+
date: 2020-10-03
|
19
|
+
description: "Organizes the index of a collection into chapters."
|
20
|
+
last_modified_at: 2025-01-09
|
21
|
+
layout: jekyll
|
22
|
+
order: 100
|
23
|
+
title: <span class="code">jekyll_outline</span>
|
24
|
+
---
|
25
|
+
```
|
26
|
+
|
27
|
+
|
28
|
+
## Examples
|
29
|
+
|
30
|
+
You can see this plugin in action in most of the index pages of [`mslinn.com`](https://mslinn.com).
|
31
|
+
Following is the source for two of them:
|
32
|
+
|
33
|
+
### [Django / Oscar](https://mslinn.com/django/index.html)
|
34
|
+
|
35
|
+
This is the simplest possible outline, without images.
|
36
|
+
|
37
|
+
```text
|
38
|
+
{% outline attribution django %}
|
39
|
+
0: Django / Oscar Evaluation
|
40
|
+
400: Notes
|
41
|
+
800: Digging Deeper
|
42
|
+
1900: Debugging
|
43
|
+
2700: Production
|
44
|
+
```
|
45
|
+
|
46
|
+
### [A/V Studio Technology](https://mslinn.com/av_studio/index.html)
|
47
|
+
|
48
|
+
This outline features images associated with specific entries.
|
49
|
+
|
50
|
+
```html
|
51
|
+
{% outline attribution av_studio %}
|
52
|
+
0: Production Infrastructure
|
53
|
+
150: Audio
|
54
|
+
200: Video
|
55
|
+
300: RME TotalMix
|
56
|
+
400: OBS Studio
|
57
|
+
500: Pro Tools
|
58
|
+
550: Ableton Live & Push
|
59
|
+
600: Other Music Software
|
60
|
+
700: MIDI Hardware & Software
|
61
|
+
800: Davinci Resolve
|
62
|
+
1000: Computer Analysis
|
63
|
+
2000: Music Theory
|
64
|
+
3000: Business
|
65
|
+
4000: General
|
66
|
+
{% endoutline %}
|
67
|
+
|
68
|
+
<div style="display: none">
|
69
|
+
{% img
|
70
|
+
align="right"
|
71
|
+
class=""
|
72
|
+
id="outline_150"
|
73
|
+
src="/av_studio/images/everse8/everse8d.webp"
|
74
|
+
size="eighthsize"
|
75
|
+
style="margin-top: 0"
|
76
|
+
wrapper_class="clear"
|
77
|
+
%}
|
78
|
+
{% img
|
79
|
+
align="right"
|
80
|
+
class=""
|
81
|
+
id="outline_200"
|
82
|
+
src="./images/equipment/sony_a7iii/sony_a7iii.webp"
|
83
|
+
size="eighthsize"
|
84
|
+
style="margin-top: 0"
|
85
|
+
wrapper_class="clear"
|
86
|
+
%}
|
87
|
+
{% img
|
88
|
+
align="right"
|
89
|
+
class=""
|
90
|
+
id="outline_300"
|
91
|
+
src="./images/rme/rme_logo.webp"
|
92
|
+
size="eighthsize"
|
93
|
+
style="margin-top: 0"
|
94
|
+
wrapper_class="clear"
|
95
|
+
%}
|
96
|
+
{% img
|
97
|
+
align="right"
|
98
|
+
class=""
|
99
|
+
id="outline_400"
|
100
|
+
src="./images/obsStudio/obs_logo.webp"
|
101
|
+
size="eighthsize"
|
102
|
+
style="margin-top: 0"
|
103
|
+
wrapper_class="clear"
|
104
|
+
%}
|
105
|
+
{% img
|
106
|
+
align="right"
|
107
|
+
class=""
|
108
|
+
id="outline_500"
|
109
|
+
src="./images/proTools/proToolsLogo.webp"
|
110
|
+
size="eighthsize"
|
111
|
+
style="margin-top: 0"
|
112
|
+
wrapper_class="clear"
|
113
|
+
%}
|
114
|
+
{% img
|
115
|
+
align="right"
|
116
|
+
class=""
|
117
|
+
id="outline_550"
|
118
|
+
src="./images/ableton/ableton_live_logo.webp"
|
119
|
+
size="eighthsize"
|
120
|
+
style="margin-top: 0"
|
121
|
+
wrapper_class="clear"
|
122
|
+
%}
|
123
|
+
{% img
|
124
|
+
align="right"
|
125
|
+
class="rounded"
|
126
|
+
id="outline_600"
|
127
|
+
src="./images/music21.webp"
|
128
|
+
size="eighthsize"
|
129
|
+
style="margin-top: 0"
|
130
|
+
wrapper_class="clear"
|
131
|
+
%}
|
132
|
+
{% img
|
133
|
+
align="right"
|
134
|
+
class=""
|
135
|
+
id="outline_700"
|
136
|
+
src="./images/midi/MIDI_logo.webp"
|
137
|
+
size="eighthsize"
|
138
|
+
style="margin-top: 0"
|
139
|
+
wrapper_class="clear"
|
140
|
+
%}
|
141
|
+
{% img
|
142
|
+
align="right"
|
143
|
+
class=""
|
144
|
+
id="outline_800"
|
145
|
+
src="./images/davinci_resolve/daVinci_resolve_logo.webp"
|
146
|
+
size="eighthsize"
|
147
|
+
style="margin-top: 0"
|
148
|
+
wrapper_class="clear"
|
149
|
+
%}
|
150
|
+
{% img
|
151
|
+
align="right"
|
152
|
+
class="rounded"
|
153
|
+
id="outline_2000"
|
154
|
+
src="./images/music_theory.webp"
|
155
|
+
size="eighthsize"
|
156
|
+
style="margin-top: 0"
|
157
|
+
wrapper_class="clear"
|
158
|
+
%}
|
159
|
+
{% img
|
160
|
+
align="right"
|
161
|
+
class=""
|
162
|
+
id="outline_4000"
|
163
|
+
src="./images/handsfree/pageflip_firefly.webp"
|
164
|
+
size="eighthsize"
|
165
|
+
style="margin-top: 0"
|
166
|
+
wrapper_class="clear"
|
167
|
+
%}
|
168
|
+
</div>
|
169
|
+
|
170
|
+
{% outline_js wrap_in_script_tag %}
|
171
|
+
```
|
172
|
+
|
173
|
+
|
6
174
|
## Usage
|
7
175
|
|
8
|
-
|
176
|
+
All files in a collection are included in the outline,
|
177
|
+
except for those whose name starts with `index`,
|
178
|
+
and those with the following in their front matter:
|
179
|
+
|
180
|
+
```yaml
|
181
|
+
exclude_from_outline: true
|
182
|
+
```
|
183
|
+
|
184
|
+
Note that Jekyll requires all documents in a collection to have a value for `order` in their front matter.
|
185
|
+
This value is ignored by `outline_tag` if `exclude_from_outline` has a truthy value.
|
9
186
|
|
10
|
-
|
187
|
+
The following examples are taken from [`demo/index.html`](demo/index.html).
|
188
|
+
|
189
|
+
Sort by the `order` field:
|
11
190
|
|
12
191
|
```html
|
13
192
|
{% outline attribution fields="<b> title </b> – <i> description </i>" stuff %}
|
@@ -53,7 +232,7 @@ followed by an indication of whether the document is visible (a draft) or not.
|
|
53
232
|
|
54
233
|
Entry can also include following fields:
|
55
234
|
`draft`, `categories`, `description`, `date`, `last_modified` or `last_modified_at`, `layout`, `order`, `title`, `slug`,
|
56
|
-
`ext`,
|
235
|
+
`ext`, and `tags`.
|
57
236
|
|
58
237
|
Specify the fields like this:
|
59
238
|
|
@@ -65,7 +244,7 @@ Specify the fields like this:
|
|
65
244
|
{% endoutline %}
|
66
245
|
```
|
67
246
|
|
68
|
-
Words that are not a
|
247
|
+
Words in the `fields` argument that are not recognized as a field are transcribed into the output.
|
69
248
|
|
70
249
|
In the above example, notice that the HTML is space delimited from the field names.
|
71
250
|
The parser is simple and stupid: each token is matched against the known keywords.
|
@@ -75,21 +254,14 @@ Tokens are separated by white space.
|
|
75
254
|
### CSS
|
76
255
|
|
77
256
|
The CSS used for the demo website should be copied to your project.
|
78
|
-
See
|
79
|
-
[`demo/assets/css/styles.css`](/mslinn/jekyll_outline/blob/master/demo/assets/css/style.css#L252-L315) as shown:
|
257
|
+
See [`demo/assets/css/jekyll_outline.css`](https://github.com/mslinn/jekyll_outline/blob/master/demo/assets/css/jekyll_outline.css).
|
80
258
|
|
81
|
-
```css
|
82
|
-
/* Start of jekyll_plugin_support css */
|
83
|
-
... copy this portion ...
|
84
|
-
/* End of jekyll_plugin_support css */
|
85
|
-
|
86
|
-
/* Start of jekyll_outline css */
|
87
|
-
... copy this portion ...
|
88
|
-
/* End of jekyll_outline css */
|
89
|
-
```
|
90
259
|
|
91
260
|
### JavaScript
|
92
261
|
|
262
|
+
Copy [`jekyll_outline.js`](https://github.com/mslinn/jekyll_outline/blob/master/demo/assets/js/jekyll_outline.js)
|
263
|
+
to your Jekyll website's JavaScript directory.
|
264
|
+
|
93
265
|
This project's `outline_js` tag returns the Javascript necessary to position images relating to the outline.
|
94
266
|
If used without parameters it just returns the JavaScript.
|
95
267
|
Use the tag this way:
|
@@ -153,6 +325,8 @@ and have `id`s that correspond to outline sections.
|
|
153
325
|
Each of following image's `id`s have an `outline_` prefix, followed by a number, which corresponds to one of the sections.
|
154
326
|
Note that leading zeros in the first column above are not present in the `id`s below.
|
155
327
|
|
328
|
+
Headings that do not have corresponding pages are not displayed.
|
329
|
+
|
156
330
|
If you want to provide images to embed at appropriate locations within the outline,
|
157
331
|
wrap them within an invisible `div` so the web page does not jump around as the images are loaded.
|
158
332
|
|
data/jekyll_outline.gemspec
CHANGED
@@ -3,8 +3,8 @@ require_relative 'lib/jekyll_outline/version'
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
github = 'https://github.com/mslinn/jekyll_outline'
|
5
5
|
|
6
|
-
spec.authors
|
7
|
-
spec.bindir
|
6
|
+
spec.authors = ['Mike Slinn']
|
7
|
+
spec.bindir = 'exe'
|
8
8
|
spec.description = <<~END_OF_DESC
|
9
9
|
Jekyll tag plugin that creates a clickable table of contents.
|
10
10
|
END_OF_DESC
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
'demo/assets/js/jekyll_outline.js'
|
15
15
|
]
|
16
16
|
spec.homepage = 'https://www.mslinn.com/jekyll_plugins/jekyll_outline.html'
|
17
|
-
spec.license
|
17
|
+
spec.license = 'MIT'
|
18
18
|
spec.metadata = {
|
19
19
|
'allowed_push_host' => 'https://rubygems.org',
|
20
20
|
'bug_tracker_uri' => "#{github}/issues",
|
@@ -22,17 +22,18 @@ Gem::Specification.new do |spec|
|
|
22
22
|
'homepage_uri' => spec.homepage,
|
23
23
|
'source_code_uri' => github,
|
24
24
|
}
|
25
|
-
spec.name
|
25
|
+
spec.name = 'jekyll_outline'
|
26
|
+
spec.platform = Gem::Platform::RUBY
|
26
27
|
spec.post_install_message = <<~END_MESSAGE
|
27
28
|
|
28
29
|
Thanks for installing #{spec.name}!
|
29
30
|
|
30
31
|
END_MESSAGE
|
31
|
-
spec.require_paths
|
32
|
+
spec.require_paths = ['lib']
|
32
33
|
spec.required_ruby_version = '>= 2.6.0'
|
33
|
-
spec.summary
|
34
|
-
spec.test_files
|
35
|
-
spec.version
|
34
|
+
spec.summary = 'Jekyll tag plugin that creates a clickable table of contents.'
|
35
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
36
|
+
spec.version = JekyllOutlineVersion::VERSION
|
36
37
|
|
37
38
|
spec.add_dependency 'jekyll', '>= 3.5.0'
|
38
39
|
spec.add_dependency 'jekyll_draft', '>= 2.0.2'
|
data/lib/outline_tag.rb
CHANGED
@@ -186,16 +186,18 @@ module JekyllSupport
|
|
186
186
|
@site
|
187
187
|
.collections[@collection_name]
|
188
188
|
.docs
|
189
|
-
.
|
189
|
+
.reject { |doc| doc.data['exclude_from_outline'] }
|
190
|
+
.find { |doc| doc.url.match(/#{doc_name}(.\w*)?$/) }
|
190
191
|
end
|
191
192
|
|
192
|
-
# Ignores files
|
193
|
+
# Ignores files whose name starts with `index`, and those with the following in their front matter:
|
194
|
+
# exclude_from_outline: true
|
193
195
|
def obtain_docs(collection_name)
|
194
196
|
abort "#{@collection_name} is not a valid collection." unless @site.collections.key? @collection_name
|
195
197
|
@site
|
196
198
|
.collections[collection_name]
|
197
199
|
.docs
|
198
|
-
.reject { |doc| doc.
|
200
|
+
.reject { |doc| doc.url.match(/index(.\w*)?$/) || doc.data['exclude_from_outline'] }
|
199
201
|
end
|
200
202
|
|
201
203
|
# Sort entries within the outline tag which do not have the property specified by @sort_by at the end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll_outline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Slinn
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-07 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: jekyll
|
@@ -102,8 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
101
|
- !ruby/object:Gem::Version
|
103
102
|
version: '0'
|
104
103
|
requirements: []
|
105
|
-
rubygems_version: 3.
|
106
|
-
signing_key:
|
104
|
+
rubygems_version: 3.6.3
|
107
105
|
specification_version: 4
|
108
106
|
summary: Jekyll tag plugin that creates a clickable table of contents.
|
109
107
|
test_files:
|