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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f0c367a83de5435188cfa3d9026af115d290c8fa703ae79bbe40bd6cb8d55d3
4
- data.tar.gz: e33a27216b92a70a8c686ef5c95d3ca199862c76a02c3c294c268817bfd8e820
3
+ metadata.gz: 1b6da890e13652de4456d21ad0d8f880dff08e04e1a26fab37a6d14cb9ba81bf
4
+ data.tar.gz: f7bbaa9687435ed01409d8fde19f71e7ca19020e25c60eb261ba49c3ff938518
5
5
  SHA512:
6
- metadata.gz: 8c00dabfae55a10731da1b0cb95c69a93fde42f89056c35299b4e5f0862a490cebc522a486755ed6517f2cf89b62bdc91da535fc7c82e919b0683d64426658a9
7
- data.tar.gz: dd6329b7912aabfa2cf0d70d4f976dfce1ad7e887c8f60ccb23620ad62640b9dd92a50430dae52f4746e52d2c51f1c2bdf2e91630aa4c5ff083291cfc0b7a64a
6
+ metadata.gz: a4d14c20181512d33bbf3bec360cb9a8ab7e5582d4f8ba38d8cfaee5558d604c3685501ad08db20a3c01c48cdbec8a638f29a9f67d055eaaeba8928f66f14a32
7
+ data.tar.gz: 51f95e04a356377ac683e0421c587d263d830acd55d1396be9f10b4cdf2b35fbc4124e52c17b7b99ae30340e54c26ea127ea803e67d39eacefc59d4c541d0132
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
1
  ## 0.1.0
2
2
 
3
3
  - Initial Import
4
+
5
+ ## 0.7.x
6
+
7
+ - Added inline citations
8
+
9
+ ### 0.7.1
10
+
11
+ - Changed inline citation regex to be compatible with pandoc [@<key>…]
12
+ - Emit warning when no reference for given _cite-key_ is found
@@ -11,7 +11,7 @@ module Kramdown
11
11
  @span_parsers.unshift(:citation)
12
12
  end
13
13
 
14
- CITATION = /\(@([\w,:]+)(;\s*(.*))?\)/.freeze
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
- define_parser(:citation, CITATION, '\(@')
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
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Zettel
3
- VERSION = '0.7.0'.freeze
3
+ VERSION = '0.7.1'.freeze
4
4
  end
5
5
  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.0
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-20 00:00:00.000000000 Z
11
+ date: 2022-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: citeproc-ruby