yard-fence 0.9.1 → 0.9.3

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: ab3ca14a888fee4e99027bbc6829dadd0d0cd566b177ff224859989ab88314cb
4
- data.tar.gz: 97cdc3cb1142a08e97b810984670625b774748b90540fefc0c7dc6cf2a0454ea
3
+ metadata.gz: b55af6318c510f7abe9263bef064826f4276cf9d69eb0a586dadca6ab06e94fc
4
+ data.tar.gz: 66044987daef5a56c3792549a2974a044699cb4be3842fefa56209e16f2108a8
5
5
  SHA512:
6
- metadata.gz: 97dbc45ee58bdf782f39e55d89061dea5a5bdb8c8ba352abfa1c229329ac142dc05fb2c1ed640af1e4311358783945490f79008c4c5e4bc15e4179eee78864b6
7
- data.tar.gz: fbb5fdffb91d7097977467ea8d6d622c3cca6a7c8113016bd3b2d7cbe9f3d312209e960217fa87b13674b621f905af383e72cf4cb42103543742b09a1dd6b411
6
+ metadata.gz: bea524b8199a91e9e0b9b46d2f76b21ed3a5e73b20c829315ff5291662341c21c737738d91880d11570eb4fb785a6793b43d946cc79929814ceff2824f40af93
7
+ data.tar.gz: e8a7f374e8ee93b621fe89399891d99f3e03ae81481c8c504c120b0e2ab5d739650fa8f6ed55a1afcaa45e8c5d5606d393240fc5d8992c514fb4e27dfbaf5130
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,28 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [0.9.3] - 2026-06-09
34
+
35
+ - TAG: [v0.9.3][0.9.3t]
36
+ - COVERAGE: 95.65% -- 198/207 lines in 5 files
37
+ - BRANCH COVERAGE: 83.33% -- 55/66 branches in 5 files
38
+ - 38.30% documented
39
+
40
+ ### Fixed
41
+
42
+ - Narrowed `YARD_FENCE_CLEAN_DOCS=true` cleanup to generated YARD HTML/CSS/JS artifacts so checked-in site metadata such as `docs/CNAME` is preserved.
43
+
44
+ ## [0.9.2] - 2026-06-03
45
+
46
+ - TAG: [v0.9.2][0.9.2t]
47
+ - COVERAGE: 95.57% -- 194/203 lines in 5 files
48
+ - BRANCH COVERAGE: 82.81% -- 53/64 branches in 5 files
49
+ - 39.13% documented
50
+
51
+ ### Fixed
52
+
53
+ - Prevented YARD from treating pipe-delimited token examples such as `{KJ|GEM_NAME}` and rendered example-table fragments as unresolved documentation links.
54
+
33
55
  ## [0.9.1] - 2026-05-24
34
56
 
35
57
  - TAG: [v0.9.1][0.9.1t]
@@ -223,7 +245,11 @@ Please file a bug if you notice a violation of semantic versioning.
223
245
 
224
246
  - Initial release
225
247
 
226
- [Unreleased]: https://github.com/galtzo-floss/yard-fence/compare/v0.9.1...HEAD
248
+ [Unreleased]: https://github.com/galtzo-floss/yard-fence/compare/v0.9.3...HEAD
249
+ [0.9.3]: https://github.com/galtzo-floss/yard-fence/compare/v0.9.2...v0.9.3
250
+ [0.9.3t]: https://github.com/galtzo-floss/yard-fence/releases/tag/v0.9.3
251
+ [0.9.2]: https://github.com/galtzo-floss/yard-fence/compare/v0.9.1...v0.9.2
252
+ [0.9.2t]: https://github.com/galtzo-floss/yard-fence/releases/tag/v0.9.2
227
253
  [0.9.1]: https://github.com/galtzo-floss/yard-fence/compare/v0.9.0...v0.9.1
228
254
  [0.9.1t]: https://github.com/galtzo-floss/yard-fence/releases/tag/v0.9.1
229
255
  [0.9.0]: https://github.com/galtzo-floss/yard-fence/compare/v0.8.2...v0.9.0
data/CONTRIBUTING.md CHANGED
@@ -50,6 +50,22 @@ There are many Rake tasks available as well. You can see them by running:
50
50
  bin/rake -T
