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 +4 -4
- data/VERSION +1 -1
- data/bin/template/Rules +2 -0
- data/lib/scholarmarkdown/filter/citation_metadata.rb +31 -0
- data/lib/scholarmarkdown/snippets.rb +6 -0
- data/scholarmarkdown.gemspec +4 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f37a719528d6622e562e841f521abb0c704f5baeac8a3647069860889b5737c8
|
4
|
+
data.tar.gz: c893774b693af95b11dc62202989259b3a70ff58fb16045c67862527f4f787aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c23e0aaf9db5aa8ceb4818ee13399cbf5663d21de85f5e46c56c781fa64ce72d84ca690bf4da121b8434e07ce0c200ec40d07cd39e56e4b0b59b6e1cebdfa8a
|
7
|
+
data.tar.gz: bc49e725b695856371763a3544a33227b8272af7a0ea49c978776bcfc38c642d10bd80f173908b5ad29c81c4e1ca4997679a0272616bbf58a456cf50d80473fe
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
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
|
data/scholarmarkdown.gemspec
CHANGED
@@ -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.
|
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.
|
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-
|
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.
|
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-
|
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
|