tocer 10.0.1 → 10.4.0

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: c6a2571ccc86ed9646c14d896625c153639bf3f8ada95a4aee559f4d7dae8389
4
- data.tar.gz: 9e1e703228058d69a9bd81fe925c9e75dc84b28f55f12043e95701aeadbe6bda
3
+ metadata.gz: f502b2c16f1de6f7fa1bfb7a14a121d4c6813a4377e4d8d39ff3148a1fb9c51d
4
+ data.tar.gz: a158d9b183195ddc25c8aabac843cd0c40736a72dc269c1091db1b982bb308f3
5
5
  SHA512:
6
- metadata.gz: d995315dd94e169ba3b3ff60c853db59f0be51d9d706c83ed50511b8c97521e1ceb1a61b44594956dd2ea2f9eed07519c08f24a66cd00af64371603bcfedd28e
7
- data.tar.gz: e99683066162a4cb44a765bece7dce4eb563aaeb30e0a5476a0e07aa703ca9a3093ed927a4c7be6ee118b31e2a4ad3f9c858ba5463705dc8f31296e729c70f4c
6
+ metadata.gz: f40354ec43eadb99aaad94d6155071c2ef15fc13598e23ba39ca082659aaffa9881ee731bde4878d2a4a027f9a056f1a1fbccdadc67b959b9c05710e0bf8d4d4
7
+ data.tar.gz: e59e9975bb17627a41fd8d2e6c7e1f99d0d1e5cb2d5a4172249afa09fe49d0771836aa70af88d9e81d8a82900a3876819d68a7e8cfaa3d9fedfc296deadcb31e
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,4 +1,4 @@
1
- # Apache License
1
+ = Apache License
2
2
 
3
3
  Version 2.0, January 2004
4
4
 
@@ -6,7 +6,7 @@ http://www.apache.org/licenses
6
6
 
7
7
  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
8
 
9
- ## 1. Definitions
9
+ == 1. Definitions
10
10
 
11
11
  "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by
12
12
  Sections 1 through 9 of this document.
@@ -54,14 +54,14 @@ Contribution."
54
54
  "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a
55
55
  Contribution has been received by Licensor and subsequently incorporated within the Work.
56
56
 
57
- ## 2. Grant of Copyright License
57
+ == 2. Grant of Copyright License
58
58
 
59
59
  Subject to the terms and conditions of this License, each Contributor hereby grants to You a
60
60
  perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to
61
61
  reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and
62
62
  distribute the Work and such Derivative Works in Source or Object form.
63
63
 
64
- ## 3. Grant of Patent License
64
+ == 3. Grant of Patent License
65
65
 
66
66
  Subject to the terms and conditions of this License, each Contributor hereby grants to You a
67
67
  perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
@@ -74,39 +74,38 @@ a Contribution incorporated within the Work constitutes direct or contributory p
74
74
  then any patent licenses granted to You under this License for that Work shall terminate as of the
75
75
  date such litigation is filed.
76
76
 
77
- ## 4. Redistribution
77
+ == 4. Redistribution
78
78
 
79
79
  You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with
80
80
  or without modifications, and in Source or Object form, provided that You meet the following
81
81
  conditions:
82
82
 
83
- 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
83
+ . You must give any other recipients of the Work or Derivative Works a copy of this License; and
84
84
 
85
- 2. You must cause any modified files to carry prominent notices stating that You changed the
86
- files; and
85
+ . You must cause any modified files to carry prominent notices stating that You changed the files;
86
+ and
87
87
 
88
- 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright,
89
- patent, trademark, and attribution notices from the Source form of the Work, excluding those
90
- notices that do not pertain to any part of the Derivative Works; and
88
+ . You must retain, in the Source form of any Derivative Works that You distribute, all copyright,
89
+ patent, trademark, and attribution notices from the Source form of the Work, excluding those
90
+ notices that do not pertain to any part of the Derivative Works; and
91
91
 
92
- 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative
93
- Works that You distribute must include a readable copy of the attribution notices contained
94
- within such NOTICE file, excluding those notices that do not pertain to any part of the
95
- Derivative Works, in at least one of the following places: within a NOTICE text file
96
- distributed as part of the Derivative Works; within the Source form or documentation, if
97
- provided along with the Derivative Works; or, within a display generated by the Derivative
98
- Works, if and wherever such third-party notices normally appear. The contents of the NOTICE
99
- file are for informational purposes only and do not modify the License. You may add Your own
100
- attribution notices within Derivative Works that You distribute, alongside or as an addendum to
101
- the NOTICE text from the Work, provided that such additional attribution notices cannot be
102
- construed as modifying the License.
92
+ . If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works
93
+ that You distribute must include a readable copy of the attribution notices contained within such
94
+ NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in
95
+ at least one of the following places: within a NOTICE text file distributed as part of the
96
+ Derivative Works; within the Source form or documentation, if provided along with the Derivative
97
+ Works; or, within a display generated by the Derivative Works, if and wherever such third-party
98
+ notices normally appear. The contents of the NOTICE file are for informational purposes only and
99
+ do not modify the License. You may add Your own attribution notices within Derivative Works that
100
+ You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such
101
+ additional attribution notices cannot be construed as modifying the License.
103
102
 
