scholarmarkdown 2.2.0 → 2.3.0

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: f6e6ae8f3ba0a0f91caa917346eeea6b24b816c1ebce21fd33dae27b29a2454c
4
- data.tar.gz: 655aae4852c25beaf535413e41f1b4b77d1059af4afd36b7d0c3b9b2fd20f3b3
3
+ metadata.gz: f37a719528d6622e562e841f521abb0c704f5baeac8a3647069860889b5737c8
4
+ data.tar.gz: c893774b693af95b11dc62202989259b3a70ff58fb16045c67862527f4f787aa
5
5
  SHA512:
6
- metadata.gz: 823bc3a3ed656cc209b4a292998c6e2bc9660739f19504ad1c7568455e47857fe3a9ecff4419a95ed186a34de89d09de96663eb36b217cd8c74890313a740e17
7
- data.tar.gz: 6b2d0c1a292bd989ed322f963b5abd2957e3eaf6cf6f60688fc1a444071b3f08f10350f94dcbb9869ecfc5aa3a698be5efea19cca37e3ffe129c0b8ca5af87f2
6
+ metadata.gz: 2c23e0aaf9db5aa8ceb4818ee13399cbf5663d21de85f5e46c56c781fa64ce72d84ca690bf4da121b8434e07ce0c200ec40d07cd39e56e4b0b59b6e1cebdfa8a
7
+ data.tar.gz: bc49e725b695856371763a3544a33227b8272af7a0ea49c978776bcfc38c642d10bd80f173908b5ad29c81c4e1ca4997679a0272616bbf58a456cf50d80473fe
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.0
1
+ 2.3.0
data/bin/template/Rules CHANGED
@@ -8,6 +8,7 @@ require 'scholarmarkdown/filter/include_code'
8
8
  require 'scholarmarkdown/filter/labelify'
9
9
  require 'scholarmarkdown/filter/references_to_footer'
10
10
  require 'scholarmarkdown/filter/headerids_to_section'
11
+ require 'scholarmarkdown/filter/citation_metadata'
11
12
 
12
13
  Encoding.default_external = "UTF-8"
13
14
 
@@ -23,6 +24,7 @@ compile '/index.*' do
23
24
  filter :scholar_headerids_to_section
24
25
  filter :rubypants
25
26
  layout '/default.*'
27
+ filter :scholar_citation_metadata
26
28
  end
27
29
 
28
30
  ignore '/*.md'
@@ -0,0 +1,31 @@
1
+ # Define a filter for adding citation metadata
2
+ Nanoc::Filter.define(:scholar_citation_metadata) do |content, params|
3
+ content = content.dup
4
+
5
+ # Create author tags
6
+ authors = ""
7
+ if $authors
8
+ authors = $authors.map { |author| '<meta name="citation_author" content="' + author + '" />' }.join("\n ")
9
+ $authors = []
10
+ end
11
+
12
+ # Create optional tags
13
+ additionalTags = params.map { |key, value| '<meta name="citation_' + key.to_s + '" content="' + value + '" />' }.join("\n ")
14
+ if not params[:publication_date]
15
+ additionalTags += "\n "
16
+ additionalTags += '<meta name="citation_publication_date" content="' + Time.now.strftime("%Y/%m/%d") + '" />'
17
+ end
18
+ #params_publication_date = params[:publication_date] || Time.now.strftime("%Y/%m/%d")
19
+
20
+ # Add citation meta tags at the end of the <head>
21
+ content.gsub! %r{\<\/head\>} do |match|
22
+ <<-HTML
23
+ <meta name="citation_title" content="#{item[:title]}">
24
+ #{authors}
25
+ #{additionalTags}
26
+ </head>
27
+ HTML
28
+ end
29
+
30
+ content
31
+ end
@@ -18,6 +18,12 @@ end
18
18
 
19
19
  # Create a person block
20
20
  def person name, website, profile
21
+ # Add person to global list of authors
22
+ unless $authors
23
+ $authors = []
24
+ end
25
+ $authors.push(name)
26
+
21
27
  if not website
22
28
  h name
23
29
  elsif not profile
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: scholarmarkdown 2.2.0 ruby lib
5
+ # stub: scholarmarkdown 2.3.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "scholarmarkdown".freeze
9
- s.version = "2.2.0"
9
+ s.version = "2.3.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Ruben Taelman".freeze]
14
- s.date = "2019-01-08"
14
+ s.date = "2019-05-16"
15
15
  s.email = "rubensworks@gmail.com".freeze
16
16
  s.executables = ["generate-scholarmarkdown".freeze]
17
17
  s.extra_rdoc_files = [
@@ -58,6 +58,7 @@ Gem::Specification.new do |s|
58
58
  "lib/scholarmarkdown/filter/acronym.rb",
59
59
  "lib/scholarmarkdown/filter/annotations.rb",
60
60
  "lib/scholarmarkdown/filter/citation.rb",
61
+ "lib/scholarmarkdown/filter/citation_metadata.rb",
61
62
  "lib/scholarmarkdown/filter/dokieli_ui.rb",
62
63
  "lib/scholarmarkdown/filter/headerids_to_section.rb",
63
64
  "lib/scholarmarkdown/filter/hyphenate_iri.rb",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scholarmarkdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruben Taelman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-08 00:00:00.000000000 Z
11
+ date: 2019-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -226,6 +226,7 @@ files:
226
226
  - lib/scholarmarkdown/filter/acronym.rb
227
227
  - lib/scholarmarkdown/filter/annotations.rb
228
228
  - lib/scholarmarkdown/filter/citation.rb
229
+ - lib/scholarmarkdown/filter/citation_metadata.rb
229
230
  - lib/scholarmarkdown/filter/dokieli_ui.rb
230
231
  - lib/scholarmarkdown/filter/headerids_to_section.rb
231
232
  - lib/scholarmarkdown/filter/hyphenate_iri.rb