51
51
  ```
52
52
 
53
+ ## Code quality checks
54
+
55
+ Run the Reek task when you want a smell check that fails on current findings:
56
+
57
+ ```shell
58
+ bin/rake reek
59
+ ```
60
+
61
+ Refresh the checked-in `REEK` backlog through the rake task, not by redirecting
62
+ the raw `reek` executable output. The rake task uses the project bundle and
63
+ avoids stale generated binstubs shadowing the Reek gem executable:
64
+
65
+ ```shell
66
+ bin/rake reek:update
67
+ ```
68
+
53
69
  ## Environment Variables for Local Development
54
70
 
55
71
  Below are the primary environment variables recognized by stone_checksums (and its integrated tools). Unless otherwise noted, set boolean values to the string "true" to enable.
@@ -86,11 +102,32 @@ Git hooks and commit message helpers (exe/kettle-commit-msg)
86
102
  - GIT_HOOK_FOOTER_SENTINEL: Required when footer append is enabled — a unique first-line sentinel to prevent duplicates
87
103
  - GIT_HOOK_FOOTER_APPEND_DEBUG: Extra debug output in the footer template (true/false)
88
104
 
105
+ Git diff driver setup
106
+ - Local setup writes repository `.gitattributes` entries and local Git `diff.smorg-*` command config so this checkout uses StructuredMerge semantic diffs.
107
+ - Global setup registers `diff.smorg-*` commands once in the user Git config; use it when you work across several StructuredMerge-enabled repositories.
108
+ - Include-file setup writes `.git/smorg/config` and includes it from local Git config, keeping command registrations out of the repository files.
109
+ - Git hosting forges generally ignore external diff drivers, so pull request views may still show raw textual diffs even when local `git diff` uses semantic drivers.
110
+
111
+ ```console
112
+ K_JEM_TEMPLATING=true bundle exec kettle-jem install
113
+ ```
114
+
115
+ Troubleshooting Git diffs
116
+ - Use `git diff --no-ext-diff` to compare against Git's built-in diff output.
117
+ - Use `git diff --no-textconv` when a textconv projection obscures the raw file bytes you need to inspect.
118
+ - If Git reports a missing `smorg-*` executable, rerun `bundle install` and the setup command above, then check `git config --local --get-regexp '^diff\.smorg-'`.
119
+ - To remove managed local entries, run `K_JEM_TEMPLATING=true bundle exec kettle-jem install --undo`; remove global command registrations with `git config --global --unset-all diff.smorg-ruby.command`.
120
+
89
121
  For a quick starting point, this repository’s `mise.toml` defines the shared defaults, and `.env.local` can override them locally. Copy `.env.local.example` to `.env.local`, use `KEY=value` lines, and either activate `mise` in your shell or run commands through `mise exec -C /path/to/project -- ...`.
90
122
 
91
123
  ## Appraisals
92
124
 
93
125
  From time to time the [appraisal2][🚎appraisal2] gemfiles in `gemfiles/` will need to be updated.
126
+ Generated appraisal and CI workflow floors are controlled by `ruby.test_minimum`
127
+ in `.structuredmerge/kettle-jem.yml`; this project was templated with `ruby.test_minimum: 3.2.0`.
128
+ That value describes the lowest Ruby version expected to run the test/development
129
+ toolchain, and it may be higher than the gemspec runtime floor.
130
+
94
131
  They are created and updated with the commands:
95
132
 
96
133
  ```console
data/LICENSE.md CHANGED
@@ -7,4 +7,4 @@ Choose the option that best fits your use case:
7
7
 
8
8
  ## Copyright Notice
9
9
 
10
- Copyright (c) 2025-2026 Peter H. Boling
10
+ - Copyright (c) 2025-2026 Peter H. Boling
data/README.md CHANGED
@@ -1,17 +1,10 @@
1
- [![Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0][🖼️galtzo-floss-i]][🖼️galtzo-floss] [![ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5][🖼️ruby-lang-i]][🖼️ruby-lang] [![yard-fence Logo by Aboling0, CC BY-SA 4.0][🖼️galtzo-floss-yard-fence-i]][🖼️galtzo-floss-yard-fence]
2
-
3
- [🖼️galtzo-floss-i]: https://logos.galtzo.com/assets/images/galtzo-floss/avatar-192px.svg
4
- [🖼️galtzo-floss]: https://discord.gg/3qme4XHNKN
5
- [🖼️ruby-lang-i]: https://logos.galtzo.com/assets/images/ruby-lang/avatar-192px.svg
6
- [🖼️ruby-lang]: https://www.ruby-lang.org/
7
- [🖼️galtzo-floss-yard-fence-i]: https://logos.galtzo.com/assets/images/galtzo-floss/yard-fence/avatar-192px.svg
8
- [🖼️galtzo-floss-yard-fence]: https://github.com/galtzo-floss/yard-fence
1
+ <a href="https://github.com/galtzo-floss"><img alt="galtzo-floss Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/galtzo-floss/avatar-128px.svg" width="12%" align="right"/></a> <a href="https://github.com/galtzo-floss/yard-fence"><img alt="yard-fence Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/galtzo-floss/yard-fence/avatar-128px.svg" width="12%" align="right"/></a>
9
2
 
