yard-fence 0.6.0 → 0.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dedaaa231c20409b1d4aedb72ac7b12c0716076eedea5375ed2a232999b2ea7b
4
- data.tar.gz: f6b65e208d3fc7c9a0b19939949309e6020ad1808cb5378372ac0a6ef2511715
3
+ metadata.gz: efcf6aabcf9abcf8dcf8e1878511c03251163a4badfd5b3bb70f14945586a60a
4
+ data.tar.gz: 3f2b3b47d984092fc321a8f20b93a0c61fb2df7a8693f00c1e321ddfd1378625
5
5
  SHA512:
6
- metadata.gz: a5f0e3c15d75462209e1a717b762b137256aab58dfc44527008cf159458ed50fa47450ddb8355f0f2b006db3cff4f18ba9258ffc6f5542177c5921a2a2d42292
7
- data.tar.gz: 81f406fdc8c3e399fa730ec7ab3790fa62981a96a02852abaaa8c0edca52cc8070cef89933407e142bc1e741a3f1e46cd933c369ade528cbf2f593c188d02b52
6
+ metadata.gz: e11299ec5ad361db6eeac761c165c4e46ec0d70b7fb176476a4a2a8236323a9dfe7df81a1bd3ea5ec94db3476caa24eb40f608bc19c76262c3eab25b52af1112
7
+ data.tar.gz: e0e1020769588c7f576b0c6d34e0effe4042803407b5ea5dd215fca1037ec114fe029ee8684608517011c8dfea5ce956f27c4288e3c03b757dbc85356eff23c6
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,33 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [0.8.0] - 2025-11-08
34
+
35
+ - TAG: [v0.8.0][0.8.0t]
36
+ - COVERAGE: 100.00% -- 121/121 lines in 4 files
37
+ - BRANCH COVERAGE: 100.00% -- 36/36 branches in 4 files
38
+ - 37.93% documented
39
+
40
+ ### Added
41
+
42
+ - Allow disabling of yard-fence via YARD_FENCE_DISABLE=true (default false)
43
+
44
+ ### Fixed
45
+
46
+ - Usage instructions in README.md
47
+ - Include `--markup-provider kramdown`
48
+
49
+ ## [0.7.0] - 2025-11-08
50
+
51
+ - TAG: [v0.7.0][0.7.0t]
52
+ - COVERAGE: 99.19% -- 123/124 lines in 4 files
53
+ - BRANCH COVERAGE: 90.00% -- 36/40 branches in 4 files
54
+ - 37.93% documented
55
+
56
+ ### Changed
57
+
58
+ - Actually use custom KramdownGFM
59
+
33
60
  ## [0.6.0] - 2025-11-07
34
61
 
35
62
  - TAG: [v0.6.0][0.6.0t]
@@ -105,7 +132,11 @@ Please file a bug if you notice a violation of semantic versioning.
105
132
 
106
133
  - Initial release
107
134
 
108
- [Unreleased]: https://github.com/galtzo-floss/yard-fence/compare/v0.6.0...HEAD
135
+ [Unreleased]: https://github.com/galtzo-floss/yard-fence/compare/v0.8.0...HEAD
136
+ [0.8.0]: https://github.com/galtzo-floss/yard-fence/compare/v0.7.0...v0.8.0
137
+ [0.8.0t]: https://github.com/galtzo-floss/yard-fence/releases/tag/v0.8.0
138
+ [0.7.0]: https://github.com/galtzo-floss/yard-fence/compare/v0.6.0...v0.7.0
139
+ [0.7.0t]: https://github.com/galtzo-floss/yard-fence/releases/tag/v0.7.0
109
140
  [0.6.0]: https://github.com/galtzo-floss/yard-fence/compare/v0.5.0...v0.6.0
110
141
  [0.6.0t]: https://github.com/galtzo-floss/yard-fence/releases/tag/v0.6.0