104
103
  You may add Your own copyright statement to Your modifications and may provide additional or
105
104
  different license terms and conditions for use, reproduction, or distribution of Your modifications,
106
105
  or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of
107
106
  the Work otherwise complies with the conditions stated in this License.
108
107
 
109
- ## 5. Submission of Contributions
108
+ == 5. Submission of Contributions
110
109
 
111
110
  Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the
112
111
  Work by You to the Licensor shall be under the terms and conditions of this License, without any
@@ -114,13 +113,13 @@ additional terms or conditions. Notwithstanding the above, nothing herein shall
114
113
  the terms of any separate license agreement you may have executed with Licensor regarding such
115
114
  Contributions.
116
115
 
117
- ## 6. Trademarks
116
+ == 6. Trademarks
118
117
 
119
118
  This License does not grant permission to use the trade names, trademarks, service marks, or product
120
119
  names of the Licensor, except as required for reasonable and customary use in describing the origin
121
120
  of the Work and reproducing the content of the NOTICE file.
122
121
 
123
- ## 7. Disclaimer of Warranty
122
+ == 7. Disclaimer of Warranty
124
123
 
125
124
  Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each
126
125
  Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -129,7 +128,7 @@ TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. Y
129
128
  responsible for determining the appropriateness of using or redistributing the Work and assume any
130
129
  risks associated with Your exercise of permissions under this License.
131
130
 
132
- ## 8. Limitation of Liability
131
+ == 8. Limitation of Liability
133
132
 
134
133
  In no event and under no legal theory, whether in tort (including negligence), contract, or
135
134
  otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or
@@ -139,7 +138,7 @@ License or out of the use or inability to use the Work (including but not limite
139
138
  loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial
140
139
  damages or losses), even if such Contributor has been advised of the possibility of such damages.
141
140
 
142
- ## 9. Accepting Warranty or Additional Liability
141
+ == 9. Accepting Warranty or Additional Liability
143
142
 
144
143
  While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee
145
144
  for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights
@@ -151,11 +150,11 @@ additional liability.
151
150
 
152
151
  END OF TERMS AND CONDITIONS
153
152
 