10
3
  # 🍲 Yard::Fence
11
4
 
12
- [![Version][👽versioni]][👽version] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: MIT][📄license-img]][📄license] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![CodeCov Test Coverage][🏀codecovi]][🏀codecov] [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls] [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov] [![QLTY Maintainability][🏀qlty-mnti]][🏀qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![CodeQL][🖐codeQL-img]][🖐codeQL] [![Apache SkyWalking Eyes License Compatibility Check][🚎15-🪪-wfi]][🚎15-🪪-wf]
5
+ [![Version][👽versioni]][👽version] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: MIT][📄license-img]][📄license] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![CodeCov Test Coverage][🏀codecovi]][🏀codecov] [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls] [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov] [![QLTY Maintainability][🏀qlty-mnti]][🏀qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![Apache SkyWalking Eyes License Compatibility Check][🚎15-🪪-wfi]][🚎15-🪪-wf]
13
6
 
14
- `if ci_badges.map(&:color).detect { it != "green"}` ☝️ [let me know][🖼️galtzo-floss], as I may have missed the [discord notification][🖼️galtzo-floss].
7
+ `if ci_badges.map(&:color).detect { it != "green"}` ☝️ [let me know][✉️discord-invite], as I may have missed the [discord notification][✉️discord-invite].
15
8
 
16
9
  ---
17
10
 
@@ -26,7 +19,7 @@ I've summarized my thoughts in [this blog post](https://dev.to/galtzo/hostile-ta
26
19
 
27
20
  </details>
28
21
 
29
- ## 🌻 Synopsis
22
+ ## 🌻 Synopsis <a href="https://discord.gg/3qme4XHNKN"><img alt="Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/galtzo-floss/avatar-128px.svg" width="8%" align="right"/></a> <a href="https://ruby-toolbox.com"><img alt="ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5" src="https://logos.galtzo.com/assets/images/ruby-lang/avatar-128px.svg" width="8%" align="right"/></a>
30
23
 
31
24
  A brace converter for the markdown fences in your YARD docs to prevent the `InvalidLink` warning.
32
25
 
@@ -75,13 +68,15 @@ See the configuration and usage sections for more details.
75
68
  ### Compatibility
76
69
 
77
70
  Compatible with MRI Ruby 3.2.0+, and concordant releases of JRuby, and TruffleRuby.
71
+ CI workflows and Appraisals are generated for MRI Ruby 3.2.0+.
72
+ This test floor is configured by `ruby.test_minimum` in `.kettle-jem.yml` and
73
+ may be higher than the gem's runtime compatibility floor when legacy Rubies are
74
+ not practical for the current toolchain.
78
75
 
79
76
  | 🚚 _Amazing_ test matrix was brought to you by | 🔎 appraisal2 🔎 and the color 💚 green 💚 |
80
77
  |------------------------------------------------|--------------------------------------------------------|
81
78
  | 👟 Check it out! | ✨ [github.com/appraisal-rb/appraisal2][💎appraisal2] ✨ |
82
79
 
83
-
84
-
85
80
  ### Federated DVCS
86
81
 
87
82
  <details markdown="1">
@@ -382,6 +377,8 @@ To say "thanks!" ☝️ Join the Discord or 👇️ send money.
382
377
 
383
378
  ### Please give the project a star ⭐ ♥.
384
379
 