111
142
  [0.5.0]: https://github.com/galtzo-floss/yard-fence/compare/v0.4.0...v0.5.0
data/README.md CHANGED
@@ -63,7 +63,9 @@ Create a `.yardopts` file like this:
63
63
  --plugin fence
64
64
  -e yard/fence/hoist.rb
65
65
  --readme tmp/yard-fence/README.md
66
+ --charset utf-8
66
67
  --markup markdown
68
+ --markup-provider kramdown
67
69
  --output docs
68
70
  'lib/**/*.rb'
69
71
  -
@@ -205,7 +207,9 @@ Recommended .yardopts (noise‑free):
205
207
  --plugin fence
206
208
  -e yard/fence/hoist.rb
207
209
  --readme tmp/yard-fence/README.md
210
+ --charset utf-8
208
211
  --markup markdown
212
+ --markup-provider kramdown
209
213
  --output docs
210
214
  'lib/**/*.rb'
211
215
  -
@@ -226,6 +230,10 @@ yard doc \
226
230
  --plugin fence \
227
231
  -e yard/fence/hoist.rb \
228
232
  --readme tmp/yard-fence/README.md \
233
+ --charset utf-8 \
234
+ --markup markdown \
235
+ --markup-provider kramdown \
236
+ --output docs \
229
237
  lib/**/*.rb - tmp/yard-fence/*.md tmp/yard-fence/*.txt
230
238
  ```
231
239
 
@@ -586,7 +594,7 @@ Thanks for RTFM. ☺️
586
594
  [📌gitmoji]: https://gitmoji.dev
587
595
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
588
596
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
589
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.119-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
597
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.121-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
590
598
  [🔐security]: SECURITY.md
591
599
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
592
600
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -1,9 +1,21 @@
1
- if defined?(Yard::Fence) && Yard::Fence.respond_to?(:use_kramdown_gfm!)
2
- if Yard::Fence.use_kramdown_gfm!
3
- puts "[yard/fence/hoist] Kramdown GFM provider registered"
1
+ if ENV.fetch("YARD_FENCE_DISABLE", "false").casecmp?("true")
2
+ warn("[yard/fence/hoist] Hoist disabled via YARD_FENCE_DISABLE")
3
+ else
4
+ unless defined?(KramdownGfmDocument)
5
+ # Ensure YARD can resolve the provider constant at the top-level
6
+ # YARD does something akin to Object.const_get("::" + const), so it expects
7
+ # a top-level ::KramdownGfmDocument when const == "KramdownGfmDocument".
8
+ # Provide an alias to our namespaced implementation.
9
+ KramdownGfmDocument = Yard::Fence::KramdownGfmDocument
10
+ puts "[yard/fence/hoist] KramdownGfmDocument hoisted to top-level"
11
+ end
12
+ if defined?(Yard::Fence) && Yard::Fence.respond_to?(:use_kramdown_gfm!)
13
+ if Yard::Fence.use_kramdown_gfm!
14
+ puts "[yard/fence/hoist] Kramdown GFM provider registered"
15
+ else
16
+ warn "[yard/fence/hoist] Kramdown GFM provider registration failed"
17
+ end
4
18
  else
5
- warn "[yard/fence/hoist] Kramdown GFM provider registration failed"
19
+ warn("[yard/fence/hoist] Yard::Fence.use_kramdown_gfm! not available; skipping")
6
20
  end
7
- else
8
- warn("[yard/fence/hoist] Yard::Fence.use_kramdown_gfm! not available; skipping")
9
21
  end
@@ -3,7 +3,7 @@
3
3
  module Yard
4
4
  module Fence
5
5
  module Version
6
- VERSION = "0.6.0"
6
+ VERSION = "0.8.0"
7
7
  end
8
8
  VERSION = Version::VERSION
9
9
  end
data/lib/yard/fence.rb CHANGED
@@ -167,10 +167,16 @@ module Yard
167
167
  end
168
168
 
169
169
  def postprocess_html_docs
170
- docs = File.join(Dir.pwd, "docs")
171
- return unless Dir.exist?(docs)
172
- Dir.glob(File.join(docs, "**", "*.html")).each do |html|
173
- restore_ascii_braces_in_html_file(html)
170
+ if ENV.fetch("YARD_FENCE_DISABLE", "false").casecmp?("true")
171
+ # :nocov:
172
+ warn("[yard/fence] postprocess_html_docs disabled via YARD_FENCE_DISABLE")
173
+ # :nocov:
174
+ else
175
+ docs = File.join(Dir.pwd, "docs")
176
+ return unless Dir.exist?(docs)
177
+ Dir.glob(File.join(docs, "**", "*.html")).each do |html|
178
+ restore_ascii_braces_in_html_file(html)
179
+ end
174
180
  end
175
181
  rescue => e
176
182
  warn("Yard::Fence.postprocess_html_docs failed: #{e.class}: #{e.message}")
@@ -203,7 +209,13 @@ module Yard
203
209
  end
204
210
 
205
211
  def at_load_hook
206
- Yard::Fence.prepare_tmp_files
212
+ if ENV.fetch("YARD_FENCE_DISABLE", "false").casecmp?("true")
213
+ # :nocov:
214
+ warn("[yard/fence] at_load_hook disabled via YARD_FENCE_DISABLE")
215
+ # :nocov:
216
+ else
217
+ Yard::Fence.prepare_tmp_files
218
+ end
207
219
  rescue => e
208
220
  warn("Yard::Fence: failed to prepare tmp/yard-fence files: #{e.class}: #{e.message}")
209
221
  end
data/sig/yard/fence.rbs CHANGED
@@ -48,7 +48,22 @@ module Yard
48
48
  end
49
49
 
50
50
  class KramdownGfmDocument < ::Kramdown::Document
51
+ # From implementation: stores original source and forces GFM input by default
52
+ UNRENDERED_FENCE_PARAGRAPH: ::Regexp
53
+ DETAILS_MARKDOWN_1: ::Regexp
54
+
51
55
  def initialize: (String source, ?Hash[Symbol, untyped] options) -> void
56
+
57
+ # Public API
58
+ def to_html: () -> String
59
+
60
+ private
61
+
62
+ def needs_fallback?: (String html) -> bool
63
+ def fallback_improved?: (String fb_html) -> bool
52
64
  end
53
65
  end
54
66
  end
67
+
68
+ # Top-level alias used by YARD's constant resolution (see ruby implementation)
69
+ KramdownGfmDocument: Yard::Fence::KramdownGfmDocument
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard-fence
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -316,10 +316,10 @@ licenses:
316
316
  - MIT
317
317
  metadata:
318
318
  homepage_uri: https://yard-fence.galtzo.com/
319
- source_code_uri: https://github.com/galtzo-floss/yard-fence/tree/v0.6.0
320
- changelog_uri: https://github.com/galtzo-floss/yard-fence/blob/v0.6.0/CHANGELOG.md
319
+ source_code_uri: https://github.com/galtzo-floss/yard-fence/tree/v0.8.0
320
+ changelog_uri: https://github.com/galtzo-floss/yard-fence/blob/v0.8.0/CHANGELOG.md
321
321
  bug_tracker_uri: https://github.com/galtzo-floss/yard-fence/issues
322
- documentation_uri: https://www.rubydoc.info/gems/yard-fence/0.6.0
322
+ documentation_uri: https://www.rubydoc.info/gems/yard-fence/0.8.0
323
323
  funding_uri: https://github.com/sponsors/pboling
324
324
  wiki_uri: https://github.com/galtzo-floss/yard-fence/wiki
325
325
  news_uri: https://www.railsbling.com/tags/yard-fence
metadata.gz.sig CHANGED
Binary file