bridgetown_markdown_lazylinks 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +1 -1
- data/lib/bridgetown_markdown_lazylinks/converter.rb +11 -5
- data/lib/bridgetown_markdown_lazylinks/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7ac6f490c4be985d2f045a7d3fc7d1c695b6ac4b5f657ab3411effda2a88a61
|
4
|
+
data.tar.gz: aa5cf84b4651dd47471798e7357fe6233f859daa42e74e150ee767276529a414
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfe0267b5a05db18235d7e5c8abd672c316bae55c4793d936fb1585af2757b150d54c04c9bab08c89e0f57a2683ee5cad25dcedb5a4e880af0e35d2fc7bf3485
|
7
|
+
data.tar.gz: f34b5c27b60951b267dbd3c994bdcf27aed13d213552a5777f417c0919e25696b5bfec5095a15fc0efe835de6c0e85b696660fa07c91b4be4aa3f82e5bbc6034
|
data/CHANGELOG.md
CHANGED
@@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.2.0] - 2023-06-17
|
11
|
+
|
12
|
+
- use of cache API to speed up site generation
|
13
|
+
|
10
14
|
## [0.1.0] - 2023-06-16
|
11
15
|
|
12
16
|
- First version
|
13
17
|
|
14
18
|
[Unreleased]: https://github.com/akarzim/bridgetown_markdown_lazylinks/tree/main
|
15
|
-
[0.1.0]: https://github.com/akarzim/bridgetown_markdown_lazylinks/releases/tag/
|
19
|
+
[0.1.0]: https://github.com/akarzim/bridgetown_markdown_lazylinks/releases/tag/v0.1.0
|
20
|
+
[0.2.0]: https://github.com/akarzim/bridgetown_markdown_lazylinks/releases/tag/v0.2.0
|
data/README.md
CHANGED
@@ -28,7 +28,7 @@ The plugin will allow you to use `*` as link references in your markdown
|
|
28
28
|
documents where the next `[*]:` href defines the link. For example, you can
|
29
29
|
write something like this:
|
30
30
|
|
31
|
-
```
|
31
|
+
```markdown
|
32
32
|
This is my text and [this is my link][*]. I'll define
|
33
33
|
the url for that link under the paragraph.
|
34
34
|
|
@@ -31,16 +31,22 @@ module BridgetownMarkdownLazylinks
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def convert(content)
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
cache.getset(content) do
|
35
|
+
while content =~ LAZY_LINKS_REGEX
|
36
|
+
self.counter += 1
|
37
|
+
content.sub!(LAZY_LINKS_REGEX, "\\k<link>#{counter}\\k<url>#{counter}]:")
|
38
|
+
end
|
38
39
|
|
39
|
-
|
40
|
+
content
|
41
|
+
end
|
40
42
|
end
|
41
43
|
|
42
44
|
private
|
43
45
|
|
44
46
|
attr_accessor :counter
|
47
|
+
|
48
|
+
def cache
|
49
|
+
@cache ||= Bridgetown::Cache.new("BridgetownMarkdownLazylinks")
|
50
|
+
end
|
45
51
|
end
|
46
52
|
end
|