yard-fence 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -1
- data/CHANGELOG.md +21 -0
- data/README.md +2 -2
- data/lib/yard/fence/version.rb +1 -1
- data/lib/yard/fence.rb +28 -5
- data/sig/kramdown.rbs +1 -1
- data/sig/yard/fence.rbs +22 -5
- data.tar.gz.sig +0 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cab9d088b1349a451adc56f4b43e267d8c94844044812b66c5a57eed3289148b
|
|
4
|
+
data.tar.gz: d53f16b1762b761fa412527e325fccf3f0d2338d8d90e08f1b08a578d7f42ce2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 164bcdf2a12d36a560ee1da0588de321822d16861e1b7c3ceed37bc1ec4a0bae89818b43fdb065ba8285a8512e9429ad5d21c2ab9a1fadfa2badfb627fe727a8
|
|
7
|
+
data.tar.gz: f92d68174febc61638fb8c7537882062aafa9547f6afdfa2299e9937d861ba0e4ca67a1c1efccba3d5d6d969b6e5ce5742fac335e510036eaa26a2c1b6e49225
|
checksums.yaml.gz.sig
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
�
|
|
1
|
+
N�{3�D,�-J�ᅵ��o�nԥ3�k��Yjf������O�����M,�f h]0&�e���q��\�"U�#=J����h�?Z*;<��Y!=����$U�k=_شf9�p��3Ny�Vp���Ͷ��7 lQӂ��g�0.n1Z�'�c�\�a>�I�e�hre`�,������$���� o��EW�brO��}p,�py�α��N�ӵ��,�,����[�L~�;�����`{������Z<���Sq\�zw�%�;,�/4B�!!�-�+ |Y�D!�W'J�mtO�'W�I��6ϓ+w-���.r�H��ȿڰ�;j
|
data/CHANGELOG.md
CHANGED
|
@@ -30,6 +30,27 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
30
30
|
|
|
31
31
|
### Security
|
|
32
32
|
|
|
33
|
+
## [0.2.0] - 2025-11-07
|
|
34
|
+
|
|
35
|
+
- TAG: [v0.2.0][0.2.0t]
|
|
36
|
+
- COVERAGE: 96.43% -- 81/84 lines in 4 files
|
|
37
|
+
- BRANCH COVERAGE: 93.75% -- 15/16 branches in 4 files
|
|
38
|
+
- 29.17% documented
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- Up to 96% lines / 93% branches test coverage
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- handling of optional dependencies
|
|
47
|
+
- kramdown
|
|
48
|
+
- kramdown-parser-gfm
|
|
49
|
+
|
|
33
50
|
## [0.1.0] - 2025-11-06
|
|
34
51
|
|
|
35
52
|
- Initial release
|
|
53
|
+
|
|
54
|
+
[Unreleased]: https://github.com/galtzo-floss/yard-fence/compare/v0.2.0...HEAD
|
|
55
|
+
[0.2.0]: https://github.com/galtzo-floss/yard-fence/compare/v0.1.0...v0.2.0
|
|
56
|
+
[0.2.0t]: https://github.com/galtzo-floss/yard-fence/releases/tag/v0.2.0
|
data/README.md
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
|
|
49
49
|
## 🌻 Synopsis
|
|
50
50
|
|
|
51
|
-
A brace converter for the markdown fences in your YARD docs.
|
|
51
|
+
A brace converter for the markdown fences in your YARD docs to prevent the `InvalidLink` warning.
|
|
52
52
|
|
|
53
53
|
Just the important bits:
|
|
54
54
|
- Preprocesses top-level README and other `.md`/`.txt` files into `tmp/` replacing ASCII braces inside fenced code blocks, inline code spans, and simple placeholders like `{issuer}` or `{{TOKEN}}` with visually identical fullwidth braces.
|
|
@@ -557,7 +557,7 @@ Thanks for RTFM. ☺️
|
|
|
557
557
|
[📌gitmoji]: https://gitmoji.dev
|
|
558
558
|
[📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
|
|
559
559
|
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
|
560
|
-
[🧮kloc-img]: https://img.shields.io/badge/KLOC-
|
|
560
|
+
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.084-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
|
|
561
561
|
[🔐security]: SECURITY.md
|
|
562
562
|
[🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
|
|
563
563
|
[📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
data/lib/yard/fence/version.rb
CHANGED
data/lib/yard/fence.rb
CHANGED
|
@@ -43,7 +43,19 @@ require "version_gem"
|
|
|
43
43
|
|
|
44
44
|
# includes gem files
|
|
45
45
|
require_relative "fence/version"
|
|
46
|
-
|
|
46
|
+
begin
|
|
47
|
+
require_relative "fence/kramdown_gfm_document"
|
|
48
|
+
# :nocov:
|
|
49
|
+
# Not covering, because kramdown support is tested, so this rescue is not hit in test runs.
|
|
50
|
+
rescue LoadError => error
|
|
51
|
+
# check the error message, and re-raise if not what is expected
|
|
52
|
+
if error.message.include?("kramdown")
|
|
53
|
+
warn("Yard::Fence: Kramdown GFM provider not loaded: #{error.class}: #{error.message}") if ENV.fetch("YARD_DEBUG", "false").casecmp?("true")
|
|
54
|
+
else
|
|
55
|
+
raise error
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
# :nocov:
|
|
47
59
|
|
|
48
60
|
module Yard
|
|
49
61
|
module Fence
|
|
@@ -57,7 +69,10 @@ module Yard
|
|
|
57
69
|
SINGLE_BRACE_PLACEHOLDER_REGEX = /{([A-Za-z0-9_:\-]+)}/
|
|
58
70
|
|
|
59
71
|
class Error < StandardError; end
|
|
72
|
+
# :nocov:
|
|
73
|
+
# This is a runtime sanity check to ensure our fullwidth braces differ from ASCII braces.
|
|
60
74
|
raise Error, "ASCII braces are not the same as Unicode Fullwidth braces" if ASCII_BRACES == FULLWIDTH_BRACES
|
|
75
|
+
# :nocov:
|
|
61
76
|
|
|
62
77
|
module_function
|
|
63
78
|
|
|
@@ -139,6 +154,12 @@ module Yard
|
|
|
139
154
|
# require warnings when YARD is in the middle of loading itself. Call this
|
|
140
155
|
# from a file loaded via .yardopts (e.g. `-e 'require "yard/fence/kramdown_gfm"; Yard::Fence.use_kramdown_gfm!'`).
|
|
141
156
|
def use_kramdown_gfm!
|
|
157
|
+
# :nocov:
|
|
158
|
+
# Not covering, because kramdown support is tested, so this rescue is not hit in test runs.
|
|
159
|
+
unless defined?(Yard::Fence::KramdownGfmDocument)
|
|
160
|
+
raise Error, "Yard::Fence: Kramdown GFM provider not loaded. Add kramdown and kramdown-parser-gfm to your Gemfile."
|
|
161
|
+
end
|
|
162
|
+
# :nocov:
|
|
142
163
|
providers = ::YARD::Templates::Helpers::MarkupHelper::MARKUP_PROVIDERS[:markdown]
|
|
143
164
|
providers.unshift(KRAMDOWN_PROVIDER)
|
|
144
165
|
providers.uniq! { |p| [p[:lib].to_s, p[:const].to_s] }
|
|
@@ -162,8 +183,10 @@ Yard::Fence::Version.class_eval do
|
|
|
162
183
|
extend VersionGem::Basic
|
|
163
184
|
end
|
|
164
185
|
|
|
165
|
-
|
|
166
|
-
#
|
|
167
|
-
|
|
168
|
-
|
|
186
|
+
unless ENV["YARD_FENCE_SKIP_AT_EXIT"] == "1"
|
|
187
|
+
# After YARD completes, restore ASCII braces in generated HTML docs.
|
|
188
|
+
# This guarantees the published docs (docs/*.html) show and copy normal { }.
|
|
189
|
+
at_exit do
|
|
190
|
+
Yard::Fence.postprocess_html_docs
|
|
191
|
+
end
|
|
169
192
|
end
|
data/sig/kramdown.rbs
CHANGED
data/sig/yard/fence.rbs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
module Yard
|
|
2
2
|
module Fence
|
|
3
|
-
# Constants
|
|
3
|
+
# Constants (refined literal types where possible)
|
|
4
4
|
VERSION: String
|
|
5
|
-
ASCII_BRACES:
|
|
6
|
-
FULLWIDTH_BRACES:
|
|
7
|
-
KRAMDOWN_PROVIDER:
|
|
5
|
+
ASCII_BRACES: "{}"
|
|
6
|
+
FULLWIDTH_BRACES: "{}"
|
|
7
|
+
KRAMDOWN_PROVIDER: { lib: Symbol, const: String }
|
|
8
8
|
GLOB_PATTERN: String
|
|
9
9
|
TRIPLE_TICK_FENCE: ::Regexp
|
|
10
10
|
INLINE_TICK_FENCE: ::Regexp
|
|
@@ -15,16 +15,33 @@ module Yard
|
|
|
15
15
|
class Error < ::StandardError
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
# Module functions
|
|
18
|
+
# Module functions (available both as singleton and instance via module_function)
|
|
19
19
|
def self.fullwidth_braces: (String str) -> String
|
|
20
|
+
def fullwidth_braces: (String str) -> String
|
|
21
|
+
|
|
20
22
|
def self.sanitize_inline_code: (String line) -> String
|
|
23
|
+
def sanitize_inline_code: (String line) -> String
|
|
24
|
+
|
|
21
25
|
def self.sanitize_fenced_blocks: (String text) -> String
|
|
26
|
+
def sanitize_fenced_blocks: (String text) -> String
|
|
27
|
+
|
|
28
|
+
# Accept any object; if String returns String, otherwise returns original (untyped)
|
|
22
29
|
def self.sanitize_text: (String text) -> String
|
|
23
30
|
| (untyped text) -> untyped
|
|
31
|
+
def sanitize_text: (String text) -> String
|
|
32
|
+
| (untyped text) -> untyped
|
|
33
|
+
|
|
24
34
|
def self.prepare_tmp_files: () -> void
|
|
35
|
+
def prepare_tmp_files: () -> void
|
|
36
|
+
|
|
25
37
|
def self.restore_ascii_braces_in_html_file: (String html_filepath) -> void
|
|
38
|
+
def restore_ascii_braces_in_html_file: (String html_filepath) -> void
|
|
39
|
+
|
|
26
40
|
def self.postprocess_html_docs: () -> void
|
|
41
|
+
def postprocess_html_docs: () -> void
|
|
42
|
+
|
|
27
43
|
def self.use_kramdown_gfm!: () -> bool
|
|
44
|
+
def use_kramdown_gfm!: () -> bool
|
|
28
45
|
|
|
29
46
|
module Version
|
|
30
47
|
VERSION: String
|
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.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter H. Boling
|
|
@@ -315,10 +315,10 @@ licenses:
|
|
|
315
315
|
- MIT
|
|
316
316
|
metadata:
|
|
317
317
|
homepage_uri: https://yard-fence.galtzo.com/
|
|
318
|
-
source_code_uri: https://github.com/galtzo-floss/yard-fence/tree/v0.
|
|
319
|
-
changelog_uri: https://github.com/galtzo-floss/yard-fence/blob/v0.
|
|
318
|
+
source_code_uri: https://github.com/galtzo-floss/yard-fence/tree/v0.2.0
|
|
319
|
+
changelog_uri: https://github.com/galtzo-floss/yard-fence/blob/v0.2.0/CHANGELOG.md
|
|
320
320
|
bug_tracker_uri: https://github.com/galtzo-floss/yard-fence/issues
|
|
321
|
-
documentation_uri: https://www.rubydoc.info/gems/yard-fence/0.
|
|
321
|
+
documentation_uri: https://www.rubydoc.info/gems/yard-fence/0.2.0
|
|
322
322
|
funding_uri: https://github.com/sponsors/pboling
|
|
323
323
|
wiki_uri: https://github.com/galtzo-floss/yard-fence/wiki
|
|
324
324
|
news_uri: https://www.railsbling.com/tags/yard-fence
|
metadata.gz.sig
CHANGED
|
Binary file
|