154
- Copyright 2015 [Alchemists](https://www.alchemists.io).
153
+ Copyright 2015 link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
155
154
 
156
155
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
157
- compliance with the License. You may obtain a [copy](http://www.apache.org/licenses/LICENSE-2.0) of
158
- the License.
156
+ compliance with the License. You may obtain a link:https://www.apache.org/licenses/LICENSE-2.0[copy]
157
+ of the License.
159
158
 
160
159
  Unless required by applicable law or agreed to in writing, software distributed under the License is
161
160
  distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
@@ -0,0 +1,211 @@
1
+ :toc: macro
2
+ :toclevels: 5
3
+ :figure-caption!:
4
+
5
+ = Tocer
6
+
7
+ [link=http://badge.fury.io/rb/tocer]
8
+ image::https://badge.fury.io/rb/tocer.svg[Gem Version]
9
+ [link=https://www.alchemists.io/projects/code_quality]
10
+ image::https://img.shields.io/badge/code_style-alchemists-brightgreen.svg[Alchemists Style Guide]
11
+ [link=https://circleci.com/gh/bkuhlmann/tocer]
12
+ image::https://circleci.com/gh/bkuhlmann/tocer.svg?style=svg[Circle CI Status]
13
+
14
+ Tocer (a.k.a. Table of Contenter) is a command line interface for generating table of contents for
15
+ Markdown files.
16
+
17
+ toc::[]
18
+
19
+ == Features
20
+
21
+ * Supports Markdown ATX-style headers. Example: `# Header`.
22
+ ** Does not support header suffixes. Example: `# Header #`.
23
+ ** Does not support header prefixes without spaces. Example: `#Header`.
24
+ * Supports table of contents generation for single or multiple files.
25
+ * Supports custom label. Default: `## Table of Contents`.
26
+ * Supports file list filtering. Default: `"README.md"`.
27
+ * Prepends table of contents to Markdown documents that don’t have table of contents.
28
+ * Rebuilds Markdown documents that have existing table of contents.
29
+
30
+ == Requirements
31
+
32
+ . A UNIX-based system.
33
+ . link:https://www.ruby-lang.org[Ruby].
34
+
35
+ == Setup
36
+
37
+ To install, run:
38
+
39
+ [source,bash]
40
+ ----
41
+ gem install tocer
42
+ ----
43
+
44
+ == Usage
45
+
46
+ === Command Line Interface (CLI)
47
+
48
+ From the command line, type: `+tocer --help+`
49
+
50
+ ....
51
+ tocer -c, [--config] # Manage gem configuration.
52
+ tocer -g, [--generate=PATH] # Generate table of contents.
53
+ tocer -h, [--help=COMMAND] # Show this message or get help for a command.
54
+ tocer -v, [--version] # Show gem version.
55
+ ....
56
+
57
+ For specific `+--generate+` options, run `+tocer --help --generate+` to see the following:
58
+
59
+ ....
60
+ -l, [--label=LABEL] # Label
61
+ # Default: ## Table of Contents
62
+ -i, [--includes=one two three] # File include list
63
+ # Default: ["README.md"]
64
+ ....
65
+
66
+ To generate the table of contents at a specific position within your Markdown files, add the
67
+ following lines to your file(s) prior to generation:
68
+
69
+ [source,markdown]
70
+ ----
71
+ <!-- Tocer[start] -->
72
+ <!-- Tocer[finish] -->
73
+ ----
74
+
75
+ Alternatively, you can run `+tocer -g <directory>+` on files that do not have Tocer support and it
76
+ will prepend the table of contents to your file(s), complete with an auto-generated table of
77
+ contents.
78
+
79
+ In the case that Tocer has already auto-generated a table of contents for a Markdown file, the
80
+ existing table of contents has become stale, or placement of the table of contents has changed you
81
+ can re-run Tocer on that file to auto-update it with new table of contents.
82
+
83
+ === Customization
84
+
85
+ This gem can be configured via a global configuration: `~/.config/tocer/configuration.yml`.
86
+
87
+ It can also be configured via link:https://www.alchemists.io/projects/xdg[XDG] environment
88
+ variables.
89
+
90
+ The default configuration is as follows:
91
+
92
+ [source,yaml]
93
+ ----
94
+ :label: "## Table of Contents"
95
+ :includes:
96
+ - "README.md"
97
+ ----
98
+
99
+ Feel free to take this default configuration, modify, and save as your own custom
100
+ `configuration.yml`.
101
+
102
+ The `configuration.yml` file can be configured as follows:
103
+
104
+ * `label`: The header label for the table of contents. Default: `"# Table of Contents"`.
105
+ * `includes`: The list of included files. Default: `"*.md"`.
106
+
107
+ There are multiple ways the include list can be defined. Here are some examples:
108
+
109
+ [source,yaml]
110
+ ----
111
+ # Use an empty array to ignore all files (a key with no value would work too).
112
+ :includes: []
113
+
114
+ # Use an array of wildcards for groups of files with similar extensions:
115
+ :includes:
116
+ - "*.md"
117
+ - "*.mkd"
118
+ - "*.markdown"
119
+
120
+ # Use a mix of wild cards and relative names/paths to customized as necessary:
121
+ :includes:
122
+ - "README.md"
123
+ - "docs/*.md"
124
+ - "*.markdown"
125
+
126
+ # Use a recursive glob to traverse and update all sub-directories:
127
+ :includes:
128
+ - "**/*.md"
129
+ ----
130
+
131
+ === Rake
132
+
133
+ You can add Rake support by adding the following to your `Rakefile`:
134
+
135
+ [source,ruby]
136
+ ----
137
+ begin
138
+ require "tocer/rake/setup"
139
+ rescue LoadError => error
140
+ puts error.message
141
+ end
142
+ ----
143
+
144
+ Once configured, the following tasks will be available (i.e. `bundle exec rake -T`):
145
+
146
+ ....
147
+ rake toc[label,includes] # Add/Update Table of Contents (README)
148
+ ....
149
+
150
+ …which can be called as follows (quotes are not necessary if spaces are not used):
151
+
152
+ [source,bash]
153
+ ----
154
+ rake toc["## Example, *.md"]
155
+ ----
156
+
157
+ == Development
158
+
159
+ To contribute, run:
160
+
161
+ [source,bash]
162
+ ----
163
+ git clone https://github.com/bkuhlmann/tocer.git
164
+ cd tocer
165
+ bin/setup
166
+ ----
167
+
168
+ You can also use the IRB console for direct access to all objects:
169
+
170
+ [source,bash]
171
+ ----
172
+ bin/console
173
+ ----
174
+
175
+ == Tests
176
+
177
+ To test, run:
178
+
179
+ [source,bash]
180
+ ----
181
+ bundle exec rake
182
+ ----
183
+
184
+ == Versioning
185
+
186
+ Read link:https://semver.org[Semantic Versioning] for details. Briefly, it means:
187
+
188
+ * Major (X.y.z) - Incremented for any backwards incompatible public API changes.
189
+ * Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
190
+ * Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
191
+
192
+ == Code of Conduct
193
+
194
+ Please note that this project is released with a link:CODE_OF_CONDUCT.adoc[CODE OF CONDUCT]. By
195
+ participating in this project you agree to abide by its terms.
196
+
197
+ == Contributions
198
+
199
+ Read link:CONTRIBUTING.adoc[CONTRIBUTING] for details.
200
+
201
+ == License
202
+
203
+ Read link:LICENSE.adoc[LICENSE] for details.
204
+
205
+ == History
206
+
207
+ Read link:CHANGES.adoc[CHANGES] for details.
208
+
209
+ == Credits
210
+
211
+ Engineered by link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
data/bin/tocer CHANGED
@@ -5,5 +5,5 @@ require "tocer"
5
5
  require "tocer/cli"
6
6
  require "tocer/identity"
7
7
 
8
- Process.setproctitle Tocer::Identity.version_label
8
+ Process.setproctitle Tocer::Identity::VERSION_LABEL
9
9
  Tocer::CLI.start
@@ -52,7 +52,7 @@ module Tocer
52
52
  end
53
53
 
54
54
  def transform markdown
55
- Transformers::Finder.call(markdown).then do |transformer|
55
+ Transformers::Finder.new.call(markdown).then do |transformer|
56
56
  url = transformer.url
57
57
  link = transformer.call url_suffix: url_suffix(url)
58
58
  url_count[url] += 1
@@ -9,7 +9,7 @@ module Tocer
9
9
  class CLI < Thor
10
10
  include Thor::Actions
11
11
 
12
- package_name Identity.version_label
12
+ package_name Identity::VERSION_LABEL
13
13
 
14
14
  def initialize args = [], options = {}, config = {}
15
15
  super args, options, config
@@ -69,7 +69,7 @@ module Tocer
69
69
  desc "-v, [--version]", "Show gem version."
70
70
  map %w[-v --version] => :version
71
71
  def version
72
- say Identity.version_label
72
+ say Identity::VERSION_LABEL
73
73
  end
74
74
 
75
75
  desc "-h, [--help=COMMAND]", "Show this message or get help for a command."
@@ -5,7 +5,7 @@ require "runcom"
5
5
  module Tocer
6
6
  module Configuration
7
7
  def self.default
8
- Runcom::Config.new "#{Identity.name}/configuration.yml",
8
+ Runcom::Config.new "#{Identity::NAME}/configuration.yml",
9
9
  defaults: {
10
10
  label: "## Table of Contents",
11
11
  includes: ["README.md"]
@@ -5,7 +5,7 @@ module Tocer
5
5
  # Represents a table of contents start and finish comment block.
6
6
  class CommentBlock
7
7
  def self.index lines, id
8
- (lines.index { |line| line =~ /\<\!\-\-.*#{Regexp.escape id}.*\-\-\>/ }).to_i
8
+ (lines.index { |line| line =~ /<!--.*#{Regexp.escape id}.*-->/ }).to_i
9
9
  end
10
10
 
11
11
  def initialize start_id: "Tocer[start]",
@@ -3,20 +3,9 @@
3
3
  module Tocer
4
4
  # Gem identity information.
5
5
  module Identity
6
- def self.name
7
- "tocer"
8
- end
9
-
10
- def self.label
11
- "Tocer"
12
- end
13
-
14
- def self.version
15
- "10.0.1"
16
- end
17
-
18
- def self.version_label
19
- "#{label} #{version}"
20
- end
6
+ NAME = "tocer"
7
+ LABEL = "Tocer"
8
+ VERSION = "10.4.0"
9
+ VERSION_LABEL = "#{LABEL} #{VERSION}"
21
10
  end
22
11
  end
@@ -9,10 +9,18 @@ module Tocer
9
9
  /.*/ => Transformers::Text
10
10
  }.freeze
11
11
 
12
- def self.call markdown
13
- TRANSFORMERS.find { |pattern, transformer| break transformer if pattern.match? markdown }
12
+ def initialize transformers: TRANSFORMERS
13
+ @transformers = transformers
14
+ end
15
+
16
+ def call markdown
17
+ transformers.find { |pattern, transformer| break transformer if pattern.match? markdown }
14
18
  .then { |transformer| transformer.new markdown }
15
19
  end
20
+
21
+ private
22
+
23
+ attr_reader :transformers
16
24
  end
17
25
  end
18
26
  end
metadata CHANGED
@@ -1,18 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tocer
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.0.1
4
+ version: 10.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIC/jCCAeagAwIBAgIBAjANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
14
- a2UvREM9YWxjaGVtaXN0cy9EQz1pbzAeFw0xOTAyMTcxNjAxMTFaFw0yMDAyMTcx
15
- NjAxMTFaMCUxIzAhBgNVBAMMGmJyb29rZS9EQz1hbGNoZW1pc3RzL0RDPWlvMIIB
13
+ MIIC/jCCAeagAwIBAgIBAzANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
14
+ a2UvREM9YWxjaGVtaXN0cy9EQz1pbzAeFw0yMDAzMTUxNDQ1MzJaFw0yMTAzMTUx
15
+ NDQ1MzJaMCUxIzAhBgNVBAMMGmJyb29rZS9EQz1hbGNoZW1pc3RzL0RDPWlvMIIB
16
16
  IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6l1qpXTiomH1RfMRloyw7MiE
17
17
  xyVx/x8Yc3EupdH7uhNaTXQGyORN6aOY//1QXXMHIZ9tW74nZLhesWMSUMYy0XhB
18
18
  brs+KkurHnc9FnEJAbG7ebGvl/ncqZt72nQvaxpDxvuCBHgJAz+8i5wl6FhLw+oT
@@ -20,15 +20,15 @@ cert_chain:
20
20
  D5vkU0YlAm1r98BymuJlcQ1qdkVEI1d48ph4kcS0S0nv1RiuyVb6TCAR3Nu3VaVq
21
21
  3fPzZKJLZBx67UvXdbdicWPiUR75elI4PXpLIic3xytaF52ZJYyKZCNZJhNwfQID
22
22
  AQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU0nzow9vc
23
- 2CdikiiE3fJhP/gY4ggwDQYJKoZIhvcNAQELBQADggEBANgfX7kPZkJvsbdWMvbe
24
- DUUYxRTqTUzCDpLd2p3sQvgLMKjTNSKt6CFq/kh+98b6RCgO6DqiVfxvOEq02dvf
25
- ebMN/ylQqan2FgiAs1rpP0/D4C0MlBjoDktsT+2IyLol1KmkDB20ExJ4Sf1GRNdA
26
- hpWOtcgqHtmrc7xzgB6BuyoYufrKKUlCO3ewTM4C375D2qO7hIdKuMOO3CdPMtSk
27
- OrWpbzCL+nbbXqeoqiHgZaUvcyyQrGj5sQRxMTzuMXzzQxtHnuTuKrcz16HMTX/O
28
- dKvURM+1PwDCzC5tvRwjhUJIizau6+MtkFCvJHmaAj1aZL3odcPejHj5Hxt/0CUW
29
- y84=
23
+ 2CdikiiE3fJhP/gY4ggwDQYJKoZIhvcNAQELBQADggEBAIHhAlD3po4sTYqacXaQ
24
+ XI9jIhrfMy//2PgbHWcETtlJPBeNUbbSNBABcllUHKqYsVDlSvSmss034KSWNR8F
25
+ bF1GcloicyvcCC4y6IoW4it0COAcdeaaxkxiBSgKdQFpff9REnDlIKK4uQ9lLxIo
26
+ Y2G5xubiziKZkyfWFuSr67PIjW3Bu673D1JVBArhA1qbgQmYQcy1CkGOjo+iO8Nf
27
+ 7u/QSfBHb+r/bXhKscDgPpnKwbUmvgO2+94zJG9KsrmIydlzYfsD09aXKx0t6Xy4
28
+ 2XV8FRa7/JimI07sPLC13eLY3xd/aYTi85Z782KIA4j0G8XEEWAX0ouBhlXPocZv
29
+ QWc=
30
30
  -----END CERTIFICATE-----
31
- date: 2020-01-02 00:00:00.000000000 Z
31
+ date: 2020-11-14 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: refinements
@@ -36,28 +36,28 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '7.0'
39
+ version: '7.14'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '7.0'
46
+ version: '7.14'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: runcom
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '6.0'
53
+ version: '6.4'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '6.0'
60
+ version: '6.4'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: thor
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -78,56 +78,42 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '0.6'
81
+ version: '0.7'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '0.6'
88
+ version: '0.7'
89
89
  - !ruby/object:Gem::Dependency
90
- name: climate_control
90
+ name: bundler-leak
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '0.1'
95
+ version: '0.2'
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '0.1'
102
+ version: '0.2'
103
103
  - !ruby/object:Gem::Dependency
104
- name: gemsmith
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - "~>"
108
- - !ruby/object:Gem::Version
109
- version: '14.0'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - "~>"
115
- - !ruby/object:Gem::Version
116
- version: '14.0'
117
- - !ruby/object:Gem::Dependency
118
- name: git-cop
104
+ name: climate_control
119
105
  requirement: !ruby/object:Gem::Requirement
120
106
  requirements:
121
107
  - - "~>"
122
108
  - !ruby/object:Gem::Version
123
- version: '4.0'
109
+ version: '0.1'
124
110
  type: :development
125
111
  prerelease: false
126
112
  version_requirements: !ruby/object:Gem::Requirement
127
113
  requirements:
128
114
  - - "~>"
129
115
  - !ruby/object:Gem::Version
130
- version: '4.0'
116
+ version: '0.1'
131
117
  - !ruby/object:Gem::Dependency
132
118
  name: guard-rspec
133
119
  requirement: !ruby/object:Gem::Requirement
@@ -148,28 +134,28 @@ dependencies:
148
134
  requirements:
149
135
  - - "~>"
150
136
  - !ruby/object:Gem::Version
151
- version: '0.12'
137
+ version: '0.13'
152
138
  type: :development
153
139
  prerelease: false
154
140
  version_requirements: !ruby/object:Gem::Requirement
155
141
  requirements:
156
142
  - - "~>"
157
143
  - !ruby/object:Gem::Version
158
- version: '0.12'
144
+ version: '0.13'
159
145
  - !ruby/object:Gem::Dependency
160
146
  name: pry-byebug
161
147
  requirement: !ruby/object:Gem::Requirement
162
148
  requirements:
163
149
  - - "~>"
164
150
  - !ruby/object:Gem::Version
165
- version: '3.7'
151
+ version: '3.9'
166
152
  type: :development
167
153
  prerelease: false
168
154
  version_requirements: !ruby/object:Gem::Requirement
169
155
  requirements:
170
156
  - - "~>"
171
157
  - !ruby/object:Gem::Version
172
- version: '3.7'
158
+ version: '3.9'
173
159
  - !ruby/object:Gem::Dependency
174
160
  name: rake
175
161
  requirement: !ruby/object:Gem::Requirement
@@ -190,56 +176,56 @@ dependencies:
190
176
  requirements:
191
177
  - - "~>"
192
178
  - !ruby/object:Gem::Version
193
- version: '5.4'
179
+ version: '6.0'
194
180
  type: :development
195
181
  prerelease: false
196
182
  version_requirements: !ruby/object:Gem::Requirement
197
183
  requirements:
198
184
  - - "~>"
199
185
  - !ruby/object:Gem::Version
200
- version: '5.4'
186
+ version: '6.0'
201
187
  - !ruby/object:Gem::Dependency
202
188
  name: rspec
203
189
  requirement: !ruby/object:Gem::Requirement
204
190
  requirements:
205
191
  - - "~>"
206
192
  - !ruby/object:Gem::Version
207
- version: '3.9'
193
+ version: '3.10'
208
194
  type: :development
209
195
  prerelease: false
210
196
  version_requirements: !ruby/object:Gem::Requirement
211
197
  requirements:
212
198
  - - "~>"
213
199
  - !ruby/object:Gem::Version
214
- version: '3.9'
200
+ version: '3.10'
215
201
  - !ruby/object:Gem::Dependency
216
202
  name: rubocop
217
203
  requirement: !ruby/object:Gem::Requirement
218
204
  requirements:
219
205
  - - "~>"
220
206
  - !ruby/object:Gem::Version
221
- version: '0.78'
207
+ version: '1.3'
222
208
  type: :development
223
209
  prerelease: false
224
210
  version_requirements: !ruby/object:Gem::Requirement
225
211
  requirements:
226
212
  - - "~>"
227
213
  - !ruby/object:Gem::Version
228
- version: '0.78'
214
+ version: '1.3'
229
215
  - !ruby/object:Gem::Dependency
230
216
  name: rubocop-performance
231
217
  requirement: !ruby/object:Gem::Requirement
232
218
  requirements:
233
219
  - - "~>"
234
220
  - !ruby/object:Gem::Version
235
- version: '1.5'
221
+ version: '1.8'
236
222
  type: :development
237
223
  prerelease: false
238
224
  version_requirements: !ruby/object:Gem::Requirement
239
225
  requirements:
240
226
  - - "~>"
241
227
  - !ruby/object:Gem::Version
242
- version: '1.5'
228
+ version: '1.8'
243
229
  - !ruby/object:Gem::Dependency
244
230
  name: rubocop-rake
245
231
  requirement: !ruby/object:Gem::Requirement
@@ -260,40 +246,40 @@ dependencies:
260
246
  requirements:
261
247
  - - "~>"
262
248
  - !ruby/object:Gem::Version
263
- version: '1.37'
249
+ version: '2.0'
264
250
  type: :development
265
251
  prerelease: false
266
252
  version_requirements: !ruby/object:Gem::Requirement
267
253
  requirements:
268
254
  - - "~>"
269
255
  - !ruby/object:Gem::Version
270
- version: '1.37'
256
+ version: '2.0'
271
257
  - !ruby/object:Gem::Dependency
272
258
  name: simplecov
273
259
  requirement: !ruby/object:Gem::Requirement
274
260
  requirements:
275
261
  - - "~>"
276
262
  - !ruby/object:Gem::Version
277
- version: '0.17'
263
+ version: '0.19'
278
264
  type: :development
279
265
  prerelease: false
280
266
  version_requirements: !ruby/object:Gem::Requirement
281
267
  requirements:
282
268
  - - "~>"
283
269
  - !ruby/object:Gem::Version
284
- version: '0.17'
285
- description:
270
+ version: '0.19'
271
+ description:
286
272
  email:
287
273
  - brooke@alchemists.io
288
274
  executables:
289
275
  - tocer
290
276
  extensions: []
291
277
  extra_rdoc_files:
292
- - README.md
293
- - LICENSE.md
278
+ - README.adoc
279
+ - LICENSE.adoc
294
280
  files:
295
- - LICENSE.md
296
- - README.md
281
+ - LICENSE.adoc
282
+ - README.adoc
297
283
  - bin/tocer
298
284
  - lib/tocer.rb
299
285
  - lib/tocer/builder.rb
@@ -309,14 +295,15 @@ files:
309
295
  - lib/tocer/transformers/link.rb
310
296
  - lib/tocer/transformers/text.rb
311
297
  - lib/tocer/writer.rb
312
- homepage: https://github.com/bkuhlmann/tocer
298
+ homepage: https://www.alchemists.io/projects/tocer
313
299
  licenses:
314
300
  - Apache-2.0
315
301
  metadata:
316
- source_code_uri: https://github.com/bkuhlmann/tocer
317
- changelog_uri: https://github.com/bkuhlmann/tocer/blob/master/CHANGES.md
318
302
  bug_tracker_uri: https://github.com/bkuhlmann/tocer/issues
319
- post_install_message:
303
+ changelog_uri: https://www.alchemists.io/projects/tocer/changes.html
304
+ documentation_uri: https://www.alchemists.io/projects/tocer
305
+ source_code_uri: https://github.com/bkuhlmann/tocer
306
+ post_install_message:
320
307
  rdoc_options: []
321
308
  require_paths:
322
309
  - lib
@@ -331,8 +318,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
331
318
  - !ruby/object:Gem::Version
332
319
  version: '0'
333
320
  requirements: []
334
- rubygems_version: 3.1.2
335
- signing_key:
321
+ rubygems_version: 3.1.4
322
+ signing_key:
336
323
  specification_version: 4
337
324
  summary: A command line interface for generating table of contents for Markdown files.
338
325
  test_files: []
metadata.gz.sig CHANGED
Binary file
data/README.md DELETED
@@ -1,189 +0,0 @@
1
- <p align="center">
2
- <img src="tocer.png" alt="Tocer Icon"/>
3
- </p>
4
-
5
- # Tocer
6
-
7
- [![Gem Version](https://badge.fury.io/rb/tocer.svg)](http://badge.fury.io/rb/tocer)
8
- [![Code Climate Maintainability](https://api.codeclimate.com/v1/badges/5d4db0f578703d8124a4/maintainability)](https://codeclimate.com/github/bkuhlmann/tocer/maintainability)
9
- [![Code Climate Test Coverage](https://api.codeclimate.com/v1/badges/5d4db0f578703d8124a4/test_coverage)](https://codeclimate.com/github/bkuhlmann/tocer/test_coverage)
10
- [![Circle CI Status](https://circleci.com/gh/bkuhlmann/tocer.svg?style=svg)](https://circleci.com/gh/bkuhlmann/tocer)
11
-
12
- Tocer (a.k.a. Table of Contenter) is a command line interface for generating table of contents for
13
- Markdown files.
14
-
15
- <!-- Tocer[start]: Auto-generated, don't remove. -->
16
-
17
- ## Table of Contents
18
-
19
- - [Features](#features)
20
- - [Requirements](#requirements)
21
- - [Setup](#setup)
22
- - [Usage](#usage)
23
- - [Command Line Interface (CLI)](#command-line-interface-cli)
24
- - [Customization](#customization)
25
- - [Rake](#rake)
26
- - [Tests](#tests)
27
- - [Versioning](#versioning)
28
- - [Code of Conduct](#code-of-conduct)
29
- - [Contributions](#contributions)
30
- - [License](#license)
31
- - [History](#history)
32
- - [Credits](#credits)
33
-
34
- <!-- Tocer[finish]: Auto-generated, don't remove. -->
35
-
36
- ## Features
37
-
38
- - Supports Markdown ATX-style headers. Example: `# Header`.
39
- - Does not support header suffixes. Example: `# Header #`.
40
- - Does not support header prefixes without spaces. Example: `#Header`.
41
- - Supports table of contents generation for single or multiple files.
42
- - Supports custom label. Default: "## Table of Contents".
43
- - Supports file list filtering. Default: "README.md".
44
- - Prepends table of contents to Markdown documents that don't have table of contents.
45
- - Rebuilds Markdown documents that have existing table of contents.
46
-
47
- ## Requirements
48
-
49
- 1. A UNIX-based system.
50
- 1. [Ruby 2.7.x](https://www.ruby-lang.org).
51
-
52
- ## Setup
53
-
54
- Type the following to install:
55
-
56
- gem install tocer
57
-
58
- ## Usage
59
-
60
- ### Command Line Interface (CLI)
61
-
62
- From the command line, type: `tocer --help`
63
-
64
- tocer -c, [--config] # Manage gem configuration.
65
- tocer -g, [--generate=PATH] # Generate table of contents.
66
- tocer -h, [--help=COMMAND] # Show this message or get help for a command.
67
- tocer -v, [--version] # Show gem version.
68
-
69
- For specific `--generate` options, run `tocer --help --generate` to see the following:
70
-
71
- -l, [--label=LABEL] # Label
72
- # Default: ## Table of Contents
73
- -i, [--includes=one two three] # File include list
74
- # Default: ["README.md"]
75
-
76
- To generate the table of contents at a specific position within your Markdown files, add the
77
- following lines to your file(s) prior to generation:
78
-
79
- ```
80
- <!-- Tocer[start] -->
81
- <!-- Tocer[finish] -->
82
- ```
83
-
84
- Alternatively, you can run `tocer -g <directory>` on files that do not have Tocer support and it
85
- will prepend the table of contents to your file(s), complete with an auto-generated table of
86
- contents.
87
-
88
- In the case that Tocer has already auto-generated a table of contents for a Markdown file, the
89
- existing table of contents has become stale, or placement of the table of contents has changed you
90
- can re-run Tocer on that file to auto-update it with new table of contents.
91
-
92
- ### Customization
93
-
94
- This gem can be configured via a global configuration:
95
-
96
- ~/.config/tocer/configuration.yml
97
-
98
- It can also be configured via [XDG](https://github.com/bkuhlmann/xdg) environment variables.
99
-
100
- The default configuration is as follows:
101
-
102
- :label: "## Table of Contents"
103
- :includes:
104
- - "README.md"
105
-
106
- Feel free to take this default configuration, modify, and save as your own custom
107
- `configuration.yml`.
108
-
109
- The `configuration.yml` file can be configured as follows:
110
-
111
- - `label`: The header label for the table of contents. Default: "# Table of Contents".
112
- - `includes`: The list of included files. Default: "\*.md".
113
-
114
- There are multiple ways the include list can be defined. Here are some examples:
115
-
116
- # Use an empty array to ignore all files (a key with no value would work too).
117
- :includes: []
118
-
119
- # Use an array of wildcards for groups of files with similar extensions:
120
- :includes:
121
- - "*.md"
122
- - "*.mkd"
123
- - "*.markdown"
124
-
125
- # Use a mix of wild cards and relative names/paths to customized as necessary:
126
- :includes:
127
- - "README.md"
128
- - "docs/*.md"
129
- - "*.markdown"
130
-
131
- # Use a recursive glob to traverse and update all sub-directories:
132
- :includes:
133
- - "**/*.md"
134
-
135
- ### Rake
136
-
137
- You can add Rake support by adding the following to your `Rakefile`:
138
-
139
- begin
140
- require "tocer/rake/setup"
141
- rescue LoadError => error
142
- puts error.message
143
- end
144
-
145
- Once configured, the following tasks will be available (i.e. `bundle exec rake -T`):
146
-
147
- rake toc[label,includes] # Add/Update Table of Contents (README)
148
-
149
- ...which can be called as follows (quotes are not necessary if spaces are not used):
150
-
151
- rake toc["## Example, *.md"]
152
-
153
- ## Tests
154
-
155
- To test, run:
156
-
157
- bundle exec rake
158
-
159
- ## Versioning
160
-
161
- Read [Semantic Versioning](https://semver.org) for details. Briefly, it means:
162
-
163
- - Major (X.y.z) - Incremented for any backwards incompatible public API changes.
164
- - Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
165
- - Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
166
-
167
- ## Code of Conduct
168
-
169
- Please note that this project is released with a [CODE OF CONDUCT](CODE_OF_CONDUCT.md). By
170
- participating in this project you agree to abide by its terms.
171
-
172
- ## Contributions
173
-
174
- Read [CONTRIBUTING](CONTRIBUTING.md) for details.
175
-
176
- ## License
177
-
178
- Copyright 2015 [Alchemists](https://www.alchemists.io).
179
- Read [LICENSE](LICENSE.md) for details.
180
-
181
- ## History
182
-
183
- Read [CHANGES](CHANGES.md) for details.
184
- Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
185
-
186
- ## Credits
187
-
188
- Developed by [Brooke Kuhlmann](https://www.alchemists.io) at
189
- [Alchemists](https://www.alchemists.io).