yard_ghurt 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +5 -0
- data/Gemfile +11 -1
- data/README.md +150 -145
- data/Rakefile +14 -24
- data/bin/yard_ghurt +1 -3
- data/lib/yard_ghurt/anchor_links.rb +13 -51
- data/lib/yard_ghurt/gfm_fix_task.rb +31 -61
- data/lib/yard_ghurt/ghp_sync_task.rb +12 -35
- data/lib/yard_ghurt/util.rb +13 -21
- data/lib/yard_ghurt/version.rb +2 -3
- data/lib/yard_ghurt.rb +8 -16
- data/yard_ghurt.gemspec +39 -32
- metadata +13 -56
- data/CHANGELOG.md +0 -73
- data/yard/templates/default/layout/html/footer.erb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2bfcf160b53592d1c17718a1811ade25bc5b9ca1a873f87f86cfecaa8978bb7
|
4
|
+
data.tar.gz: 927542fe06f6dd0945a172d7e5abf5118bd1cb712aeb0f04162d691f47c600dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0b9ba1d972051bf73f3c36e6042ed40c150e4f7c98f55a2c2fcb4b43beae191f6a92da951f73494a7949e6dea3828d4ba6fb841bff43796ed0d937c04b06e53
|
7
|
+
data.tar.gz: 41bc4528945c3b394434f8926ae5bff3a5e965b8c402bbaf60cb510efaa10fd8061795a409a05b3e902a67cbc28f7a26aa471bd525af4b10c595dfb7eb77ceee
|
data/.yardopts
ADDED
data/Gemfile
CHANGED
@@ -1,7 +1,17 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
4
|
source 'https://rubygems.org'
|
6
5
|
|
7
6
|
gemspec
|
7
|
+
|
8
|
+
group :development,:test do
|
9
|
+
gem 'bundler' ,'~> 2.6'
|
10
|
+
|
11
|
+
gem 'rdoc' ,'~> 6.14' # For RDoc for YARD (*.rb).
|
12
|
+
gem 'redcarpet','~> 3.6' # For Markdown for YARD (*.md).
|
13
|
+
end
|
14
|
+
|
15
|
+
group :test do
|
16
|
+
# gem 'minitest' ,'~> 5.25'
|
17
|
+
end
|
data/README.md
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
# YardGhurt
|
2
2
|
|
3
3
|
[](https://badge.fury.io/rb/yard_ghurt)
|
4
|
-
|
5
4
|
[](https://esotericpig.github.io/docs/yard_ghurt/yardoc/index.html)
|
6
5
|
[](https://github.com/esotericpig/yard_ghurt)
|
7
|
-
[](CHANGELOG.md)
|
8
6
|
[](LICENSE.txt)
|
9
7
|
|
10
8
|
<u>YARD</u>oc <u>G</u>it<u>Hu</u>b <u>R</u>ake <u>T</u>asks
|
@@ -12,190 +10,192 @@
|
|
12
10
|
- Fix GitHub Flavored Markdown files.
|
13
11
|
- Sync YARDoc to a local GitHub Pages repo.
|
14
12
|
|
15
|
-
## Contents
|
13
|
+
## // Contents
|
16
14
|
|
17
|
-
- [Setup](
|
18
|
-
- [Using](
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
- [CLI App](
|
24
|
-
- [Hacking](
|
25
|
-
|
26
|
-
- [Tests](
|
27
|
-
- [License](
|
15
|
+
- [Setup](#-setup)
|
16
|
+
- [Using](#-using)
|
17
|
+
- [GFMFixTask](#-gfmfixtask)
|
18
|
+
- [GHPSyncTask](#-ghpsynctask)
|
19
|
+
- [Util / YardGhurt](#-util--yardghurt)
|
20
|
+
- [AnchorLinks](#-anchorlinks)
|
21
|
+
- [CLI App](#-cli-app)
|
22
|
+
- [Hacking](#-hacking)
|
23
|
+
- [Testing](#-testing)
|
24
|
+
- [Tests](#-tests)
|
25
|
+
- [License](#-license)
|
28
26
|
|
29
|
-
## [
|
27
|
+
## [//](#-contents) Setup
|
30
28
|
|
31
29
|
Pick your poison...
|
32
30
|
|
33
31
|
With the RubyGems CLI package manager:
|
34
32
|
|
35
|
-
|
33
|
+
```bash
|
34
|
+
gem install yard_ghurt
|
35
|
+
```
|
36
36
|
|
37
|
-
In your *Gemspec
|
37
|
+
In your *Gemspec*:
|
38
38
|
|
39
|
-
```
|
39
|
+
```ruby
|
40
40
|
spec.add_development_dependency 'yard_ghurt', '~> X.X.X'
|
41
41
|
```
|
42
42
|
|
43
43
|
In your *Gemfile*:
|
44
44
|
|
45
|
-
```
|
46
|
-
gem 'yard_ghurt', '~> X.X.X', :
|
45
|
+
```ruby
|
46
|
+
gem 'yard_ghurt', '~> X.X.X', group: %i[development test]
|
47
47
|
# or...
|
48
|
-
gem 'yard_ghurt', :
|
49
|
-
:
|
48
|
+
gem 'yard_ghurt', git: 'https://github.com/esotericpig/yard_ghurt.git',
|
49
|
+
branch: main, group: %i[development test]
|
50
50
|
```
|
51
51
|
|
52
|
-
|
52
|
+
From source:
|
53
53
|
|
54
|
-
```
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
54
|
+
```bash
|
55
|
+
git clone --depth 1 'https://github.com/esotericpig/yard_ghurt.git'
|
56
|
+
cd yard_ghurt
|
57
|
+
bundle install
|
58
|
+
bundle exec rake install:local
|
59
59
|
```
|
60
60
|
|
61
|
-
## [
|
61
|
+
## [//](#-contents) Using
|
62
62
|
|
63
63
|
Currently, you can't use this project as a YARDoc Plugin, but planning on it for v2.0. Read the [TODO](TODO.md) for more info.
|
64
64
|
|
65
65
|
**Rake Tasks:**
|
66
66
|
|
67
|
-
| Task
|
68
|
-
|
69
|
-
| [GFMFixTask](
|
70
|
-
| [GHPSyncTask](
|
67
|
+
| Task | Description |
|
68
|
+
|------------------------------|-------------------------------------------|
|
69
|
+
| [GFMFixTask](#-gfmfixtask) | Fix GitHub Flavored Markdown files. |
|
70
|
+
| [GHPSyncTask](#-ghpsynctask) | Sync YARDoc to a local GitHub Pages repo. |
|
71
71
|
|
72
72
|
**Helpers:**
|
73
73
|
|
74
|
-
| Helper
|
75
|
-
|
76
|
-
| [Util / YardGhurt](
|
77
|
-
| [AnchorLinks](
|
74
|
+
| Helper | Description |
|
75
|
+
|---------------------------------------|-------------------------------|
|
76
|
+
| [Util / YardGhurt](#-util--yardghurt) | Utility methods for tasks. |
|
77
|
+
| [AnchorLinks](#-anchorlinks) | A “database” of anchor links. |
|
78
78
|
|
79
|
-
### [
|
79
|
+
### [//](#-contents) GFMFixTask
|
80
80
|
|
81
81
|
Fix (find & replace) text in the GitHub Flavored Markdown (GFM) files in the YARDoc directory, for differences between the two formats.
|
82
82
|
|
83
83
|
**Very Important!**
|
84
84
|
|
85
|
-
In order for this to work, you must also add `redcarpet` as a dependency
|
85
|
+
In order for this to work, you must also add `redcarpet` as a dependency (per YARDoc's documentation), else, you'll get a bunch of `label-*` relative links.
|
86
86
|
|
87
|
-
```
|
88
|
-
|
87
|
+
```ruby
|
88
|
+
gem 'redcarpet','~> X.X' # For YARDoc Markdown (*.md).
|
89
89
|
```
|
90
90
|
|
91
|
-
Else, you'll get a bunch of `label-*` relative links.
|
92
|
-
|
93
91
|
You can set *dry_run* on the command line:
|
94
92
|
|
95
|
-
|
93
|
+
```bash
|
94
|
+
rake yard_gfm_fix dryrun=true
|
95
|
+
```
|
96
96
|
|
97
97
|
**What I typically use:**
|
98
98
|
|
99
|
-
```
|
100
|
-
YardGhurt::GFMFixTask.new
|
101
|
-
task.arg_names = [
|
99
|
+
```ruby
|
100
|
+
YardGhurt::GFMFixTask.new do |task|
|
101
|
+
task.arg_names = %i[dev]
|
102
102
|
task.dry_run = false
|
103
103
|
task.fix_code_langs = true
|
104
104
|
task.md_files = ['index.html']
|
105
105
|
|
106
|
-
task.before =
|
107
|
-
# Delete this file as it's never used (index.html is an exact copy)
|
108
|
-
YardGhurt.rm_exist(File.join(
|
106
|
+
task.before = proc do |task2,args|
|
107
|
+
# Delete this file as it's never used (`index.html` is an exact copy).
|
108
|
+
YardGhurt.rm_exist(File.join(task2.doc_dir,'file.README.html'))
|
109
109
|
|
110
|
-
# Root dir of my GitHub Page for CSS/JS
|
110
|
+
# Root dir of my GitHub Page for CSS/JS.
|
111
111
|
ghp_root_dir = YardGhurt.to_bool(args.dev) ? '../../esotericpig.github.io' : '../../..'
|
112
112
|
|
113
|
-
|
114
|
-
|
113
|
+
task2.css_styles << %(<link rel="stylesheet" type="text/css" href="#{ghp_root_dir}/css/prism.css" />)
|
114
|
+
task2.js_scripts << %(<script src="#{ghp_root_dir}/js/prism.js"></script>)
|
115
115
|
end
|
116
116
|
end
|
117
117
|
```
|
118
118
|
|
119
|
-
**
|
119
|
+
**All options:**
|
120
120
|
|
121
|
-
```
|
121
|
+
```ruby
|
122
122
|
YardGhurt::GFMFixTask.new(:yard_fix) do |task|
|
123
|
-
task.anchor_db = {'tests' => 'Testing'} #
|
124
|
-
task.arg_names << :name # Custom args
|
125
|
-
task.css_styles << '<link rel="stylesheet" href="css/my_css.css" />' # Inserted at
|
126
|
-
task.css_styles << '<style>body{ background-color: linen; }</style>'
|
127
|
-
task.custom_gsub =
|
123
|
+
task.anchor_db = {'tests' => 'Testing'} # Anchor links `#tests` become `#Testing`.
|
124
|
+
task.arg_names << :name # Custom args.
|
125
|
+
task.css_styles << '<link rel="stylesheet" href="css/my_css.css" />' # Inserted at `</head>`.
|
126
|
+
task.css_styles << '<style>body { background-color: linen; }</style>'
|
127
|
+
task.custom_gsub = proc { |line| !line.gsub!('YardGhurt','YARD GHURT!').nil? }
|
128
128
|
task.custom_gsubs << [/newline/i,'Do you smell what The Rock is cooking?']
|
129
|
-
task.deps << :yard # Custom dependencies
|
129
|
+
task.deps << :yard # Custom dependencies.
|
130
130
|
task.description = 'Fix it'
|
131
131
|
task.doc_dir = 'doc'
|
132
|
-
task.dry_run =
|
132
|
+
task.dry_run = true
|
133
133
|
task.exclude_code_langs = Set['ruby']
|
134
134
|
task.fix_anchor_links = true
|
135
135
|
task.fix_code_langs = true
|
136
136
|
task.fix_file_links = true
|
137
|
-
task.js_scripts << '<script src="js/my_js.js"></script>' # Inserted at
|
137
|
+
task.js_scripts << '<script src="js/my_js.js"></script>' # Inserted at `</body>`.
|
138
138
|
task.js_scripts << '<script>document.write("Hello World!");</script>'
|
139
139
|
task.md_files = ['index.html']
|
140
140
|
task.verbose = false
|
141
141
|
|
142
|
-
task.before =
|
143
|
-
task.during =
|
144
|
-
task.after =
|
142
|
+
task.before = proc { |_task2,args| puts "Hi, #{args.name}!" }
|
143
|
+
task.during = proc { |_task2,args,file| puts "#{args.name} can haz #{file}?" }
|
144
|
+
task.after = proc { |_task2,args| puts "Goodbye, #{args.name}!" }
|
145
145
|
end
|
146
146
|
```
|
147
147
|
|
148
|
-
### [
|
148
|
+
### [//](#-contents) GHPSyncTask
|
149
149
|
|
150
150
|
Sync YARDoc to a local GitHub Pages repo (uses `rsync` by default).
|
151
151
|
|
152
152
|
**What I typically use:**
|
153
153
|
|
154
|
-
```
|
155
|
-
YardGhurt::GHPSyncTask.new
|
154
|
+
```ruby
|
155
|
+
YardGhurt::GHPSyncTask.new do |task|
|
156
156
|
task.ghp_dir = '../esotericpig.github.io/docs/yard_ghurt/yardoc'
|
157
157
|
task.sync_args << '--delete-after'
|
158
158
|
end
|
159
159
|
```
|
160
160
|
|
161
|
-
**
|
161
|
+
**All options:**
|
162
162
|
|
163
|
-
```
|
164
|
-
# Execute: rake ghp_doc[false,'
|
163
|
+
```ruby
|
164
|
+
# Execute: rake ghp_doc[false,'Custom']
|
165
165
|
YardGhurt::GHPSyncTask.new(:ghp_doc) do |task|
|
166
|
-
task.arg_names << :name # Custom args
|
167
|
-
task.deps << :yard # Custom dependencies
|
166
|
+
task.arg_names << :name # Custom args ('Custom').
|
167
|
+
task.deps << :yard # Custom dependencies.
|
168
168
|
task.description = 'Rsync my_doc/ to my page'
|
169
|
-
task.doc_dir = 'my_doc' # YARDoc directory of generated files
|
169
|
+
task.doc_dir = 'my_doc' # YARDoc directory of generated files.
|
170
170
|
task.ghp_dir = '../dest_dir/my_page'
|
171
|
-
task.strict = true # Fail if doc_dir doesn't exist
|
171
|
+
task.strict = true # Fail if doc_dir doesn't exist.
|
172
172
|
task.sync_args << '--delete-after'
|
173
173
|
task.sync_cmd = '/usr/bin/rsync'
|
174
174
|
|
175
|
-
task.before =
|
176
|
-
task.after =
|
175
|
+
task.before = proc { |_task2,args| puts "Hi, #{args.name}!" }
|
176
|
+
task.after = proc { |_task2,args| puts "Goodbye, #{args.name}!" }
|
177
177
|
end
|
178
178
|
```
|
179
179
|
|
180
|
-
### [Util / YardGhurt
|
180
|
+
### [//](#-contents) Util / YardGhurt
|
181
181
|
|
182
182
|
Utility methods for tasks.
|
183
183
|
|
184
|
-
```
|
184
|
+
```ruby
|
185
185
|
require 'yard_ghurt/util'
|
186
186
|
|
187
|
-
# If the file exists, delete it, and if
|
187
|
+
# If the file exists, delete it, and if `output` is true, log it to stdout.
|
188
188
|
YardGhurt::Util.rm_exist('doc/file.README.html')
|
189
189
|
YardGhurt::Util.rm_exist('doc/file.README.html',false)
|
190
190
|
|
191
|
-
# Convert an Object to true or false
|
192
|
-
puts YardGhurt::Util.to_bool('true')
|
193
|
-
puts YardGhurt::Util.to_bool('on')
|
194
|
-
puts YardGhurt::Util.to_bool('yes')
|
195
|
-
puts YardGhurt::Util.to_bool(nil)
|
191
|
+
# Convert an Object to true or false.
|
192
|
+
puts YardGhurt::Util.to_bool('true') #=> true
|
193
|
+
puts YardGhurt::Util.to_bool('on') #=> true
|
194
|
+
puts YardGhurt::Util.to_bool('yes') #=> true
|
195
|
+
puts YardGhurt::Util.to_bool(nil) #=> false
|
196
196
|
```
|
197
197
|
|
198
|
-
For convenience, *Util*'s methods are also included in the top module *YardGhurt*. However, this will also include all
|
198
|
+
For convenience, *Util*'s methods are also included in the top module *YardGhurt*. However, this will also include all the Tasks and Helpers, so *Util* is preferred, unless you're already requiring *yard_ghurt*.
|
199
199
|
|
200
200
|
```Ruby
|
201
201
|
require 'yard_ghurt'
|
@@ -204,64 +204,62 @@ YardGhurt.rm_exist('doc/file.README.html')
|
|
204
204
|
puts YardGhurt.to_bool('true')
|
205
205
|
```
|
206
206
|
|
207
|
-
### [
|
207
|
+
### [//](#-contents) AnchorLinks
|
208
|
+
|
208
209
|
A “database” of anchor links specific to GitHub Flavored Markdown (GFM) and YARDoc.
|
209
210
|
|
210
211
|
You can use this by itself to view what anchor IDs would be generated:
|
211
212
|
|
212
|
-
```
|
213
|
+
```ruby
|
213
214
|
require 'yard_ghurt/anchor_links'
|
214
215
|
|
215
|
-
al = YardGhurt::AnchorLinks.new
|
216
|
-
|
217
|
-
puts al.to_github_anchor_id('This is a test!')
|
218
|
-
puts al.to_yard_anchor_id('This is a test!')
|
216
|
+
al = YardGhurt::AnchorLinks.new
|
219
217
|
|
220
|
-
|
221
|
-
|
222
|
-
# this-is-a-test
|
223
|
-
# This_is_a_test_
|
218
|
+
puts al.to_github_anchor_id('This is a test!') #=> this-is-a-test
|
219
|
+
puts al.to_yard_anchor_id('This is a test!') #=> This_is_a_test_
|
224
220
|
```
|
225
221
|
|
226
|
-
Be aware that YARDoc depends on a common number that will be incremented for all duplicates, while GFM's number is only local to each
|
222
|
+
Be aware that YARDoc depends on a common number that will be incremented for all duplicates, while GFM's number is only local to each duplicate:
|
227
223
|
|
228
|
-
```
|
229
|
-
al = YardGhurt::AnchorLinks.new
|
224
|
+
```ruby
|
225
|
+
al = YardGhurt::AnchorLinks.new
|
230
226
|
name = 'This is a test!'
|
231
227
|
|
232
|
-
puts al.to_yard_anchor_id(name)
|
233
|
-
puts al.to_yard_anchor_id(name)
|
228
|
+
puts al.to_yard_anchor_id(name) #=> This_is_a_test_
|
229
|
+
puts al.to_yard_anchor_id(name) #=> This_is_a_test_
|
234
230
|
|
235
|
-
puts al.to_github_anchor_id(name)
|
236
|
-
puts al.to_github_anchor_id(name)
|
231
|
+
puts al.to_github_anchor_id(name) #=> this-is-a-test
|
232
|
+
puts al.to_github_anchor_id(name) #=> this-is-a-test
|
237
233
|
|
238
|
-
al << name # Officially add it to the database
|
234
|
+
al << name # Officially add it to the database.
|
239
235
|
|
240
|
-
# Instead of being 0 & 0, will be 0 & 1 (incremented),
|
241
|
-
# even without being added to the database
|
242
|
-
puts al.to_yard_anchor_id(name)
|
243
|
-
puts al.to_yard_anchor_id(name)
|
236
|
+
# Instead of being 0 & 0, it will be 0 & 1 (incremented),
|
237
|
+
# even without being added to the database.
|
238
|
+
puts al.to_yard_anchor_id(name) #=> This_is_a_test_0
|
239
|
+
puts al.to_yard_anchor_id(name) #=> This_is_a_test_1
|
244
240
|
|
245
|
-
puts al.to_github_anchor_id(name)
|
246
|
-
puts al.to_github_anchor_id(name)
|
241
|
+
puts al.to_github_anchor_id(name) #=> this-is-a-test-1
|
242
|
+
puts al.to_github_anchor_id(name) #=> this-is-a-test-1
|
247
243
|
|
248
244
|
name = 'This is another test!'
|
249
|
-
al << name # Officially add it to the database
|
245
|
+
al << name # Officially add it to the database.
|
250
246
|
|
251
|
-
# Instead of being 0 & 1, will be 2 & 3 (global increment),
|
252
|
-
# even without being added to the database
|
253
|
-
puts al.to_yard_anchor_id(name)
|
254
|
-
puts al.to_yard_anchor_id(name)
|
247
|
+
# Instead of being 0 & 1, it will be 2 & 3 (global increment),
|
248
|
+
# even without being added to the database.
|
249
|
+
puts al.to_yard_anchor_id(name) #=> This_is_another_test_2
|
250
|
+
puts al.to_yard_anchor_id(name) #=> This_is_another_test_3
|
255
251
|
|
256
|
-
puts al.to_github_anchor_id(name)
|
257
|
-
puts al.to_github_anchor_id(name)
|
252
|
+
puts al.to_github_anchor_id(name) #=> this-is-another-test-1
|
253
|
+
puts al.to_github_anchor_id(name) #=> this-is-another-test-1
|
258
254
|
```
|
259
255
|
|
260
|
-
## [
|
256
|
+
## [//](#-contents) CLI App
|
257
|
+
|
261
258
|
A CLI app has been added for convenience for when writing your own README.
|
262
259
|
|
263
260
|
On the command line:
|
264
|
-
|
261
|
+
|
262
|
+
```bash
|
265
263
|
$ yard_ghurt -g "What's this ID?"
|
266
264
|
# => whats-this-id
|
267
265
|
|
@@ -274,6 +272,7 @@ $ yard_ghurt -a "What's this ID?"
|
|
274
272
|
```
|
275
273
|
|
276
274
|
Help:
|
275
|
+
|
277
276
|
```
|
278
277
|
Usage: yard_ghurt [options]
|
279
278
|
-a, --anchor <string> Print GitHub & YARDoc anchor link IDs of <string>
|
@@ -284,24 +283,28 @@ Usage: yard_ghurt [options]
|
|
284
283
|
-v, --version Print the version
|
285
284
|
```
|
286
285
|
|
287
|
-
## [
|
286
|
+
## [//](#-contents) Hacking
|
288
287
|
|
289
|
-
```
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
288
|
+
```bash
|
289
|
+
git clone 'https://github.com/esotericpig/yard_ghurt.git'
|
290
|
+
cd yard_ghurt
|
291
|
+
bundle install
|
292
|
+
bundle exec rake -T
|
294
293
|
```
|
295
294
|
|
296
|
-
### [
|
295
|
+
### [//](#-contents) Testing
|
297
296
|
|
298
297
|
First, execute this:
|
299
298
|
|
300
|
-
|
299
|
+
```bash
|
300
|
+
bundle exec rake clobber yard yard_gfm_fix[true]
|
301
|
+
```
|
301
302
|
|
302
303
|
Then execute this and make sure there are no warnings and no changes:
|
303
304
|
|
304
|
-
|
305
|
+
```bash
|
306
|
+
bundle exec rake yard_gfm_fix[true]
|
307
|
+
```
|
305
308
|
|
306
309
|
It should output this:
|
307
310
|
|
@@ -312,13 +315,15 @@ It should output this:
|
|
312
315
|
= Nothing written (up-to-date)
|
313
316
|
```
|
314
317
|
|
315
|
-
Then open up
|
318
|
+
Then open up [doc/index.html](doc/index.html) and check all the [anchor links](#-tests), [local file links](#-license), etc.
|
316
319
|
|
317
320
|
Lastly, the 2 files should be almost identical, except for 1 line:
|
318
321
|
|
319
|
-
|
322
|
+
```bash
|
323
|
+
diff doc/index.html doc/file.README.html
|
324
|
+
```
|
320
325
|
|
321
|
-
## [
|
326
|
+
## [//](#-contents) Tests
|
322
327
|
|
323
328
|
These are actual tests for this gem.
|
324
329
|
|
@@ -334,17 +339,17 @@ These are actual tests for this gem.
|
|
334
339
|
- [中文?](#中文)
|
335
340
|
- [汉语?](#汉语)
|
336
341
|
|
337
|
-
### [This is Test #1](
|
338
|
-
### [This-is-Test-#2](
|
339
|
-
### [This_is_Test_#3](
|
340
|
-
### ["This is Test #4"](
|
341
|
-
### ["This is Test #4"](
|
342
|
-
### [this is test #5](
|
343
|
-
### [THIS IS TEST #6](
|
344
|
-
### [日本語?](
|
345
|
-
### [テスト?](
|
346
|
-
### [中文?](
|
347
|
-
### [汉语?](
|
342
|
+
### [This is Test #1](#-tests)
|
343
|
+
### [This-is-Test-#2](#-tests)
|
344
|
+
### [This_is_Test_#3](#-tests)
|
345
|
+
### ["This is Test #4"](#-tests)
|
346
|
+
### ["This is Test #4"](#-tests)
|
347
|
+
### [this is test #5](#-tests)
|
348
|
+
### [THIS IS TEST #6](#-tests)
|
349
|
+
### [日本語?](#-tests)
|
350
|
+
### [テスト?](#-tests)
|
351
|
+
### [中文?](#-tests)
|
352
|
+
### [汉语?](#-tests)
|
348
353
|
|
349
354
|
```
|
350
355
|
Newline
|
@@ -360,12 +365,12 @@ Newline
|
|
360
365
|
Newline
|
361
366
|
```
|
362
367
|
|
363
|
-
## [
|
368
|
+
## [//](#-contents) License
|
364
369
|
|
365
370
|
[GNU LGPL v3+](LICENSE.txt)
|
366
371
|
|
367
372
|
> YardGhurt (<https://github.com/esotericpig/yard_ghurt>)
|
368
|
-
> Copyright (c) 2019-
|
373
|
+
> Copyright (c) 2019-2025 Bradley Whited
|
369
374
|
>
|
370
375
|
> YardGhurt is free software: you can redistribute it and/or modify
|
371
376
|
> it under the terms of the GNU Lesser General Public License as published by
|
data/Rakefile
CHANGED
@@ -1,50 +1,40 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
4
|
require 'bundler/gem_tasks'
|
6
5
|
|
7
6
|
require 'rake/clean'
|
8
|
-
|
9
7
|
require 'yard'
|
10
8
|
require 'yard_ghurt'
|
11
9
|
|
10
|
+
task default: %i[doc]
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
CLEAN.exclude('.git/','stock/')
|
12
|
+
CLEAN.exclude('.git/','.github/','.idea/','stock/')
|
16
13
|
CLOBBER.include('doc/')
|
17
14
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
15
|
+
# TEST: To test using different Gem versions:
|
16
|
+
# GST=1 bundle update && bundle exec rake doc
|
17
|
+
desc 'Generate doc'
|
18
|
+
task doc: %i[yard yard_gfm_fix]
|
23
19
|
|
24
20
|
YARD::Rake::YardocTask.new do |task|
|
25
|
-
task.files = [
|
26
|
-
|
27
|
-
task.options += ['--files','CHANGELOG.md,LICENSE.txt,TODO.md']
|
28
|
-
task.options += ['--readme','README.md']
|
29
|
-
|
30
|
-
task.options << '--protected' # Show protected methods
|
31
|
-
task.options += ['--template-path',File.join('yard','templates')]
|
32
|
-
task.options += ['--title',"YardGhurt v#{YardGhurt::VERSION} Doc"]
|
21
|
+
task.files = ['lib/**/*.rb']
|
22
|
+
task.options.push('--title',"YardGhurt v#{YardGhurt::VERSION}")
|
33
23
|
end
|
34
24
|
|
35
25
|
YardGhurt::GFMFixTask.new do |task|
|
36
|
-
task.arg_names = %i[
|
26
|
+
task.arg_names = %i[dev]
|
37
27
|
task.dry_run = false
|
38
28
|
task.fix_code_langs = true
|
39
29
|
|
40
|
-
task.before = proc do |
|
41
|
-
# Do not delete
|
30
|
+
task.before = proc do |task2,args|
|
31
|
+
# NOTE: Do not delete `file.README.html`, as we need it for testing.
|
42
32
|
|
43
|
-
# Root dir of my GitHub Page for CSS/JS
|
33
|
+
# Root dir of my GitHub Page for CSS/JS.
|
44
34
|
ghp_root_dir = YardGhurt.to_bool(args.dev) ? '../../esotericpig.github.io' : '../../..'
|
45
35
|
|
46
|
-
|
47
|
-
|
36
|
+
task2.css_styles << %(<link rel="stylesheet" type="text/css" href="#{ghp_root_dir}/css/prism.css" />)
|
37
|
+
task2.js_scripts << %(<script src="#{ghp_root_dir}/js/prism.js"></script>)
|
48
38
|
end
|
49
39
|
end
|
50
40
|
|
data/bin/yard_ghurt
CHANGED
@@ -4,15 +4,13 @@
|
|
4
4
|
|
5
5
|
#--
|
6
6
|
# This file is part of YardGhurt.
|
7
|
-
# Copyright (c) 2020
|
7
|
+
# Copyright (c) 2020 Bradley Whited
|
8
8
|
#
|
9
9
|
# SPDX-License-Identifier: LGPL-3.0-or-later
|
10
10
|
#++
|
11
11
|
|
12
|
-
|
13
12
|
require 'yard_ghurt'
|
14
13
|
|
15
|
-
|
16
14
|
# @since 1.2.0
|
17
15
|
yg = YardGhurt::App.new
|
18
16
|
yg.run
|