380
+ Many parts of this project are actively managed by a [kettle-jem](https://github.com/structuredmerge/structuredmerge-ruby/tree/main/gems/kettle-jem) smart template utilizing [StructuredMerge.org](https://structuredmerge.org) merge contracts.
381
+
385
382
  Thanks for RTFM. ☺️
386
383
 
387
384
  [⛳liberapay-img]: https://img.shields.io/liberapay/goal/pboling.svg?logo=liberapay&color=a51611&style=flat
@@ -484,8 +481,6 @@ Thanks for RTFM. ☺️
484
481
  [🏀codecovi]: https://codecov.io/gh/galtzo-floss/yard-fence/graph/badge.svg
485
482
  [🏀coveralls]: https://coveralls.io/github/galtzo-floss/yard-fence?branch=main
486
483
  [🏀coveralls-img]: https://coveralls.io/repos/github/galtzo-floss/yard-fence/badge.svg?branch=main
487
- [🖐codeQL]: https://github.com/galtzo-floss/yard-fence/security/code-scanning
488
- [🖐codeQL-img]: https://github.com/galtzo-floss/yard-fence/actions/workflows/codeql-analysis.yml/badge.svg
489
484
  [🚎ruby-3.2-wf]: https://github.com/galtzo-floss/yard-fence/actions/workflows/ruby-3.2.yml
490
485
  [🚎ruby-3.3-wf]: https://github.com/galtzo-floss/yard-fence/actions/workflows/ruby-3.3.yml
491
486
  [🚎ruby-3.4-wf]: https://github.com/galtzo-floss/yard-fence/actions/workflows/ruby-3.4.yml
@@ -530,7 +525,7 @@ Thanks for RTFM. ☺️
530
525
  [🤝cb-pulls]: https://codeberg.org/galtzo-floss/yard-fence/pulls
531
526
  [🤝cb-donate]: https://donate.codeberg.org/
532
527
  [🤝contributing]: https://github.com/galtzo-floss/yard-fence/blob/main/CONTRIBUTING.md
533
- [🏀codecov-g]: https://codecov.io/gh/galtzo-floss/yard-fence/graphs/tree.svg
528
+ [🏀codecov-g]: https://codecov.io/gh/galtzo-floss/yard-fence/graph/badge.svg
534
529
  [🖐contrib-rocks]: https://contrib.rocks
535
530
  [🖐contributors]: https://github.com/galtzo-floss/yard-fence/graphs/contributors
536
531
  [🖐contributors-img]: https://contrib.rocks/image?repo=galtzo-floss/yard-fence
@@ -548,7 +543,7 @@ Thanks for RTFM. ☺️
548
543
  [📌gitmoji]: https://gitmoji.dev
549
544
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
550
545
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
551
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.175-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
546
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.207-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
552
547
  [🔐security]: https://github.com/galtzo-floss/yard-fence/blob/main/SECURITY.md
553
548
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
554
549
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -556,7 +551,8 @@ Thanks for RTFM. ☺️
556
551
  [📄license-ref]: MIT.md
557
552
  [📄license-img]: https://img.shields.io/badge/License-MIT-259D6C.svg
558
553
  [📄license-compat]: https://www.apache.org/legal/resolved.html#category-a
559
- [📄license-compat-img]: https://img.shields.io/badge/Apache_Compatible:_Category_A-✓-259D6C.svg?style=flat&logo=Apache
554
+ [📄license-compat-img]: https://img.shields.io/badge/Apache_Compatible:_Category_A-%E2%9C%93-259D6C.svg?style=flat&logo=Apache
555
+
560
556
  [📄ilo-declaration]: https://www.ilo.org/declaration/lang--en/index.htm
561
557
  [📄ilo-declaration-img]: https://img.shields.io/badge/ILO_Fundamental_Principles-✓-259D6C.svg?style=flat
562
558
  [🚎yard-current]: http://rubydoc.info/gems/yard-fence
@@ -575,7 +571,7 @@ Thanks for RTFM. ☺️
575
571
  | Package | yard-fence |
576
572
  | Description | 🍲 Convert ASCII braces ('{}') to full-width braces ('{}') within code fences (triple-or-single backticks) during YARD processing, and back to ASCII braces afterward |
577
573
  | Homepage | https://github.com/galtzo-floss/yard-fence |
578
- | Source | https://github.com/galtzo-floss/yard-fence/tree/v0.9.0 |
574
+ | Source | https://github.com/galtzo-floss/yard-fence/tree/v0.9.2 |
579
575
  | License | `MIT` |
580
576
  | Funding | https://github.com/sponsors/pboling, https://issuehunt.io/u/pboling, https://ko-fi.com/pboling, https://liberapay.com/pboling/donate, https://opencollective.com/galtzo-floss, https://patreon.com/galtzo, https://polar.sh/pboling, https://thanks.dev/u/gh/pboling, https://tidelift.com/funding/github/rubygems/yard-fence, https://www.buymeacoffee.com/pboling |
581
577
  <!-- kettle-jem:metadata:end -->
data/SECURITY.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  | Version | Supported |
6
6
  |----------|-----------|
7
- | 1.latest | ✅ |
7
+ | 0.latest | ✅ |
8
8
 
9
9
  ## Security contact information
10
10
 
@@ -18,4 +18,5 @@ else
18
18
  else
19
19
  warn("[yard/fence/hoist] Yard::Fence.use_kramdown_gfm! not available; skipping")
20
20
  end
21
+ Yard::Fence.install_html_helper_patch! if defined?(Yard::Fence) && Yard::Fence.respond_to?(:install_html_helper_patch!)
21
22
  end
@@ -26,7 +26,7 @@ module Yard
26
26
  def initialize(source, options = {})
27
27
  options[:input] = "GFM" unless options.key?(:input)
28
28
  @__yard_fence_source = source # Keep original for potential fallback.
29
- super(source, options)
29
+ super
30
30
  end
31
31
 
32
32
  # Override to_html to provide a smart fallback: if the GFM parse leaves literal
@@ -3,7 +3,7 @@
3
3
  module Yard
4
4
  module Fence
5
5
  module Version
6
- VERSION = "0.9.1"
6
+ VERSION = "0.9.3"
7
7
  end
8
8
  VERSION = Version::VERSION # Traditional Constant Location
9
9
  end
data/lib/yard/fence.rb CHANGED
@@ -73,9 +73,16 @@ module Yard
73
73
  TRIPLE_TICK_FENCE = /^\s*```/
74
74
  INLINE_TICK_FENCE = /`([^`]+)`/
75
75
  DOUBLE_BRACE_PLACEHOLDER_REGEX = /{{([^{}]+)}}/
76
- SINGLE_BRACE_PLACEHOLDER_REGEX = /{([A-Za-z0-9_:\-]+)}/
76
+ SINGLE_BRACE_PLACEHOLDER_REGEX = /{([A-Za-z0-9_:-]+)}/
77
+ BRACED_TOKEN_REFERENCE_REGEX = /{([^{}]*(?:\\?\|)[^{}]*)}/
78
+ BRACED_HTML_FRAGMENT_REGEX = /{([^{}]*<\/?[A-Za-z][^{}]*)}/
77
79
  # Lines that are part of a classic indented code block (CommonMark: 4 spaces)
78
80
  INDENTED_CODE_LINE = /^ {4,}\S/
81
+ GENERATED_DOC_GLOBS = [
82
+ "**/*.html",
83
+ "css/**/*",
84
+ "js/**/*"
85
+ ].freeze
79
86
 
80
87
  class Error < StandardError; end
81
88
  # :nocov:
@@ -131,6 +138,16 @@ module Yard
131
138
  end
132
139
  end
133
140
 
141
+ def sanitize_prose_braces(line)
142
+ ln = sanitize_inline_code(line)
143
+ # IMPORTANT: handle double-brace placeholders first so we don't partially
144
+ # convert the inner {TOKEN} and leave outer ASCII braces from `{{TOKEN}}`.
145
+ ln = ln.gsub(DOUBLE_BRACE_PLACEHOLDER_REGEX) { |m| fullwidth_braces(m) }
146
+ ln = ln.gsub(BRACED_TOKEN_REFERENCE_REGEX) { |m| fullwidth_braces(m) }
147
+ ln = ln.gsub(BRACED_HTML_FRAGMENT_REGEX) { |m| fullwidth_braces(m) }
148
+ ln.gsub(SINGLE_BRACE_PLACEHOLDER_REGEX) { |m| fullwidth_braces(m) }
149
+ end
150
+
134
151
  # Walk the text, toggling a simple in_fence state on ``` lines.
135
152
  # While inside a fence, convert braces to fullwidth; outside, also sanitize inline code
136
153
  # and disarm simple prose placeholders like {issuer} or {{something}}.
@@ -151,9 +168,7 @@ module Yard
151
168
  if line.strip.empty? || !line.match?(INDENTED_CODE_LINE)
152
169
  in_indented_block = false
153
170
  # Process this line as normal prose outside block
154
- ln = sanitize_inline_code(line)
155
- ln = ln.gsub(DOUBLE_BRACE_PLACEHOLDER_REGEX) { |m| fullwidth_braces(m) }
156
- ln.gsub(SINGLE_BRACE_PLACEHOLDER_REGEX) { |m| fullwidth_braces(m) }
171
+ sanitize_prose_braces(line)
157
172
  else
158
173
  fullwidth_braces(line)
159
174
  end
@@ -162,11 +177,7 @@ module Yard
162
177
  in_indented_block = true
163
178
  fullwidth_braces(line)
164
179
  else
165
- ln = sanitize_inline_code(line)
166
- # IMPORTANT: handle double-brace placeholders first so we don't partially
167
- # convert the inner {TOKEN} and leave outer ASCII braces from `{{TOKEN}}`.
168
- ln = ln.gsub(DOUBLE_BRACE_PLACEHOLDER_REGEX) { |m| fullwidth_braces(m) }
169
- ln.gsub(SINGLE_BRACE_PLACEHOLDER_REGEX) { |m| fullwidth_braces(m) }
180
+ sanitize_prose_braces(line)
170
181
  end
171
182
  end.join
172
183
  end
@@ -205,6 +216,10 @@ module Yard
205
216
  File.write(html_filepath, restored)
206
217
  end
207
218
 
219
+ def restore_ascii_braces(text)
220
+ text.tr(FULLWIDTH_BRACES, ASCII_BRACES)
221
+ end
222
+
208
223
  def postprocess_html_docs
209
224
  if ENV.fetch("YARD_FENCE_DISABLE", "false").casecmp?("true")
210
225
  # :nocov:
@@ -247,18 +262,62 @@ module Yard
247
262
  false
248
263
  end
249
264
 
250
- # Clear the docs output directory to remove stale generated files.
265
+ module HtmlHelperPatch
266
+ def resolve_links(text)
267
+ protected_text = ::Yard::Fence.sanitize_prose_braces(text.to_s)
268
+ ::Yard::Fence.restore_ascii_braces(super(protected_text))
269
+ end
270
+ end
271
+
272
+ HTML_HELPER_TEMPLATE_PATCH = proc do |options|
273
+ HtmlHelperPatch if options.format == :html
274
+ end
275
+
276
+ def install_html_helper_patch!
277
+ begin
278
+ require "yard" unless defined?(::YARD::Templates::Template)
279
+ require "yard/templates/helpers/html_helper" unless defined?(::YARD::Templates::Helpers::HtmlHelper)
280
+ rescue LoadError, NameError => e
281
+ warn("Yard::Fence.install_html_helper_patch!: failed to load YARD HTML helper: #{e.class}: #{e.message}")
282
+ return false
283
+ end
284
+
285
+ extra_includes = ::YARD::Templates::Template.extra_includes
286
+ extra_includes << HTML_HELPER_TEMPLATE_PATCH unless extra_includes.include?(HTML_HELPER_TEMPLATE_PATCH)
287
+
288
+ helper = ::YARD::Templates::Helpers::HtmlHelper
289
+ return true if helper.method_defined?(:yard_fence_unprotected_resolve_links)
290
+
291
+ helper.module_eval do
292
+ alias_method(:yard_fence_unprotected_resolve_links, :resolve_links)
293
+
294
+ def resolve_links(text)
295
+ protected_text = ::Yard::Fence.sanitize_prose_braces(text.to_s)
296
+ ::Yard::Fence.restore_ascii_braces(yard_fence_unprotected_resolve_links(protected_text))
297
+ end
298
+ end
299
+ true
300
+ end
301
+
302
+ # Clear generated docs output files to remove stale YARD artifacts.
251
303
  # Only runs when YARD_FENCE_CLEAN_DOCS=true is set.
252
304
  # This ensures that if a markdown file is deleted from the project,
253
- # its corresponding HTML file won't remain in docs/.
305
+ # its corresponding HTML file won't remain in docs/, while preserving
306
+ # site metadata such as docs/CNAME.
254
307
  def clean_docs_directory
255
308
  return unless ENV.fetch("YARD_FENCE_CLEAN_DOCS", "false").casecmp?("true")
256
309
 
257
310
  docs = File.join(Dir.pwd, "docs")
258
311
  return unless Dir.exist?(docs)
259
312
 
260
- FileUtils.rm_rf(docs)
261
- puts "[yard/fence] Cleared docs/ directory (YARD_FENCE_CLEAN_DOCS=true)"
313
+ GENERATED_DOC_GLOBS.each do |pattern|
314
+ Dir.glob(File.join(docs, pattern), File::FNM_DOTMATCH).each do |path|
315
+ next unless File.file?(path)
316
+
317
+ FileUtils.rm_f(path)
318
+ end
319
+ end
320
+ puts "[yard/fence] Cleared generated docs artifacts (YARD_FENCE_CLEAN_DOCS=true)"
262
321
  end
263
322
 
264
323
  # Prepare for YARD documentation generation.
@@ -301,3 +360,4 @@ end
301
360
  # Rake integration is explicit. Call Yard::Fence.install_rake_tasks! from your
302
361
  # Rakefile after defining the :yard task so prepare + postprocess only run for
303
362
  # documentation builds, never for unrelated processes that happen to load YARD.
363
+ Yard::Fence.install_html_helper_patch!
@@ -6,4 +6,3 @@ module Yard
6
6
  VERSION: String
7
7
  end
8
8
  end
9
-
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.9.1
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -66,7 +66,7 @@ dependencies:
66
66
  version: '1.1'
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 1.1.9
69
+ version: 1.1.11
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '1.1'
77
77
  - - ">="
78
78
  - !ruby/object:Gem::Version
79
- version: 1.1.9
79
+ version: 1.1.11
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: yard
82
82
  requirement: !ruby/object:Gem::Requirement
@@ -103,14 +103,20 @@ dependencies:
103
103
  requirements:
104
104
  - - "~>"
105
105
  - !ruby/object:Gem::Version
106
- version: '2.0'
106
+ version: '2.2'
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: 2.2.0
107
110
  type: :development
108
111
  prerelease: false
109
112
  version_requirements: !ruby/object:Gem::Requirement
110
113
  requirements:
111
114
  - - "~>"
112
115
  - !ruby/object:Gem::Version
113
- version: '2.0'
116
+ version: '2.2'
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: 2.2.0
114
120
  - !ruby/object:Gem::Dependency
115
121
  name: bundler-audit
116
122
  requirement: !ruby/object:Gem::Requirement
@@ -165,20 +171,20 @@ dependencies:
165
171
  requirements:
166
172
  - - "~>"
167
173
  - !ruby/object:Gem::Version
168
- version: '3.0'
174
+ version: '3.1'
169
175
  - - ">="
170
176
  - !ruby/object:Gem::Version
171
- version: 3.0.6
177
+ version: 3.1.1
172
178
  type: :development
173
179
  prerelease: false
174
180
  version_requirements: !ruby/object:Gem::Requirement
175
181
  requirements:
176
182
  - - "~>"
177
183
  - !ruby/object:Gem::Version
178
- version: '3.0'
184
+ version: '3.1'
179
185
  - - ">="
180
186
  - !ruby/object:Gem::Version
181
- version: 3.0.6
187
+ version: 3.1.1
182
188
  - !ruby/object:Gem::Dependency
183
189
  name: kettle-test
184
190
  requirement: !ruby/object:Gem::Requirement
@@ -188,7 +194,7 @@ dependencies:
188
194
  version: '2.0'
189
195
  - - ">="
190
196
  - !ruby/object:Gem::Version
191
- version: 2.0.0
197
+ version: 2.0.4
192
198
  type: :development
193
199
  prerelease: false
194
200
  version_requirements: !ruby/object:Gem::Requirement
@@ -198,43 +204,43 @@ dependencies:
198
204
  version: '2.0'
199
205
  - - ">="
200
206
  - !ruby/object:Gem::Version
201
- version: 2.0.0
207
+ version: 2.0.4
202
208
  - !ruby/object:Gem::Dependency
203
- name: ruby-progressbar
209
+ name: turbo_tests2
204
210
  requirement: !ruby/object:Gem::Requirement
205
211
  requirements:
206
212
  - - "~>"
207
213
  - !ruby/object:Gem::Version
208
- version: '1.13'
214
+ version: '3.1'
215
+ - - ">="
216
+ - !ruby/object:Gem::Version
217
+ version: 3.1.2
209
218
  type: :development
210
219
  prerelease: false
211
220
  version_requirements: !ruby/object:Gem::Requirement
212
221
  requirements:
213
222
  - - "~>"
214
223
  - !ruby/object:Gem::Version
215
- version: '1.13'
224
+ version: '3.1'
225
+ - - ">="
226
+ - !ruby/object:Gem::Version
227
+ version: 3.1.2
216
228
  - !ruby/object:Gem::Dependency
217
- name: stone_checksums
229
+ name: ruby-progressbar
218
230
  requirement: !ruby/object:Gem::Requirement
219
231
  requirements:
220
232
  - - "~>"
221
233
  - !ruby/object:Gem::Version
222
- version: '1.0'
223
- - - ">="
224
- - !ruby/object:Gem::Version
225
- version: 1.0.3
234
+ version: '1.13'
226
235
  type: :development
227
236
  prerelease: false
228
237
  version_requirements: !ruby/object:Gem::Requirement
229
238
  requirements:
230
239
  - - "~>"
231
240
  - !ruby/object:Gem::Version
232
- version: '1.0'
233
- - - ">="
234
- - !ruby/object:Gem::Version
235
- version: 1.0.3
241
+ version: '1.13'
236
242
  - !ruby/object:Gem::Dependency
237
- name: gitmoji-regex
243
+ name: stone_checksums
238
244
  requirement: !ruby/object:Gem::Requirement
239
245
  requirements:
240
246
  - - "~>"
@@ -254,25 +260,25 @@ dependencies:
254
260
  - !ruby/object:Gem::Version
255
261
  version: 1.0.3
256
262
  - !ruby/object:Gem::Dependency
257
- name: kettle-soup-cover
263
+ name: gitmoji-regex
258
264
  requirement: !ruby/object:Gem::Requirement
259
265
  requirements:
260
266
  - - "~>"
261
267
  - !ruby/object:Gem::Version
262
- version: '1.1'
268
+ version: '2.0'
263
269
  - - ">="
264
270
  - !ruby/object:Gem::Version
265
- version: 1.1.1
271
+ version: 2.0.1
266
272
  type: :development
267
273
  prerelease: false
268
274
  version_requirements: !ruby/object:Gem::Requirement
269
275
  requirements:
270
276
  - - "~>"
271
277
  - !ruby/object:Gem::Version
272
- version: '1.1'
278
+ version: '2.0'
273
279
  - - ">="
274
280
  - !ruby/object:Gem::Version
275
- version: 1.1.1
281
+ version: 2.0.1
276
282
  - !ruby/object:Gem::Dependency
277
283
  name: kramdown
278
284
  requirement: !ruby/object:Gem::Requirement
@@ -349,10 +355,10 @@ licenses:
349
355
  - MIT
350
356
  metadata:
351
357
  homepage_uri: https://structuredmerge.org
352
- source_code_uri: https://github.com/galtzo-floss/yard-fence/tree/v0.9.1
353
- changelog_uri: https://github.com/galtzo-floss/yard-fence/blob/v0.9.1/CHANGELOG.md
358
+ source_code_uri: https://github.com/galtzo-floss/yard-fence/tree/v0.9.3
359
+ changelog_uri: https://github.com/galtzo-floss/yard-fence/blob/v0.9.3/CHANGELOG.md
354
360
  bug_tracker_uri: https://github.com/galtzo-floss/yard-fence/issues
355
- documentation_uri: https://www.rubydoc.info/gems/yard-fence/0.9.1
361
+ documentation_uri: https://www.rubydoc.info/gems/yard-fence/0.9.3
356
362
  funding_uri: https://github.com/sponsors/pboling
357
363
  wiki_uri: https://github.com/galtzo-floss/yard-fence/wiki
358
364
  news_uri: https://www.railsbling.com/tags/yard-fence
@@ -381,7 +387,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
381
387
  - !ruby/object:Gem::Version
382
388
  version: '0'
383
389
  requirements: []
384
- rubygems_version: 4.0.11
390
+ rubygems_version: 4.0.10
385
391
  specification_version: 4
386
392
  summary: "\U0001F372 A brace converter for the markdown fences in your YARD"
387
393
  test_files: []
metadata.gz.sig CHANGED
Binary file