tocer 10.0.0 → 10.3.0
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
- checksums.yaml.gz.sig +1 -2
- data.tar.gz.sig +0 -0
- data/{LICENSE.md → LICENSE.adoc} +29 -30
- data/README.adoc +209 -0
- data/bin/tocer +1 -1
- data/lib/tocer/cli.rb +2 -2
- data/lib/tocer/configuration.rb +1 -1
- data/lib/tocer/elements/comment_block.rb +1 -1
- data/lib/tocer/identity.rb +4 -15
- metadata +67 -38
- metadata.gz.sig +0 -0
- data/README.md +0 -189
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 702ac25e3c36e2654a136716b15816e1d39a3c4f1944517ed4ed7afb504e30f1
|
|
4
|
+
data.tar.gz: d2936b0b62ff42c55c1ea5cace729cfd0a0ad5b99418f8728aced4bb8363089e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca420835d280ba64806ba8de40654cd4f2477af41f4379ed6810390deced91e95ef8c9e9b7b88a0e0dc59d196365d7997317217379e9da655dd49e886068e441
|
|
7
|
+
data.tar.gz: cd764af24b2c91e92dc0f8862160bc45210efbc66243c7b71504bf14b468eb5f9368aa6b6cd5aac6c2ce0a75e06d9461c1e75aa5e4eec2addacef9a7ef0d28d9
|
checksums.yaml.gz.sig
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
`�+�)���~��<5X��}�M������ΌZ������P�!~p�lC?���qǝeĽxW�Z��� ���MK
|
|
1
|
+
e]W�$
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/{LICENSE.md → LICENSE.adoc}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
83
|
+
. You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
. You must cause any modified files to carry prominent notices stating that You changed the files;
|
|
86
|
+
and
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
data/README.adoc
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
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://circleci.com/gh/bkuhlmann/tocer]
|
|
10
|
+
image::https://circleci.com/gh/bkuhlmann/tocer.svg?style=svg[Circle CI Status]
|
|
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
|
+
toc::[]
|
|
16
|
+
|
|
17
|
+
== Features
|
|
18
|
+
|
|
19
|
+
* Supports Markdown ATX-style headers. Example: `# Header`.
|
|
20
|
+
** Does not support header suffixes. Example: `# Header #`.
|
|
21
|
+
** Does not support header prefixes without spaces. Example: `#Header`.
|
|
22
|
+
* Supports table of contents generation for single or multiple files.
|
|
23
|
+
* Supports custom label. Default: `## Table of Contents`.
|
|
24
|
+
* Supports file list filtering. Default: `"README.md"`.
|
|
25
|
+
* Prepends table of contents to Markdown documents that don’t have table of contents.
|
|
26
|
+
* Rebuilds Markdown documents that have existing table of contents.
|
|
27
|
+
|
|
28
|
+
== Requirements
|
|
29
|
+
|
|
30
|
+
. A UNIX-based system.
|
|
31
|
+
. link:https://www.ruby-lang.org[Ruby].
|
|
32
|
+
|
|
33
|
+
== Setup
|
|
34
|
+
|
|
35
|
+
To install, run:
|
|
36
|
+
|
|
37
|
+
[source,bash]
|
|
38
|
+
----
|
|
39
|
+
gem install tocer
|
|
40
|
+
----
|
|
41
|
+
|
|
42
|
+
== Usage
|
|
43
|
+
|
|
44
|
+
=== Command Line Interface (CLI)
|
|
45
|
+
|
|
46
|
+
From the command line, type: `+tocer --help+`
|
|
47
|
+
|
|
48
|
+
....
|
|
49
|
+
tocer -c, [--config] # Manage gem configuration.
|
|
50
|
+
tocer -g, [--generate=PATH] # Generate table of contents.
|
|
51
|
+
tocer -h, [--help=COMMAND] # Show this message or get help for a command.
|
|
52
|
+
tocer -v, [--version] # Show gem version.
|
|
53
|
+
....
|
|
54
|
+
|
|
55
|
+
For specific `+--generate+` options, run `+tocer --help --generate+` to see the following:
|
|
56
|
+
|
|
57
|
+
....
|
|
58
|
+
-l, [--label=LABEL] # Label
|
|
59
|
+
# Default: ## Table of Contents
|
|
60
|
+
-i, [--includes=one two three] # File include list
|
|
61
|
+
# Default: ["README.md"]
|
|
62
|
+
....
|
|
63
|
+
|
|
64
|
+
To generate the table of contents at a specific position within your Markdown files, add the
|
|
65
|
+
following lines to your file(s) prior to generation:
|
|
66
|
+
|
|
67
|
+
[source,markdown]
|
|
68
|
+
----
|
|
69
|
+
<!-- Tocer[start] -->
|
|
70
|
+
<!-- Tocer[finish] -->
|
|
71
|
+
----
|
|
72
|
+
|
|
73
|
+
Alternatively, you can run `+tocer -g <directory>+` on files that do not have Tocer support and it
|
|
74
|
+
will prepend the table of contents to your file(s), complete with an auto-generated table of
|
|
75
|
+
contents.
|
|
76
|
+
|
|
77
|
+
In the case that Tocer has already auto-generated a table of contents for a Markdown file, the
|
|
78
|
+
existing table of contents has become stale, or placement of the table of contents has changed you
|
|
79
|
+
can re-run Tocer on that file to auto-update it with new table of contents.
|
|
80
|
+
|
|
81
|
+
=== Customization
|
|
82
|
+
|
|
83
|
+
This gem can be configured via a global configuration: `~/.config/tocer/configuration.yml`.
|
|
84
|
+
|
|
85
|
+
It can also be configured via link:https://www.alchemists.io/projects/xdg[XDG] environment
|
|
86
|
+
variables.
|
|
87
|
+
|
|
88
|
+
The default configuration is as follows:
|
|
89
|
+
|
|
90
|
+
[source,yaml]
|
|
91
|
+
----
|
|
92
|
+
:label: "## Table of Contents"
|
|
93
|
+
:includes:
|
|
94
|
+
- "README.md"
|
|
95
|
+
----
|
|
96
|
+
|
|
97
|
+
Feel free to take this default configuration, modify, and save as your own custom
|
|
98
|
+
`configuration.yml`.
|
|
99
|
+
|
|
100
|
+
The `configuration.yml` file can be configured as follows:
|
|
101
|
+
|
|
102
|
+
* `label`: The header label for the table of contents. Default: `"# Table of Contents"`.
|
|
103
|
+
* `includes`: The list of included files. Default: `"*.md"`.
|
|
104
|
+
|
|
105
|
+
There are multiple ways the include list can be defined. Here are some examples:
|
|
106
|
+
|
|
107
|
+
[source,yaml]
|
|
108
|
+
----
|
|
109
|
+
# Use an empty array to ignore all files (a key with no value would work too).
|
|
110
|
+
:includes: []
|
|
111
|
+
|
|
112
|
+
# Use an array of wildcards for groups of files with similar extensions:
|
|
113
|
+
:includes:
|
|
114
|
+
- "*.md"
|
|
115
|
+
- "*.mkd"
|
|
116
|
+
- "*.markdown"
|
|
117
|
+
|
|
118
|
+
# Use a mix of wild cards and relative names/paths to customized as necessary:
|
|
119
|
+
:includes:
|
|
120
|
+
- "README.md"
|
|
121
|
+
- "docs/*.md"
|
|
122
|
+
- "*.markdown"
|
|
123
|
+
|
|
124
|
+
# Use a recursive glob to traverse and update all sub-directories:
|
|
125
|
+
:includes:
|
|
126
|
+
- "**/*.md"
|
|
127
|
+
----
|
|
128
|
+
|
|
129
|
+
=== Rake
|
|
130
|
+
|
|
131
|
+
You can add Rake support by adding the following to your `Rakefile`:
|
|
132
|
+
|
|
133
|
+
[source,ruby]
|
|
134
|
+
----
|
|
135
|
+
begin
|
|
136
|
+
require "tocer/rake/setup"
|
|
137
|
+
rescue LoadError => error
|
|
138
|
+
puts error.message
|
|
139
|
+
end
|
|
140
|
+
----
|
|
141
|
+
|
|
142
|
+
Once configured, the following tasks will be available (i.e. `bundle exec rake -T`):
|
|
143
|
+
|
|
144
|
+
....
|
|
145
|
+
rake toc[label,includes] # Add/Update Table of Contents (README)
|
|
146
|
+
....
|
|
147
|
+
|
|
148
|
+
…which can be called as follows (quotes are not necessary if spaces are not used):
|
|
149
|
+
|
|
150
|
+
[source,bash]
|
|
151
|
+
----
|
|
152
|
+
rake toc["## Example, *.md"]
|
|
153
|
+
----
|
|
154
|
+
|
|
155
|
+
== Development
|
|
156
|
+
|
|
157
|
+
To contribute, run:
|
|
158
|
+
|
|
159
|
+
[source,bash]
|
|
160
|
+
----
|
|
161
|
+
git clone https://github.com/bkuhlmann/tocer.git
|
|
162
|
+
cd tocer
|
|
163
|
+
bin/setup
|
|
164
|
+
----
|
|
165
|
+
|
|
166
|
+
You can also use the IRB console for direct access to all objects:
|
|
167
|
+
|
|
168
|
+
[source,bash]
|
|
169
|
+
----
|
|
170
|
+
bin/console
|
|
171
|
+
----
|
|
172
|
+
|
|
173
|
+
== Tests
|
|
174
|
+
|
|
175
|
+
To test, run:
|
|
176
|
+
|
|
177
|
+
[source,bash]
|
|
178
|
+
----
|
|
179
|
+
bundle exec rake
|
|
180
|
+
----
|
|
181
|
+
|
|
182
|
+
== Versioning
|
|
183
|
+
|
|
184
|
+
Read link:https://semver.org[Semantic Versioning] for details. Briefly, it means:
|
|
185
|
+
|
|
186
|
+
* Major (X.y.z) - Incremented for any backwards incompatible public API changes.
|
|
187
|
+
* Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
|
|
188
|
+
* Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
|
|
189
|
+
|
|
190
|
+
== Code of Conduct
|
|
191
|
+
|
|
192
|
+
Please note that this project is released with a link:CODE_OF_CONDUCT.adoc[CODE OF CONDUCT]. By
|
|
193
|
+
participating in this project you agree to abide by its terms.
|
|
194
|
+
|
|
195
|
+
== Contributions
|
|
196
|
+
|
|
197
|
+
Read link:CONTRIBUTING.adoc[CONTRIBUTING] for details.
|
|
198
|
+
|
|
199
|
+
== License
|
|
200
|
+
|
|
201
|
+
Read link:LICENSE.adoc[LICENSE] for details.
|
|
202
|
+
|
|
203
|
+
== History
|
|
204
|
+
|
|
205
|
+
Read link:CHANGES.adoc[CHANGES] for details.
|
|
206
|
+
|
|
207
|
+
== Credits
|
|
208
|
+
|
|
209
|
+
Engineered by link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
|
data/bin/tocer
CHANGED
data/lib/tocer/cli.rb
CHANGED
|
@@ -9,7 +9,7 @@ module Tocer
|
|
|
9
9
|
class CLI < Thor
|
|
10
10
|
include Thor::Actions
|
|
11
11
|
|
|
12
|
-
package_name Identity
|
|
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
|
|
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."
|
data/lib/tocer/configuration.rb
CHANGED
|
@@ -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 =~
|
|
8
|
+
(lines.index { |line| line =~ /<!--.*#{Regexp.escape id}.*-->/ }).to_i
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def initialize start_id: "Tocer[start]",
|
data/lib/tocer/identity.rb
CHANGED
|
@@ -3,20 +3,9 @@
|
|
|
3
3
|
module Tocer
|
|
4
4
|
# Gem identity information.
|
|
5
5
|
module Identity
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def self.label
|
|
11
|
-
"Tocer"
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def self.version
|
|
15
|
-
"10.0.0"
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def self.version_label
|
|
19
|
-
"#{label} #{version}"
|
|
20
|
-
end
|
|
6
|
+
NAME = "tocer"
|
|
7
|
+
LABEL = "Tocer"
|
|
8
|
+
VERSION = "10.3.0"
|
|
9
|
+
VERSION_LABEL = "#{LABEL} #{VERSION}"
|
|
21
10
|
end
|
|
22
11
|
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.
|
|
4
|
+
version: 10.3.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/
|
|
14
|
-
|
|
15
|
-
|
|
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/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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-
|
|
31
|
+
date: 2020-10-18 00:00:00.000000000 Z
|
|
32
32
|
dependencies:
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
34
34
|
name: refinements
|
|
@@ -36,14 +36,14 @@ dependencies:
|
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '7.
|
|
39
|
+
version: '7.11'
|
|
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.
|
|
46
|
+
version: '7.11'
|
|
47
47
|
- !ruby/object:Gem::Dependency
|
|
48
48
|
name: runcom
|
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -100,6 +100,34 @@ dependencies:
|
|
|
100
100
|
- - "~>"
|
|
101
101
|
- !ruby/object:Gem::Version
|
|
102
102
|
version: '0.1'
|
|
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.2'
|
|
110
|
+
type: :development
|
|
111
|
+
prerelease: false
|
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
113
|
+
requirements:
|
|
114
|
+
- - "~>"
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: '14.2'
|
|
117
|
+
- !ruby/object:Gem::Dependency
|
|
118
|
+
name: git-lint
|
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - "~>"
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: '1.0'
|
|
124
|
+
type: :development
|
|
125
|
+
prerelease: false
|
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
127
|
+
requirements:
|
|
128
|
+
- - "~>"
|
|
129
|
+
- !ruby/object:Gem::Version
|
|
130
|
+
version: '1.0'
|
|
103
131
|
- !ruby/object:Gem::Dependency
|
|
104
132
|
name: guard-rspec
|
|
105
133
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -120,28 +148,28 @@ dependencies:
|
|
|
120
148
|
requirements:
|
|
121
149
|
- - "~>"
|
|
122
150
|
- !ruby/object:Gem::Version
|
|
123
|
-
version: '0.
|
|
151
|
+
version: '0.13'
|
|
124
152
|
type: :development
|
|
125
153
|
prerelease: false
|
|
126
154
|
version_requirements: !ruby/object:Gem::Requirement
|
|
127
155
|
requirements:
|
|
128
156
|
- - "~>"
|
|
129
157
|
- !ruby/object:Gem::Version
|
|
130
|
-
version: '0.
|
|
158
|
+
version: '0.13'
|
|
131
159
|
- !ruby/object:Gem::Dependency
|
|
132
160
|
name: pry-byebug
|
|
133
161
|
requirement: !ruby/object:Gem::Requirement
|
|
134
162
|
requirements:
|
|
135
163
|
- - "~>"
|
|
136
164
|
- !ruby/object:Gem::Version
|
|
137
|
-
version: '3.
|
|
165
|
+
version: '3.9'
|
|
138
166
|
type: :development
|
|
139
167
|
prerelease: false
|
|
140
168
|
version_requirements: !ruby/object:Gem::Requirement
|
|
141
169
|
requirements:
|
|
142
170
|
- - "~>"
|
|
143
171
|
- !ruby/object:Gem::Version
|
|
144
|
-
version: '3.
|
|
172
|
+
version: '3.9'
|
|
145
173
|
- !ruby/object:Gem::Dependency
|
|
146
174
|
name: rake
|
|
147
175
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -162,14 +190,14 @@ dependencies:
|
|
|
162
190
|
requirements:
|
|
163
191
|
- - "~>"
|
|
164
192
|
- !ruby/object:Gem::Version
|
|
165
|
-
version: '
|
|
193
|
+
version: '6.0'
|
|
166
194
|
type: :development
|
|
167
195
|
prerelease: false
|
|
168
196
|
version_requirements: !ruby/object:Gem::Requirement
|
|
169
197
|
requirements:
|
|
170
198
|
- - "~>"
|
|
171
199
|
- !ruby/object:Gem::Version
|
|
172
|
-
version: '
|
|
200
|
+
version: '6.0'
|
|
173
201
|
- !ruby/object:Gem::Dependency
|
|
174
202
|
name: rspec
|
|
175
203
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -190,14 +218,14 @@ dependencies:
|
|
|
190
218
|
requirements:
|
|
191
219
|
- - "~>"
|
|
192
220
|
- !ruby/object:Gem::Version
|
|
193
|
-
version: '0.
|
|
221
|
+
version: '0.89'
|
|
194
222
|
type: :development
|
|
195
223
|
prerelease: false
|
|
196
224
|
version_requirements: !ruby/object:Gem::Requirement
|
|
197
225
|
requirements:
|
|
198
226
|
- - "~>"
|
|
199
227
|
- !ruby/object:Gem::Version
|
|
200
|
-
version: '0.
|
|
228
|
+
version: '0.89'
|
|
201
229
|
- !ruby/object:Gem::Dependency
|
|
202
230
|
name: rubocop-performance
|
|
203
231
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -232,40 +260,40 @@ dependencies:
|
|
|
232
260
|
requirements:
|
|
233
261
|
- - "~>"
|
|
234
262
|
- !ruby/object:Gem::Version
|
|
235
|
-
version: '1.
|
|
263
|
+
version: '1.39'
|
|
236
264
|
type: :development
|
|
237
265
|
prerelease: false
|
|
238
266
|
version_requirements: !ruby/object:Gem::Requirement
|
|
239
267
|
requirements:
|
|
240
268
|
- - "~>"
|
|
241
269
|
- !ruby/object:Gem::Version
|
|
242
|
-
version: '1.
|
|
270
|
+
version: '1.39'
|
|
243
271
|
- !ruby/object:Gem::Dependency
|
|
244
272
|
name: simplecov
|
|
245
273
|
requirement: !ruby/object:Gem::Requirement
|
|
246
274
|
requirements:
|
|
247
275
|
- - "~>"
|
|
248
276
|
- !ruby/object:Gem::Version
|
|
249
|
-
version: '0.
|
|
277
|
+
version: '0.19'
|
|
250
278
|
type: :development
|
|
251
279
|
prerelease: false
|
|
252
280
|
version_requirements: !ruby/object:Gem::Requirement
|
|
253
281
|
requirements:
|
|
254
282
|
- - "~>"
|
|
255
283
|
- !ruby/object:Gem::Version
|
|
256
|
-
version: '0.
|
|
257
|
-
description:
|
|
284
|
+
version: '0.19'
|
|
285
|
+
description:
|
|
258
286
|
email:
|
|
259
287
|
- brooke@alchemists.io
|
|
260
288
|
executables:
|
|
261
289
|
- tocer
|
|
262
290
|
extensions: []
|
|
263
291
|
extra_rdoc_files:
|
|
264
|
-
- README.
|
|
265
|
-
- LICENSE.
|
|
292
|
+
- README.adoc
|
|
293
|
+
- LICENSE.adoc
|
|
266
294
|
files:
|
|
267
|
-
- LICENSE.
|
|
268
|
-
- README.
|
|
295
|
+
- LICENSE.adoc
|
|
296
|
+
- README.adoc
|
|
269
297
|
- bin/tocer
|
|
270
298
|
- lib/tocer.rb
|
|
271
299
|
- lib/tocer/builder.rb
|
|
@@ -281,14 +309,15 @@ files:
|
|
|
281
309
|
- lib/tocer/transformers/link.rb
|
|
282
310
|
- lib/tocer/transformers/text.rb
|
|
283
311
|
- lib/tocer/writer.rb
|
|
284
|
-
homepage: https://
|
|
312
|
+
homepage: https://www.alchemists.io/projects/tocer
|
|
285
313
|
licenses:
|
|
286
314
|
- Apache-2.0
|
|
287
315
|
metadata:
|
|
288
|
-
source_code_uri: https://github.com/bkuhlmann/tocer
|
|
289
|
-
changelog_uri: https://github.com/bkuhlmann/tocer/blob/master/CHANGES.md
|
|
290
316
|
bug_tracker_uri: https://github.com/bkuhlmann/tocer/issues
|
|
291
|
-
|
|
317
|
+
changelog_uri: https://www.alchemists.io/projects/tocer/changes.html
|
|
318
|
+
documentation_uri: https://www.alchemists.io/projects/tocer
|
|
319
|
+
source_code_uri: https://github.com/bkuhlmann/tocer
|
|
320
|
+
post_install_message:
|
|
292
321
|
rdoc_options: []
|
|
293
322
|
require_paths:
|
|
294
323
|
- lib
|
|
@@ -303,8 +332,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
303
332
|
- !ruby/object:Gem::Version
|
|
304
333
|
version: '0'
|
|
305
334
|
requirements: []
|
|
306
|
-
rubygems_version: 3.1.
|
|
307
|
-
signing_key:
|
|
335
|
+
rubygems_version: 3.1.4
|
|
336
|
+
signing_key:
|
|
308
337
|
specification_version: 4
|
|
309
338
|
summary: A command line interface for generating table of contents for Markdown files.
|
|
310
339
|
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
|
-
[](http://badge.fury.io/rb/tocer)
|
|
8
|
-
[](https://codeclimate.com/github/bkuhlmann/tocer/maintainability)
|
|
9
|
-
[](https://codeclimate.com/github/bkuhlmann/tocer/test_coverage)
|
|
10
|
-
[](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.6.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).
|