scholarmarkdown 2.5.0 → 2.6.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/layouts/default.html.erb +2 -2
- data/lib/scholarmarkdown/filter/citation_metadata.rb +1 -1
- data/lib/scholarmarkdown/filter/headerids_to_section.rb +4 -2
- data/lib/scholarmarkdown/snippets.rb +11 -7
- data/scholarmarkdown.gemspec +3 -3
- 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: 7706863395ba006040193bda58d4788efef5935494a7337be0cd604396c0f093
|
4
|
+
data.tar.gz: 8a71634b511450130b8610cdab9362d6c491b388ea2101e7ca97ea0ae219faa1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50953b262188dca05a48145d34c2242bf7834dc64243a81505b11c5626f82f53dd708209f1b89afe343fe5ee16beba3c90de0313cba9c43999d30cda0b417484
|
7
|
+
data.tar.gz: 0bcf49fbe70124d2e0e7fff72df236b13b379c26309d65221436fae277bb77c9dfc5ab4b1c87eaf34dd77715a3f12cd6f26f36001aadb41dc1fd7d498e1aa244
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.0
|
@@ -2,13 +2,13 @@
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
3
3
|
<head>
|
4
4
|
<meta charset="utf-8" />
|
5
|
-
<title><%= h @item[:title] %></title>
|
5
|
+
<title property="foaf:name schema:name"><%= h @item[:title].gsub(/[\n]/, ' ') %></title>
|
6
6
|
<link rel="stylesheet" media="screen" href="styles/screen.css" />
|
7
7
|
<link rel="stylesheet" media="print" href="styles/print.css" />
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
9
9
|
<%= @items['/styles/katex.css'].nil? ? '' : '<link rel="stylesheet" media="all" href="styles/katex.css" />' %>
|
10
10
|
</head>
|
11
|
-
<body prefix="
|
11
|
+
<body prefix="dctypes: http://purl.org/dc/dcmitype/ pimspace: http://www.w3.org/ns/pim/space# rsa: http://www.w3.org/ns/auth/rsa# cert: http://www.w3.org/ns/auth/cert# wgs: http://www.w3.org/2003/01/geo/wgs84_pos# biblio: http://purl.org/net/biblio# bibo: http://purl.org/ontology/bibo/ book: http://purl.org/NET/book/vocab# ov: http://open.vocab.org/terms/ doap: http://usefulinc.com/ns/doap# dbr: http://dbpedia.org/resource/ dbp: http://dbpedia.org/property/ sio: http://semanticscience.org/resource/ opmw: http://www.opmw.org/ontology/ deo: http://purl.org/spar/deo/ doco: http://purl.org/spar/doco/ cito: http://purl.org/spar/cito/ fabio: http://purl.org/spar/fabio/ solid: http://www.w3.org/ns/solid/terms# acl: http://www.w3.org/ns/auth/acl# dio: https://w3id.org/dio# lsc: http://linkedscience.org/lsc/ns#" typeof="schema:CreativeWork sioc:Post prov:Entity lsc:Research">
|
12
12
|
<%= yield %>
|
13
13
|
</body>
|
14
14
|
</html>
|
@@ -20,7 +20,7 @@ Nanoc::Filter.define(:scholar_citation_metadata) do |content, params|
|
|
20
20
|
# Add citation meta tags at the end of the <head>
|
21
21
|
content.gsub! %r{\<\/head\>} do |match|
|
22
22
|
<<-HTML
|
23
|
-
<meta name="citation_title" content="#{item[:title]}">
|
23
|
+
<meta name="citation_title" content="#{item[:title].gsub(/[\n]/, ' ')}">
|
24
24
|
#{authors}
|
25
25
|
#{additionalTags}
|
26
26
|
</head>
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# Moves IDs on headings to their parent section
|
2
2
|
Nanoc::Filter.define(:scholar_headerids_to_section) do |content|
|
3
3
|
content = content.dup
|
4
|
-
content.gsub! /<section>(\s*)(<h\d[^>]*)
|
5
|
-
|
4
|
+
content.gsub! /<section>(\s*)(<div[^>]*>)(\s*)(<h\d[^>]*)\sid="([^\s>]+)"([^>]*)>/ do |_|
|
5
|
+
match = Regexp.last_match
|
6
|
+
"<section id=\"#{match[5]}\" inlist=\"\" rel=\"schema:hasPart\" resource=\"##{match[5]}\">#{match[1]}#{match[2]}#{match[3]}#{match[4]} property=\"schema:name\"#{match[6]}>"
|
7
|
+
end
|
6
8
|
content
|
7
9
|
end
|
@@ -14,25 +14,29 @@ def section id, classes = nil
|
|
14
14
|
raise "Could not find the file '" + id.to_s + "'"
|
15
15
|
end
|
16
16
|
<<-HTML
|
17
|
-
<section
|
17
|
+
<section #{section_suffix}>
|
18
|
+
<div datatype="rdf:HTML" property="schema:description" markdown="block">
|
18
19
|
#{item.raw_content}
|
20
|
+
</div>
|
19
21
|
</section>
|
20
22
|
HTML
|
21
23
|
end
|
22
24
|
|
23
25
|
# Create a person block
|
24
|
-
def person name, website, profile
|
25
|
-
|
26
|
-
|
27
|
-
$authors
|
26
|
+
def person name, website, profile, mainAuthor = true
|
27
|
+
if mainAuthor
|
28
|
+
# Add person to global list of authors
|
29
|
+
unless $authors
|
30
|
+
$authors = []
|
31
|
+
end
|
32
|
+
$authors.push(name)
|
28
33
|
end
|
29
|
-
$authors.push(name)
|
30
34
|
|
31
35
|
if not website
|
32
36
|
h name
|
33
37
|
elsif not profile
|
34
38
|
%{<a href="#{h website}">#{h name}</a>}
|
35
39
|
else
|
36
|
-
%{<a href="#{h website}" typeof="
|
40
|
+
%{<a rev="lsc:participatesIn" property="foaf:maker schema:creator schema:author schema:publisher" href="#{h website}" typeof="foaf:Person schema:Person" resource="#{profile}">#{h name}</a>}
|
37
41
|
end
|
38
42
|
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.6.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.6.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-08-01"
|
15
15
|
s.email = "rubensworks@gmail.com".freeze
|
16
16
|
s.executables = ["generate-scholarmarkdown".freeze]
|
17
17
|
s.extra_rdoc_files = [
|
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.6.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-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|