jekyll-pubmed 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.travis.yml +19 -0
- data/Gemfile +4 -0
- data/README.md +32 -0
- data/Rakefile +2 -0
- data/jekyll-pubmed.gemspec +27 -0
- data/lib/jekyll-pubmed.rb +98 -0
- data/lib/jekyll-pubmed/version.rb +3 -0
- data/scripts/bootstrap +3 -0
- data/scripts/cibuild +4 -0
- data/spec/dest/assets/header.png +0 -0
- data/spec/dest/assets/main.css +106 -0
- data/spec/dest/publications/index.html +427 -0
- data/spec/fixtures/_includes/footer.html +9 -0
- data/spec/fixtures/_includes/head.html +12 -0
- data/spec/fixtures/_includes/header.html +40 -0
- data/spec/fixtures/_layouts/default.html +21 -0
- data/spec/fixtures/_layouts/home.html +7 -0
- data/spec/fixtures/_layouts/page.html +7 -0
- data/spec/fixtures/_layouts/post.html +5 -0
- data/spec/fixtures/_layouts/project.html +3 -0
- data/spec/fixtures/_layouts/projects.html +49 -0
- data/spec/fixtures/_layouts/publications.html +87 -0
- data/spec/fixtures/assets/header.png +0 -0
- data/spec/fixtures/assets/main.css +106 -0
- data/spec/fixtures/publications.md +7 -0
- data/spec/jekyll-pubmed_spec.rb +35 -0
- data/spec/spec_helper.rb +45 -0
- metadata +157 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
<head>
|
2
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
3
|
+
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.blue_grey-indigo.min.css" />
|
4
|
+
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
|
5
|
+
|
6
|
+
<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
|
7
|
+
|
8
|
+
<title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
|
9
|
+
<meta name="description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncate: 160 | escape }}">
|
10
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
11
|
+
|
12
|
+
</head>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<div class="banner">
|
2
|
+
<div class="header-img">
|
3
|
+
<span class="main-title">Bioinformatics (Mis)adventures</span>
|
4
|
+
<br/>
|
5
|
+
<span class="sub-title">Regular Mishaps with Bioinformatics</span>
|
6
|
+
</div>
|
7
|
+
</div>
|
8
|
+
<div id="header" class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
|
9
|
+
|
10
|
+
<header class="mdl-layout__header ">
|
11
|
+
<div class="mdl-layout__header-row">
|
12
|
+
|
13
|
+
<nav class="mdl-navigation mdl-layout--large-screen-only mdl-js-ripple-effect">
|
14
|
+
<a class="mdl-navigation__link" href="/">Home</a>
|
15
|
+
<a class="mdl-navigation__link" href="/education/">Education</a>
|
16
|
+
<a class="mdl-navigation__link" href="/projects/">Projects</a>
|
17
|
+
<a class="mdl-navigation__link" href="/research/">Research</a>
|
18
|
+
<a class="mdl-navigation__link" href="">Tools</a>
|
19
|
+
<a class="mdl-navigation__link" href="">Posts</a>
|
20
|
+
<a class="mdl-navigation__link" href="/publications/">Publications</a>
|
21
|
+
<a class="mdl-navigation__link" href="">Contact</a>
|
22
|
+
</nav>
|
23
|
+
|
24
|
+
|
25
|
+
<div class="mdl-layout-spacer"></div>
|
26
|
+
</div>
|
27
|
+
</header>
|
28
|
+
|
29
|
+
<div class="mdl-layout__drawer">
|
30
|
+
<nav class="mdl-navigation">
|
31
|
+
<a class="mdl-navigation__link" href="/">Home</a>
|
32
|
+
<a class="mdl-navigation__link" href="/education">Education</a>
|
33
|
+
<a class="mdl-navigation__link" href="/projects/">Projects</a>
|
34
|
+
<a class="mdl-navigation__link" href="/research/">Research</a>
|
35
|
+
<a class="mdl-navigation__link" href="">Tools</a>
|
36
|
+
<a class="mdl-navigation__link" href="">Posts</a>
|
37
|
+
<a class="mdl-navigation__link" href="/publications/">Publications</a>
|
38
|
+
<a class="mdl-navigation__link" href="">Contact</a>
|
39
|
+
</nav>
|
40
|
+
</div>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="{{ page.lang | default: site.lang | default: "en" }}">
|
3
|
+
|
4
|
+
{% include head.html %}
|
5
|
+
|
6
|
+
<body>
|
7
|
+
|
8
|
+
{% include header.html %}
|
9
|
+
<main class="mdl-layout__content">
|
10
|
+
<div class="page-content">
|
11
|
+
{{ content }}
|
12
|
+
</div>
|
13
|
+
|
14
|
+
</main>
|
15
|
+
{% include footer.html %}
|
16
|
+
</div>
|
17
|
+
|
18
|
+
</div>
|
19
|
+
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -0,0 +1,49 @@
|
|
1
|
+
---
|
2
|
+
layout: default
|
3
|
+
---
|
4
|
+
<h1>Projects</h1>
|
5
|
+
|
6
|
+
<div class="mdl-grid">
|
7
|
+
{% for project in site.categories.projects %}
|
8
|
+
<div class="mdl-cell mdl-cell--4-col mdl-cell--4-col-phone mdl-card mdl-shadow--4dp">
|
9
|
+
<div class="mdl-card__title">
|
10
|
+
<h1 class="mdl-card__title-text">{{ project.title}}</h1>
|
11
|
+
<img src="{{ project.logo }}" />
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class="mdl-card__media">
|
15
|
+
<img src="{{project.img}}"/>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="mdl-card__supporting-text mdl-card--expand">
|
19
|
+
{{ project.content }}
|
20
|
+
</div>
|
21
|
+
|
22
|
+
|
23
|
+
<div class="mdl-card__actions mdl-card--border">
|
24
|
+
{% if project.publication == "" %}
|
25
|
+
<a id="pinemap_pub" class="right-button mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--fab mdl-button--colored" disabled>
|
26
|
+
<i class="material-icons">description</i>
|
27
|
+
</a>
|
28
|
+
{% else %}{{child.MedlineCitation.PMID}}_link
|
29
|
+
<a id="{{ project.title}}_pub" class="right-button mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--fab mdl-button--colored" href="{{ project.publication }}" target="_blank">
|
30
|
+
<i class="material-icons">description</i>
|
31
|
+
</a>
|
32
|
+
{% endif %}
|
33
|
+
<div class="mdl-tooltip mdl-tooltip--large" for="{{ project.title}}_pub"> Publication</div>
|
34
|
+
{% if project.link == "" %}
|
35
|
+
<button id="{{ project.title}}_link" class="right-btn mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--fab mdl-button--colored" disabled >
|
36
|
+
<i class="material-icons">launch</i>
|
37
|
+
</button>
|
38
|
+
{% else %}
|
39
|
+
<a id="{{ project.title}}_link" class="right-btn mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--fab mdl-button--colored" target="_blank" href="{{project.link}}">
|
40
|
+
<i class="material-icons">launch</i>
|
41
|
+
</a>
|
42
|
+
{% endif %}
|
43
|
+
<div class="mdl-tooltip mdl-tooltip--large" for="{{ project.title}}_link"> Website </div>
|
44
|
+
|
45
|
+
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
{% endfor %}
|
49
|
+
</div>
|
@@ -0,0 +1,87 @@
|
|
1
|
+
---
|
2
|
+
layout: default
|
3
|
+
---
|
4
|
+
|
5
|
+
<h1>Publications</h1>
|
6
|
+
<section class="mdl-grid pub_table">
|
7
|
+
{% for year in site.data.abstracts.years %}
|
8
|
+
<div class="mdl-cell mdl-cell--12-col-desktop mdl-cell--4-col-phone mdl-cell--middle pub_year mdl-cell--stretch">
|
9
|
+
<h4>{{ year }}</h4>
|
10
|
+
</div>
|
11
|
+
{% for pub_date in site.data.abstracts.pmids %}
|
12
|
+
{% assign pub_year = pub_date[0] | date: "%Y" %}
|
13
|
+
{% if pub_year == year %}
|
14
|
+
{% for article in site.data.abstracts.articles %}
|
15
|
+
{% if article[0] == pub_date[1] %}
|
16
|
+
<div class="mdl-cell mdl-cell--10-col mdl-cell--4-col-phone pub_details">
|
17
|
+
<div class="pub_title">
|
18
|
+
<a tooltip="{{article[1].title}}" class = 'dialog-link-{{pub_date[1]}}'>{{article[1].title}}</a>
|
19
|
+
</div>
|
20
|
+
<div class="authors">
|
21
|
+
{% for pub_author in article[1].authors %}
|
22
|
+
{% if pub_author contains "Wimalanathan" %}
|
23
|
+
<span class="bold_author">{{pub_author}}, </span>
|
24
|
+
{% elsif forloop.first %}
|
25
|
+
{{pub_author}}*,
|
26
|
+
{% elsif forloop.last %}
|
27
|
+
{{pub_author}}.
|
28
|
+
{% else %}
|
29
|
+
{{pub_author}},
|
30
|
+
{% endif %}
|
31
|
+
{% endfor %}
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
<div class="mdl-cell mdl-cell--1-col-desktop mdl-cell--4-col mdl-cell--middle pub_link mdl-cell--stretch">
|
35
|
+
<a id="{{pub_date[1]}}_link" class="right-button mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--fab mdl-button--colored"
|
36
|
+
href="http://www.ncbi.nlm.nih.gov/pubmed?term={{pub_date[1]}}" target="_blank">
|
37
|
+
<i class="material-icons">description</i>
|
38
|
+
</a>
|
39
|
+
<div class="mdl-tooltip mdl-tooltip--large" for="{{pub_date[1]}}_link"> Go to Pubmed </div>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<dialog id="dialog-{{pub_date[1]}}" class="mdl-dialog abstract-dialog">
|
43
|
+
<h3 class="mdl-dialog__title">{{article[1].title}}</h3>
|
44
|
+
<div class="mdl-dialog__content">
|
45
|
+
<p>
|
46
|
+
{{article[1].abstract}}
|
47
|
+
</p>
|
48
|
+
</div>
|
49
|
+
<div class="mdl-dialog__actions">
|
50
|
+
<button type="button" class="mdl-button">Close</button>
|
51
|
+
</div>
|
52
|
+
</dialog>
|
53
|
+
<script>
|
54
|
+
(function() {
|
55
|
+
'use strict';
|
56
|
+
var dialogButton = document.querySelector('.dialog-link-{{pub_date[1]}}');
|
57
|
+
var dialog = document.querySelector('#dialog-{{pub_date[1]}}');
|
58
|
+
if (! dialog.showModal) {
|
59
|
+
dialogPolyfill.registerDialog(dialog);
|
60
|
+
}
|
61
|
+
dialogButton.addEventListener('click', function() {
|
62
|
+
dialog.showModal();
|
63
|
+
});
|
64
|
+
dialog.querySelector('button:not([disabled])')
|
65
|
+
.addEventListener('click', function() {
|
66
|
+
dialog.close();
|
67
|
+
});
|
68
|
+
}());
|
69
|
+
</script>
|
70
|
+
|
71
|
+
{% endif %}
|
72
|
+
{% endfor %}
|
73
|
+
{% endif %}
|
74
|
+
{% endfor %}
|
75
|
+
{% endfor %}
|
76
|
+
</section>
|
77
|
+
|
78
|
+
<!-- <span>
|
79
|
+
({{ child.MedlineCitation.Article.Journal.JournalIssue.PubDate.Year }}.)
|
80
|
+
|
81
|
+
{{ child.MedlineCitation.Article.Journal.ISOAbbreviation }}.
|
82
|
+
{{ child.MedlineCitation.Article.Journal.JournalIssue.Volume }}
|
83
|
+
{% if child.MedlineCitation.Article.Journal.JournalIssue.Issue %}
|
84
|
+
,({{ child.MedlineCitation.Article.Journal.JournalIssue.Issue }})
|
85
|
+
{% endif %}
|
86
|
+
:{{child.MedlineCitation.Article.Pagination.MedlinePgn}}
|
87
|
+
</span> -->
|
Binary file
|
@@ -0,0 +1,106 @@
|
|
1
|
+
.banner{
|
2
|
+
/*background-image: url("/assets/header.png");*/
|
3
|
+
background: rgb(96,125,139);
|
4
|
+
color:white;
|
5
|
+
height:80px;
|
6
|
+
width:100%;
|
7
|
+
}
|
8
|
+
.main-title{
|
9
|
+
top:20;
|
10
|
+
margin:20px 20px;
|
11
|
+
font-size:32pt;
|
12
|
+
font-weight: bolder;
|
13
|
+
line-height: normal;
|
14
|
+
}
|
15
|
+
.sub-title{
|
16
|
+
font-size:24px;
|
17
|
+
padding-left: 75px;
|
18
|
+
font-style: italic;
|
19
|
+
}
|
20
|
+
|
21
|
+
/*@media (max-width: 512px) and (min-resolution: 1.5dppx),
|
22
|
+
(max-width: 1024px) and (max-resolution: 1.5dppx) {
|
23
|
+
.main-title{
|
24
|
+
font-size: 24pt;
|
25
|
+
}
|
26
|
+
.sub-title{
|
27
|
+
font-style: italic;
|
28
|
+
font-size: 12pt;
|
29
|
+
}
|
30
|
+
.banner{
|
31
|
+
height:60px;
|
32
|
+
width:100%;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
|
37
|
+
.demo-layout-transparent .mdl-layout__header{
|
38
|
+
background: url('/assets/header.png') center / cover;
|
39
|
+
|
40
|
+
background: url('/assets/header.png') center / cover;
|
41
|
+
|
42
|
+
background: url('/assets/header.png') center / cover;
|
43
|
+
background: url('/assets/header.png') center / cover;
|
44
|
+
}
|
45
|
+
} color:white;
|
46
|
+
padding-left:20px;
|
47
|
+
}*/
|
48
|
+
|
49
|
+
div.mdl-card__media > img{
|
50
|
+
max-width:100%;
|
51
|
+
max-height:100%;
|
52
|
+
}
|
53
|
+
.mdl-card__title{
|
54
|
+
width:100%;
|
55
|
+
}
|
56
|
+
div.mdl-card__title > img{
|
57
|
+
position: absolute;
|
58
|
+
right: 5px;
|
59
|
+
height:50px;
|
60
|
+
}
|
61
|
+
|
62
|
+
.subheader{8
|
63
|
+
color: white;
|
64
|
+
background: rgb(96,125,139);
|
65
|
+
margin: 0px 20px ;
|
66
|
+
padding: 0px 20px ;
|
67
|
+
}
|
68
|
+
.right-btn{
|
69
|
+
position:absolute;
|
70
|
+
right:10px;
|
71
|
+
}
|
72
|
+
|
73
|
+
.bold_author{
|
74
|
+
font-weight: bold;
|
75
|
+
font-style: italic;
|
76
|
+
}
|
77
|
+
|
78
|
+
.pub-list{
|
79
|
+
margin:20px 20px;
|
80
|
+
}
|
81
|
+
|
82
|
+
.pub_title{
|
83
|
+
font-size: 14pt;
|
84
|
+
font-weight: bold;
|
85
|
+
}
|
86
|
+
|
87
|
+
.pub_year{
|
88
|
+
color:white;
|
89
|
+
font-weight: bolder;
|
90
|
+
text-align: center;
|
91
|
+
background: rgb(96,125,139);
|
92
|
+
}
|
93
|
+
.pub_link{
|
94
|
+
text-align: center;
|
95
|
+
}
|
96
|
+
.authors{
|
97
|
+
font-size:12pt;
|
98
|
+
}
|
99
|
+
|
100
|
+
.abstract-dialog{
|
101
|
+
width:90%;
|
102
|
+
}
|
103
|
+
|
104
|
+
.pub_details{
|
105
|
+
margin:20px;
|
106
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Jekyll:Jekyll_Pubmed do
|
4
|
+
let(:overrides) { Hash.new }
|
5
|
+
let(:config) do
|
6
|
+
Jekyll.configuration(Jekyll::Utils.deep_merge_hashes({
|
7
|
+
"full_rebuild" => true,
|
8
|
+
"source" => source_dir,
|
9
|
+
"destination" => dest_dir,
|
10
|
+
"url" => "http://example.org",
|
11
|
+
"name" => "My awesome site",
|
12
|
+
"author" => {
|
13
|
+
"name" => "Dr. Jekyll"
|
14
|
+
},
|
15
|
+
"collections" => {
|
16
|
+
"my_collection" => { "output" => true },
|
17
|
+
"other_things" => { "output" => false }
|
18
|
+
},
|
19
|
+
"jekyll_pubmed" => {
|
20
|
+
"data" => "publications",
|
21
|
+
"term" => "Wimalanathan K"
|
22
|
+
}
|
23
|
+
}, overrides))
|
24
|
+
end
|
25
|
+
let(:site) { Jekyll::Site.new(config) }
|
26
|
+
let(:context) { make_context(site: site) }
|
27
|
+
before(:each) do
|
28
|
+
site.process
|
29
|
+
end
|
30
|
+
it "creates publications" do
|
31
|
+
expect(Pathname.new(dest_dir("publications/index.html"))).to exist
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# spec_helper.rb
|
2
|
+
$LOAD_PATH.unshift File.expand_path("../../jekyll-pubmed", __FILE__)
|
3
|
+
require "jekyll"
|
4
|
+
require "jekyll-pubmed"
|
5
|
+
|
6
|
+
Jekyll.logger.log_level = :error
|
7
|
+
|
8
|
+
RSpec.configure do |config|
|
9
|
+
config.run_all_when_everything_filtered = true
|
10
|
+
config.filter_run :focus
|
11
|
+
config.order = "random"
|
12
|
+
|
13
|
+
SOURCE_DIR = File.expand_path("../fixtures", __FILE__)
|
14
|
+
DEST_DIR = File.expand_path("../dest", __FILE__)
|
15
|
+
|
16
|
+
def source_dir(*files)
|
17
|
+
File.join(SOURCE_DIR, *files)
|
18
|
+
end
|
19
|
+
|
20
|
+
def dest_dir(*files)
|
21
|
+
File.join(DEST_DIR, *files)
|
22
|
+
end
|
23
|
+
|
24
|
+
# def make_context(registers = {}, environments = {})
|
25
|
+
# Liquid::Context.new(environments, {},
|
26
|
+
# { :site => site, :page => page }.merge(registers))
|
27
|
+
# end
|
28
|
+
end
|
29
|
+
|
30
|
+
# CONFIG_DEFAULTS = {
|
31
|
+
# "source" => source_dir,
|
32
|
+
# "destination" => dest_dir,
|
33
|
+
# "gems" => ["jekyll-pubmed"]
|
34
|
+
# }.freeze
|
35
|
+
#
|
36
|
+
# def make_page(options = {})
|
37
|
+
# page = Jekyll::Page.new(site, CONFIG_DEFAULTS["source"], "", "page.md")
|
38
|
+
# page.data = options
|
39
|
+
# page
|
40
|
+
# end
|
41
|
+
#
|
42
|
+
# def make_site(options = {})
|
43
|
+
# site_config = Jekyll.configuration(CONFIG_DEFAULTS.merge(options))
|
44
|
+
# Jekyll::Site.new(site_config)
|
45
|
+
# end
|