tocer 10.0.1 → 10.1.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 +3 -3
- data.tar.gz.sig +1 -1
- data/{LICENSE.md → LICENSE.adoc} +29 -30
- data/README.adoc +211 -0
- data/bin/tocer +1 -1
- data/lib/tocer/cli.rb +2 -2
- data/lib/tocer/configuration.rb +1 -1
- data/lib/tocer/identity.rb +4 -15
- metadata +26 -25
- 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: f96f8f4040d155551b11770a7aa0322fb991b40e952370e2263cc04f2bb76184
|
|
4
|
+
data.tar.gz: 1004e0f4bf571f7c7f12c3f39ad70898b4de9c18701e749939a138e5144db4ae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f02d957b5de932d91556ebaf16ecade9e17f71f0e476744586b253d957dc5649b9057e61e1d46cdfd5b9f38dc032c25fc212a3e2fd2f7f77bf136ea6fcbe384f
|
|
7
|
+
data.tar.gz: ff709e8f67157b5f1eac1600bd5e3cfe02e57f3362d0b3b6b3516d11221dc013620c7223c088f1de556df8a19cae5c26b2989ea724108e85602a6fe383035e51
|
checksums.yaml.gz.sig
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
Dz+�i��ņ_�=ӨT�X�y2�K�Gy�i\�,P��u_z�x���t�>zA�=|h����+��q[�0̔�;N�s��
|
|
2
|
+
��n<{N��ٙ��`.�f��q0�
|
|
3
|
+
'��4�"�E�}���&�'�p�T ��q�zנ���&�a^u8�$�ٿ���ͫcK�p�_��ի�� !kL0�/j�c)CwK�9�RS;���>���� �P�z��6�R����db
|
data.tar.gz.sig
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
j��߱�2�=��eT�%�p�w��������Xa�պ��C��l��O���)a�'�!\9�s-�毑u9���Xq�!�RMRUK
|
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
|
|
153
|
+
Copyright link:https://www.alchemists.io[Alchemists].
|
|
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,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://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
|
+
. https://www.ruby-lang.org[Ruby 2.7.x].
|
|
32
|
+
|
|
33
|
+
== Setup
|
|
34
|
+
|
|
35
|
+
=== Production
|
|
36
|
+
|
|
37
|
+
To install, run:
|
|
38
|
+
|
|
39
|
+
[source,bash]
|
|
40
|
+
----
|
|
41
|
+
gem install tocer
|
|
42
|
+
----
|
|
43
|
+
|
|
44
|
+
=== Development
|
|
45
|
+
|
|
46
|
+
To contribute, run:
|
|
47
|
+
|
|
48
|
+
[source,bash]
|
|
49
|
+
----
|
|
50
|
+
git clone https://github.com/bkuhlmann/tocer.git
|
|
51
|
+
cd tocer
|
|
52
|
+
bin/setup
|
|
53
|
+
----
|
|
54
|
+
|
|
55
|
+
You can also use the IRB console for direct access to all objects:
|
|
56
|
+
|
|
57
|
+
[source,bash]
|
|
58
|
+
----
|
|
59
|
+
bin/console
|
|
60
|
+
----
|
|
61
|
+
|
|
62
|
+
== Usage
|
|
63
|
+
|
|
64
|
+
=== Command Line Interface (CLI)
|
|
65
|
+
|
|
66
|
+
From the command line, type: `+tocer --help+`
|
|
67
|
+
|
|
68
|
+
....
|
|
69
|
+
tocer -c, [--config] # Manage gem configuration.
|
|
70
|
+
tocer -g, [--generate=PATH] # Generate table of contents.
|
|
71
|
+
tocer -h, [--help=COMMAND] # Show this message or get help for a command.
|
|
72
|
+
tocer -v, [--version] # Show gem version.
|
|
73
|
+
....
|
|
74
|
+
|
|
75
|
+
For specific `+--generate+` options, run `+tocer --help --generate+` to see the following:
|
|
76
|
+
|
|
77
|
+
....
|
|
78
|
+
-l, [--label=LABEL] # Label
|
|
79
|
+
# Default: ## Table of Contents
|
|
80
|
+
-i, [--includes=one two three] # File include list
|
|
81
|
+
# Default: ["README.md"]
|
|
82
|
+
....
|
|
83
|
+
|
|
84
|
+
To generate the table of contents at a specific position within your Markdown files, add the
|
|
85
|
+
following lines to your file(s) prior to generation:
|
|
86
|
+
|
|
87
|
+
[source,markdown]
|
|
88
|
+
----
|
|
89
|
+
<!-- Tocer[start] -->
|
|
90
|
+
<!-- Tocer[finish] -->
|
|
91
|
+
----
|
|
92
|
+
|
|
93
|
+
Alternatively, you can run `+tocer -g <directory>+` on files that do not have Tocer support and it
|
|
94
|
+
will prepend the table of contents to your file(s), complete with an auto-generated table of
|
|
95
|
+
contents.
|
|
96
|
+
|
|
97
|
+
In the case that Tocer has already auto-generated a table of contents for a Markdown file, the
|
|
98
|
+
existing table of contents has become stale, or placement of the table of contents has changed you
|
|
99
|
+
can re-run Tocer on that file to auto-update it with new table of contents.
|
|
100
|
+
|
|
101
|
+
=== Customization
|
|
102
|
+
|
|
103
|
+
This gem can be configured via a global configuration: `~/.config/tocer/configuration.yml`.
|
|
104
|
+
|
|
105
|
+
It can also be configured via link:https://www.alchemists.io/projects/xdg[XDG] environment
|
|
106
|
+
variables.
|
|
107
|
+
|
|
108
|
+
The default configuration is as follows:
|
|
109
|
+
|
|
110
|
+
[source,yaml]
|
|
111
|
+
----
|
|
112
|
+
:label: "## Table of Contents"
|
|
113
|
+
:includes:
|
|
114
|
+
- "README.md"
|
|
115
|
+
----
|
|
116
|
+
|
|
117
|
+
Feel free to take this default configuration, modify, and save as your own custom
|
|
118
|
+
`configuration.yml`.
|
|
119
|
+
|
|
120
|
+
The `configuration.yml` file can be configured as follows:
|
|
121
|
+
|
|
122
|
+
* `label`: The header label for the table of contents. Default: `"# Table of Contents"`.
|
|
123
|
+
* `includes`: The list of included files. Default: `"*.md"`.
|
|
124
|
+
|
|
125
|
+
There are multiple ways the include list can be defined. Here are some examples:
|
|
126
|
+
|
|
127
|
+
[source,yaml]
|
|
128
|
+
----
|
|
129
|
+
# Use an empty array to ignore all files (a key with no value would work too).
|
|
130
|
+
:includes: []
|
|
131
|
+
|
|
132
|
+
# Use an array of wildcards for groups of files with similar extensions:
|
|
133
|
+
:includes:
|
|
134
|
+
- "*.md"
|
|
135
|
+
- "*.mkd"
|
|
136
|
+
- "*.markdown"
|
|
137
|
+
|
|
138
|
+
# Use a mix of wild cards and relative names/paths to customized as necessary:
|
|
139
|
+
:includes:
|
|
140
|
+
- "README.md"
|
|
141
|
+
- "docs/*.md"
|
|
142
|
+
- "*.markdown"
|
|
143
|
+
|
|
144
|
+
# Use a recursive glob to traverse and update all sub-directories:
|
|
145
|
+
:includes:
|
|
146
|
+
- "**/*.md"
|
|
147
|
+
----
|
|
148
|
+
|
|
149
|
+
=== Rake
|
|
150
|
+
|
|
151
|
+
You can add Rake support by adding the following to your `Rakefile`:
|
|
152
|
+
|
|
153
|
+
[source,ruby]
|
|
154
|
+
----
|
|
155
|
+
begin
|
|
156
|
+
require "tocer/rake/setup"
|
|
157
|
+
rescue LoadError => error
|
|
158
|
+
puts error.message
|
|
159
|
+
end
|
|
160
|
+
----
|
|
161
|
+
|
|
162
|
+
Once configured, the following tasks will be available (i.e. `bundle exec rake -T`):
|
|
163
|
+
|
|
164
|
+
....
|
|
165
|
+
rake toc[label,includes] # Add/Update Table of Contents (README)
|
|
166
|
+
....
|
|
167
|
+
|
|
168
|
+
…which can be called as follows (quotes are not necessary if spaces are not used):
|
|
169
|
+
|
|
170
|
+
[source,bash]
|
|
171
|
+
----
|
|
172
|
+
rake toc["## Example, *.md"]
|
|
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.html[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 @@ require "runcom"
|
|
|
5
5
|
module Tocer
|
|
6
6
|
module Configuration
|
|
7
7
|
def self.default
|
|
8
|
-
Runcom::Config.new "#{Identity
|
|
8
|
+
Runcom::Config.new "#{Identity::NAME}/configuration.yml",
|
|
9
9
|
defaults: {
|
|
10
10
|
label: "## Table of Contents",
|
|
11
11
|
includes: ["README.md"]
|
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.1"
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def self.version_label
|
|
19
|
-
"#{label} #{version}"
|
|
20
|
-
end
|
|
6
|
+
NAME = "tocer"
|
|
7
|
+
LABEL = "Tocer"
|
|
8
|
+
VERSION = "10.1.0"
|
|
9
|
+
VERSION_LABEL = "#{LABEL} #{VERSION}"
|
|
21
10
|
end
|
|
22
11
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tocer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 10.0
|
|
4
|
+
version: 10.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brooke Kuhlmann
|
|
@@ -10,9 +10,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-01
|
|
31
|
+
date: 2020-04-01 00:00:00.000000000 Z
|
|
32
32
|
dependencies:
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
34
34
|
name: refinements
|
|
@@ -190,14 +190,14 @@ dependencies:
|
|
|
190
190
|
requirements:
|
|
191
191
|
- - "~>"
|
|
192
192
|
- !ruby/object:Gem::Version
|
|
193
|
-
version: '
|
|
193
|
+
version: '6.0'
|
|
194
194
|
type: :development
|
|
195
195
|
prerelease: false
|
|
196
196
|
version_requirements: !ruby/object:Gem::Requirement
|
|
197
197
|
requirements:
|
|
198
198
|
- - "~>"
|
|
199
199
|
- !ruby/object:Gem::Version
|
|
200
|
-
version: '
|
|
200
|
+
version: '6.0'
|
|
201
201
|
- !ruby/object:Gem::Dependency
|
|
202
202
|
name: rspec
|
|
203
203
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -218,14 +218,14 @@ dependencies:
|
|
|
218
218
|
requirements:
|
|
219
219
|
- - "~>"
|
|
220
220
|
- !ruby/object:Gem::Version
|
|
221
|
-
version: '0.
|
|
221
|
+
version: '0.79'
|
|
222
222
|
type: :development
|
|
223
223
|
prerelease: false
|
|
224
224
|
version_requirements: !ruby/object:Gem::Requirement
|
|
225
225
|
requirements:
|
|
226
226
|
- - "~>"
|
|
227
227
|
- !ruby/object:Gem::Version
|
|
228
|
-
version: '0.
|
|
228
|
+
version: '0.79'
|
|
229
229
|
- !ruby/object:Gem::Dependency
|
|
230
230
|
name: rubocop-performance
|
|
231
231
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -274,14 +274,14 @@ dependencies:
|
|
|
274
274
|
requirements:
|
|
275
275
|
- - "~>"
|
|
276
276
|
- !ruby/object:Gem::Version
|
|
277
|
-
version: '0.
|
|
277
|
+
version: '0.18'
|
|
278
278
|
type: :development
|
|
279
279
|
prerelease: false
|
|
280
280
|
version_requirements: !ruby/object:Gem::Requirement
|
|
281
281
|
requirements:
|
|
282
282
|
- - "~>"
|
|
283
283
|
- !ruby/object:Gem::Version
|
|
284
|
-
version: '0.
|
|
284
|
+
version: '0.18'
|
|
285
285
|
description:
|
|
286
286
|
email:
|
|
287
287
|
- brooke@alchemists.io
|
|
@@ -289,11 +289,11 @@ executables:
|
|
|
289
289
|
- tocer
|
|
290
290
|
extensions: []
|
|
291
291
|
extra_rdoc_files:
|
|
292
|
-
- README.
|
|
293
|
-
- LICENSE.
|
|
292
|
+
- README.adoc
|
|
293
|
+
- LICENSE.adoc
|
|
294
294
|
files:
|
|
295
|
-
- LICENSE.
|
|
296
|
-
- README.
|
|
295
|
+
- LICENSE.adoc
|
|
296
|
+
- README.adoc
|
|
297
297
|
- bin/tocer
|
|
298
298
|
- lib/tocer.rb
|
|
299
299
|
- lib/tocer/builder.rb
|
|
@@ -309,13 +309,14 @@ files:
|
|
|
309
309
|
- lib/tocer/transformers/link.rb
|
|
310
310
|
- lib/tocer/transformers/text.rb
|
|
311
311
|
- lib/tocer/writer.rb
|
|
312
|
-
homepage: https://
|
|
312
|
+
homepage: https://www.alchemists.io/projects/tocer
|
|
313
313
|
licenses:
|
|
314
314
|
- Apache-2.0
|
|
315
315
|
metadata:
|
|
316
|
-
source_code_uri: https://github.com/bkuhlmann/tocer
|
|
317
|
-
changelog_uri: https://github.com/bkuhlmann/tocer/blob/master/CHANGES.md
|
|
318
316
|
bug_tracker_uri: https://github.com/bkuhlmann/tocer/issues
|
|
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
|
|
319
320
|
post_install_message:
|
|
320
321
|
rdoc_options: []
|
|
321
322
|
require_paths:
|
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.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).
|