jekyll_outline 1.0.0 → 1.0.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 +4 -4
- data/.rubocop.yml +39 -8
- data/CHANGELOG.md +6 -0
- data/README.md +25 -11
- data/Rakefile +3 -5
- data/jekyll_outline.gemspec +37 -0
- data/lib/jekyll_outline/version.rb +1 -3
- data/lib/jekyll_outline.rb +17 -37
- data/spec/outline_spec.rb +13 -0
- data/spec/spec_helper.rb +4 -6
- metadata +16 -18
- data/jekyll_run.gemspec +0 -48
- data/spec/jekyll_outline_spec.rb +0 -14
- data/spec/status_persistence.txt +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed799d887e818fc21f0892c7c7fe550081352b98554bc4dae0fc8d6fb04b0a90
|
4
|
+
data.tar.gz: ae4fd7f8a48d45abcabad5207566a8f96d0fe8b14e0016b294f54c9ba576f7fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac864827baf9f274f85d9f52c84e38216bd8edd6ebd86be766b8002d966050cdc14e8f966bf905edbd7362386620bc012d7f66fd18c86c74eabafb564bdc8a04
|
7
|
+
data.tar.gz: cc3cfd1e248224f34b242aa501a8cdf12f8d86dd26f46b09449f22505f4a33e6840892bccd875defcf558ae8822af68085751808318a9c2cb823eee35342438f
|
data/.rubocop.yml
CHANGED
@@ -1,17 +1,48 @@
|
|
1
|
-
require:
|
2
|
-
|
3
|
-
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
- rubocop-rake
|
4
4
|
|
5
5
|
AllCops:
|
6
6
|
Exclude:
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
- exe/**/*
|
8
|
+
- vendor/**/*
|
9
|
+
- Gemfile*
|
10
10
|
NewCops: enable
|
11
11
|
TargetRubyVersion: 2.6
|
12
12
|
|
13
|
+
Gemspec/DeprecatedAttributeAssignment:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Gemspec/RequireMFA:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Layout/HashAlignment:
|
20
|
+
Enabled: false
|
21
|
+
|
13
22
|
Layout/LineLength:
|
14
23
|
Max: 150
|
15
24
|
|
16
|
-
|
17
|
-
|
25
|
+
Metrics/BlockLength:
|
26
|
+
Exclude:
|
27
|
+
- jekyll_outline.gemspec
|
28
|
+
Max: 30
|
29
|
+
|
30
|
+
Metrics/MethodLength:
|
31
|
+
Max: 30
|
32
|
+
|
33
|
+
Naming/FileName:
|
34
|
+
Exclude:
|
35
|
+
- Rakefile
|
36
|
+
|
37
|
+
Style/Documentation:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
Style/FrozenStringLiteralComment:
|
41
|
+
Enabled: false
|
42
|
+
|
43
|
+
Style/TrailingCommaInHashLiteral:
|
44
|
+
EnforcedStyleForMultiline: comma
|
45
|
+
|
46
|
+
RSpec/FilePath:
|
47
|
+
IgnoreMethods: true
|
48
|
+
SpecSuffixOnly: true
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -17,19 +17,16 @@ And then execute:
|
|
17
17
|
|
18
18
|
$ bundle install
|
19
19
|
|
20
|
-
Or install it yourself as:
|
21
|
-
|
22
|
-
$ gem install jekyll_outline
|
23
|
-
|
24
20
|
|
25
21
|
## Additional Information
|
26
22
|
More information is available on
|
27
|
-
[Mike Slinn’s website](https://www.mslinn.com/
|
23
|
+
[Mike Slinn’s website](https://www.mslinn.com/jekyll/3000-jekyll-plugins.html#outline).
|
28
24
|
|
29
25
|
|
30
26
|
## Development
|
31
27
|
|
32
|
-
After checking out the repo, run `bin/setup` to install dependencies.
|
28
|
+
After checking out the repo, run `bin/setup` to install dependencies.
|
29
|
+
You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
33
30
|
|
34
31
|
Install development dependencies like this:
|
35
32
|
```
|
@@ -39,14 +36,14 @@ $ BUNDLE_WITH="development" bundle install
|
|
39
36
|
To build and install this gem onto your local machine, run:
|
40
37
|
```shell
|
41
38
|
$ bundle exec rake install
|
42
|
-
jekyll_outline 1.0
|
43
|
-
jekyll_outline (1.0
|
39
|
+
jekyll_outline 0.1.0 built to pkg/jekyll_outline-0.1.0.gem.
|
40
|
+
jekyll_outline (0.1.0) installed.
|
44
41
|
|
45
42
|
$ gem info jekyll_outline
|
46
43
|
|
47
44
|
*** LOCAL GEMS ***
|
48
45
|
|
49
|
-
jekyll_outline (1.0
|
46
|
+
jekyll_outline (0.1.0)
|
50
47
|
Author: Mike Slinn
|
51
48
|
Homepage:
|
52
49
|
https://github.com/mslinn/jekyll_outline
|
@@ -56,10 +53,27 @@ jekyll_outline (1.0.0)
|
|
56
53
|
Generates Jekyll logger with colored output.
|
57
54
|
```
|
58
55
|
|
56
|
+
|
57
|
+
## Test
|
58
|
+
A test website is provided in the `demo` directory.
|
59
|
+
1. Set breakpoints.
|
60
|
+
|
61
|
+
2. Initiate a debug session from the command line:
|
62
|
+
```shell
|
63
|
+
$ bin/attach demo
|
64
|
+
```
|
65
|
+
|
66
|
+
3. Once the `Fast Debugger` signon appears, launch the Visual Studio Code launch configuration called `Attach rdebug-ide`.
|
67
|
+
|
68
|
+
4. View the generated website at [`http://localhost:4444`](http://localhost:4444)
|
69
|
+
|
70
|
+
|
71
|
+
## Release
|
59
72
|
To release a new version,
|
60
73
|
1. Update the version number in `version.rb`.
|
61
|
-
2.
|
62
|
-
3.
|
74
|
+
2. Describe the changes in `CHANGELOG.md`.
|
75
|
+
3. Commit all changes to git; if you don't the next step might fail with an unexplainable error message.
|
76
|
+
4. Run the following:
|
63
77
|
```shell
|
64
78
|
$ bundle exec rake release
|
65
79
|
```
|
data/Rakefile
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative 'lib/jekyll_outline/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
github = 'https://github.com/mslinn/jekyll_outline'
|
5
|
+
|
6
|
+
spec.authors = ['Mike Slinn']
|
7
|
+
spec.bindir = 'exe'
|
8
|
+
spec.description = <<~END_OF_DESC
|
9
|
+
Jekyll tag plugin that creates a clickable table of contents.
|
10
|
+
END_OF_DESC
|
11
|
+
spec.email = ['mslinn@mslinn.com']
|
12
|
+
spec.files = Dir['.rubocop.yml', 'LICENSE.*', 'Rakefile', '{lib,spec}/**/*', '*.gemspec', '*.md']
|
13
|
+
spec.homepage = 'https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#outline'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
spec.metadata = {
|
16
|
+
'allowed_push_host' => 'https://rubygems.org',
|
17
|
+
'bug_tracker_uri' => "#{github}/issues",
|
18
|
+
'changelog_uri' => "#{github}/CHANGELOG.md",
|
19
|
+
'homepage_uri' => spec.homepage,
|
20
|
+
'source_code_uri' => github,
|
21
|
+
}
|
22
|
+
spec.name = 'jekyll_outline'
|
23
|
+
spec.post_install_message = <<~END_MESSAGE
|
24
|
+
|
25
|
+
Thanks for installing #{spec.name}!
|
26
|
+
|
27
|
+
END_MESSAGE
|
28
|
+
spec.require_paths = ['lib']
|
29
|
+
spec.required_ruby_version = '>= 2.6.0'
|
30
|
+
spec.summary = 'Jekyll tag plugin that creates a clickable table of contents.'
|
31
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
32
|
+
spec.version = JekyllOutlineVersion::VERSION
|
33
|
+
|
34
|
+
spec.add_dependency 'jekyll', '>= 3.5.0'
|
35
|
+
spec.add_dependency 'jekyll_draft', '~> 1.1.1'
|
36
|
+
spec.add_dependency 'jekyll_plugin_support', '~> 0.5.0'
|
37
|
+
end
|
data/lib/jekyll_outline.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
# @author Copyright 2022 {https://www.mslinn.com Michael Slinn}
|
4
2
|
|
5
|
-
require
|
6
|
-
require
|
3
|
+
require 'jekyll_draft'
|
4
|
+
require 'jekyll_plugin_logger'
|
5
|
+
require 'jekyll_plugin_support'
|
7
6
|
require 'yaml'
|
8
7
|
|
9
8
|
module Outline
|
10
|
-
PLUGIN_NAME =
|
9
|
+
PLUGIN_NAME = 'outline'.freeze
|
11
10
|
|
12
11
|
# Interleaves with docs
|
13
12
|
class Header
|
@@ -26,32 +25,16 @@ module Outline
|
|
26
25
|
end
|
27
26
|
end
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
# @param argument_string [String] the arguments from the web page.
|
36
|
-
# @param _parse_context [Liquid::ParseContext] hash that stores Liquid options.
|
37
|
-
# By default it has two keys: :locale and :line_numbers, the first is a Liquid::I18n object, and the second,
|
38
|
-
# a boolean parameter that determines if error messages should display the line number the error occurred.
|
39
|
-
# This argument is used mostly to display localized error messages on Liquid built-in Tags and Filters.
|
40
|
-
# See https://github.com/Shopify/liquid/wiki/Liquid-for-Programmers#create-your-own-tags
|
41
|
-
# @return [void]
|
42
|
-
def initialize(tag_name, argument_string, _parse_context)
|
43
|
-
super
|
44
|
-
@logger = PluginMetaLogger.instance.new_logger(self, PluginMetaLogger.instance.config)
|
28
|
+
class OutlineTag < JekyllSupport::JekyllBlock
|
29
|
+
include JekyllOutlineVersion
|
30
|
+
|
31
|
+
FIXNUM_MAX = (2**((0.size * 8) - 2)) - 1
|
32
|
+
|
33
|
+
def render_impl(text)
|
45
34
|
@collection_name = argument_string.strip
|
46
|
-
abort
|
47
|
-
end
|
35
|
+
abort 'OutlineTag: collection_name was not specified' unless @collection_name
|
48
36
|
|
49
|
-
# Method prescribed by the Jekyll plugin lifecycle.
|
50
|
-
# @param liquid_context [Liquid::Context]
|
51
|
-
# @return [String]
|
52
|
-
def render(liquid_context)
|
53
37
|
headers = make_headers(super) # Process the block content.
|
54
|
-
@site = liquid_context.registers[:site]
|
55
38
|
collection = headers + obtain_docs(@collection_name)
|
56
39
|
<<~HEREDOC
|
57
40
|
<div class="posts">
|
@@ -71,7 +54,7 @@ module Outline
|
|
71
54
|
yaml.map { |entry| Header.new entry }
|
72
55
|
end
|
73
56
|
|
74
|
-
def make_entries(collection)
|
57
|
+
def make_entries(collection)
|
75
58
|
sorted = collection.sort_by(&obtain_order)
|
76
59
|
pruned = remove_empty_headers(sorted)
|
77
60
|
pruned.map do |entry|
|
@@ -95,7 +78,7 @@ module Outline
|
|
95
78
|
@site
|
96
79
|
.collections[collection_name]
|
97
80
|
.docs
|
98
|
-
.reject { |doc| doc.path.end_with?
|
81
|
+
.reject { |doc| doc.path.end_with? 'index.html' }
|
99
82
|
end
|
100
83
|
|
101
84
|
# Sort entries without an order property at the end
|
@@ -118,14 +101,11 @@ module Outline
|
|
118
101
|
i += 1
|
119
102
|
end
|
120
103
|
end
|
121
|
-
|
122
|
-
|
123
|
-
end
|
104
|
+
|
105
|
+
array.delete_at(array.length - 1) if header?(array.last)
|
124
106
|
array
|
125
107
|
end
|
108
|
+
|
109
|
+
JekyllPluginHelper.register(self, PLUGIN_NAME)
|
126
110
|
end
|
127
111
|
end
|
128
|
-
|
129
|
-
# PluginMetaLogger.instance.info { "Loaded #{JekyllPluginTagTemplate::PLUGIN_NAME} v#{JekyllPluginTemplateVersion::VERSION} plugin." }
|
130
|
-
PluginMetaLogger.instance.info { "Loaded Outline plugin." }
|
131
|
-
Liquid::Template.register_tag(Outline::PLUGIN_NAME, Outline::OutlineTag)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'jekyll'
|
2
|
+
require_relative '../lib/jekyll_outline'
|
3
|
+
|
4
|
+
RSpec.describe(Outline) do
|
5
|
+
include Jekyll
|
6
|
+
|
7
|
+
it 'is created properly' do
|
8
|
+
pending 'This is just a placeholder'
|
9
|
+
run_tag = RunTag.new('run', 'echo asdf')
|
10
|
+
output = run_tag.render(context)
|
11
|
+
expect(output).to eq('asdf')
|
12
|
+
end
|
13
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,13 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require "jekyll"
|
4
|
-
require_relative "../lib/jekyll_outline"
|
1
|
+
require 'jekyll'
|
2
|
+
require_relative '../lib/jekyll_outline'
|
5
3
|
|
6
4
|
RSpec.configure do |config|
|
7
5
|
config.filter_run :focus
|
8
|
-
config.order =
|
6
|
+
config.order = 'random'
|
9
7
|
config.run_all_when_everything_filtered = true
|
10
8
|
|
11
9
|
# See https://relishapp.com/rspec/rspec-core/docs/command-line/only-failures
|
12
|
-
config.example_status_persistence_file_path =
|
10
|
+
config.example_status_persistence_file_path = 'spec/status_persistence.txt'
|
13
11
|
end
|
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.0.
|
4
|
+
version: 1.0.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:
|
11
|
+
date: 2023-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -28,30 +28,30 @@ dependencies:
|
|
28
28
|
name: jekyll_draft
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.1.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.1.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: jekyll_plugin_support
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.5.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:
|
54
|
+
version: 0.5.0
|
55
55
|
description: 'Jekyll tag plugin that creates a clickable table of contents.
|
56
56
|
|
57
57
|
'
|
@@ -66,20 +66,19 @@ files:
|
|
66
66
|
- LICENSE.txt
|
67
67
|
- README.md
|
68
68
|
- Rakefile
|
69
|
-
-
|
69
|
+
- jekyll_outline.gemspec
|
70
70
|
- lib/jekyll_outline.rb
|
71
71
|
- lib/jekyll_outline/version.rb
|
72
|
-
- spec/
|
72
|
+
- spec/outline_spec.rb
|
73
73
|
- spec/spec_helper.rb
|
74
|
-
|
75
|
-
homepage: https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#run
|
74
|
+
homepage: https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#outline
|
76
75
|
licenses:
|
77
76
|
- MIT
|
78
77
|
metadata:
|
79
78
|
allowed_push_host: https://rubygems.org
|
80
79
|
bug_tracker_uri: https://github.com/mslinn/jekyll_outline/issues
|
81
80
|
changelog_uri: https://github.com/mslinn/jekyll_outline/CHANGELOG.md
|
82
|
-
homepage_uri: https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#
|
81
|
+
homepage_uri: https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#outline
|
83
82
|
source_code_uri: https://github.com/mslinn/jekyll_outline
|
84
83
|
post_install_message: |2+
|
85
84
|
|
@@ -104,7 +103,6 @@ signing_key:
|
|
104
103
|
specification_version: 4
|
105
104
|
summary: Jekyll tag plugin that creates a clickable table of contents.
|
106
105
|
test_files:
|
107
|
-
- spec/
|
106
|
+
- spec/outline_spec.rb
|
108
107
|
- spec/spec_helper.rb
|
109
|
-
- spec/status_persistence.txt
|
110
108
|
...
|
data/jekyll_run.gemspec
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "lib/jekyll_outline/version"
|
4
|
-
|
5
|
-
# rubocop:disable Metrics/BlockLength
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
github = "https://github.com/mslinn/jekyll_outline"
|
8
|
-
|
9
|
-
spec.authors = ["Mike Slinn"]
|
10
|
-
spec.bindir = "exe"
|
11
|
-
spec.description = <<~END_OF_DESC
|
12
|
-
Jekyll tag plugin that creates a clickable table of contents.
|
13
|
-
END_OF_DESC
|
14
|
-
spec.email = ["mslinn@mslinn.com"]
|
15
|
-
spec.files = Dir[".rubocop.yml", "LICENSE.*", "Rakefile", "{lib,spec}/**/*", "*.gemspec", "*.md"]
|
16
|
-
spec.homepage = "https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#run"
|
17
|
-
spec.license = "MIT"
|
18
|
-
spec.metadata = {
|
19
|
-
"allowed_push_host" => "https://rubygems.org",
|
20
|
-
"bug_tracker_uri" => "#{github}/issues",
|
21
|
-
"changelog_uri" => "#{github}/CHANGELOG.md",
|
22
|
-
"homepage_uri" => spec.homepage,
|
23
|
-
"source_code_uri" => github,
|
24
|
-
}
|
25
|
-
spec.name = "jekyll_outline"
|
26
|
-
spec.post_install_message = <<~END_MESSAGE
|
27
|
-
|
28
|
-
Thanks for installing #{spec.name}!
|
29
|
-
|
30
|
-
END_MESSAGE
|
31
|
-
spec.require_paths = ["lib"]
|
32
|
-
spec.required_ruby_version = ">= 2.6.0"
|
33
|
-
spec.summary = "Jekyll tag plugin that creates a clickable table of contents."
|
34
|
-
spec.test_files = spec.files.grep(%r!^(test|spec|features)/!)
|
35
|
-
spec.version = JekyllOutlineVersion::VERSION
|
36
|
-
|
37
|
-
spec.add_dependency "jekyll", ">= 3.5.0"
|
38
|
-
spec.add_dependency "jekyll_draft"
|
39
|
-
spec.add_dependency "jekyll_plugin_logger"
|
40
|
-
|
41
|
-
# spec.add_development_dependency "debase"
|
42
|
-
# spec.add_development_dependency "rubocop-jekyll"
|
43
|
-
# spec.add_development_dependency "rake"
|
44
|
-
# spec.add_development_dependency "rubocop-rake"
|
45
|
-
# spec.add_development_dependency "rubocop-rspec"
|
46
|
-
# spec.add_development_dependency "ruby-debug-ide"
|
47
|
-
end
|
48
|
-
# rubocop:enable Metrics/BlockLength
|
data/spec/jekyll_outline_spec.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "jekyll"
|
4
|
-
require_relative "../lib/jekyll_outline"
|
5
|
-
|
6
|
-
RSpec.describe(Jekyll) do
|
7
|
-
include Jekyll
|
8
|
-
|
9
|
-
it "is created properly" do
|
10
|
-
# run_tag = RunTag.new("run", "echo asdf")
|
11
|
-
# output = run_tag.render(context)
|
12
|
-
# expect(output).to eq("asdf")
|
13
|
-
end
|
14
|
-
end
|
data/spec/status_persistence.txt
DELETED