jekyll-zettel 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/jekyll/zettel/citedown.rb +16 -2
- data/lib/jekyll/zettel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b6da890e13652de4456d21ad0d8f880dff08e04e1a26fab37a6d14cb9ba81bf
|
4
|
+
data.tar.gz: f7bbaa9687435ed01409d8fde19f71e7ca19020e25c60eb261ba49c3ff938518
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4d14c20181512d33bbf3bec360cb9a8ab7e5582d4f8ba38d8cfaee5558d604c3685501ad08db20a3c01c48cdbec8a638f29a9f67d055eaaeba8928f66f14a32
|
7
|
+
data.tar.gz: 51f95e04a356377ac683e0421c587d263d830acd55d1396be9f10b4cdf2b35fbc4124e52c17b7b99ae30340e54c26ea127ea803e67d39eacefc59d4c541d0132
|
data/CHANGELOG.md
CHANGED
@@ -11,7 +11,7 @@ module Kramdown
|
|
11
11
|
@span_parsers.unshift(:citation)
|
12
12
|
end
|
13
13
|
|
14
|
-
CITATION = /\
|
14
|
+
CITATION = /\[@([\w,:]+)(;\s*(.*))?\]/.freeze
|
15
15
|
|
16
16
|
def parse_citation
|
17
17
|
start_line_number = @src.current_line_number
|
@@ -19,6 +19,15 @@ module Kramdown
|
|
19
19
|
|
20
20
|
cite_key = @src[1]
|
21
21
|
note = @src[3]
|
22
|
+
|
23
|
+
if @references.key?(cite_key)
|
24
|
+
add_citation(cite_key, note, start_line_number)
|
25
|
+
else
|
26
|
+
add_error(cite_key)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def add_citation(cite_key, note, start_line_number)
|
22
31
|
citation = @citeproc.render :citation, id: cite_key, locator: note, label: :note
|
23
32
|
attributes = {
|
24
33
|
'href' => "/zettel/#{@references[cite_key]['id']}/",
|
@@ -31,7 +40,12 @@ module Kramdown
|
|
31
40
|
@tree.children << link
|
32
41
|
end
|
33
42
|
|
34
|
-
|
43
|
+
def add_error(cite_key)
|
44
|
+
Jekyll.logger.warn 'Zettel:', "Missing entry for cite-key @#{cite_key}"
|
45
|
+
@tree.children << Element.new(:raw, "<span class=\"error\">Missing entry for cite-key @#{cite_key}</span>")
|
46
|
+
end
|
47
|
+
|
48
|
+
define_parser(:citation, CITATION, '\[@')
|
35
49
|
|
36
50
|
end
|
37
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-zettel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Gerzabek
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: citeproc-ruby
|