jekyll-citations 1.0.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 99d9d052d9a05126e7ed56be3599e9600a1fd9afd5a32d1c3984c49687fb94c7
4
+ data.tar.gz: f397ed358d203b2017c755db3685e9128770144b1ec352fd7a2d05cf85d89824
5
+ SHA512:
6
+ metadata.gz: 27ba9a91ee568525331ff1343e7adb50d0b1b34f7e82f1f358daadc0010d30d629611162b1f1033c9bee1f71e27272c9079e5bbd3ba26e8be13496d059502650
7
+ data.tar.gz: 7130b87e377b0522efd3528ba1b36c0eedf5924fe3f10c1ff53cdf6796edef48082c89a899787d9c43029825fa852c149fbd75686d784ab98267fde20d5e17ad
data/LICENSE ADDED
@@ -0,0 +1,25 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2021, Matthew Wildrick Thomas
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # Citation generator
2
+
3
+ ## How it works
4
+
5
+ You can see the template for the bibliography [here](_layouts/bib.html) and the template for the lists [here](_layouts/list.html).
6
+
7
+ ### Lists
8
+
9
+ Basically, for every tag (eg. reputation), the [list template](_layouts/list.html) loops over the entire database and only returns papers that have this tag. The syntax looks pretty weird because it's written in a template language called liquid. I used it because GitHub can read liquid templates to generate the [site](https://cet.econ.northwestern.edu/dekel).
10
+
11
+ I describe the steps below
12
+ 1. Sort all papers in reverse chronological order
13
+ ```
14
+ {% assign sorted = site.papers | sort:"year" | reverse %}
15
+ ```
16
+ 2. Start a for loop over the sorted papers
17
+ ```
18
+ {% for paper in sorted %}
19
+ ```
20
+ 3. Continue if the page does not filter by category (Decision Theory/Game Theory) or if the category matches the filter.
21
+ ```
22
+ {% if page.category == nil or paper.categories contains page.category %}
23
+ ```
24
+ 4. same thing but with tags (reputation, mechanism design, etc)
25
+ ```
26
+ {% if page.tag == nil or paper.tags contains page.tag %}
27
+ ```
28
+ 5. Run the specific HTML to be repeated in the list using variables from the [database](_data\papers.yml). It also checks to see if the paper is single authored and reacts accordingly.
29
+ ```
30
+ <a href="{{ site.url }}{{ site.baseurl }}/pdf/{{ paper.pdf }}">{{ paper.title }}</a>{% if paper.authors.size > 1 %} (with {{ paper.authors | where_exp:"item", "item != 'Dekel, Eddie'" | join: " and "}}){% endif %}, <em>{{ paper.journal }}</em>, {{ paper.year }} <a href="{{ site.url }}{{ site.baseurl }}{{ paper.url }}">[bib]</a>
31
+ <hr />
32
+ ```
33
+ 6. Close all the if statements and the fir loop
34
+ ```
35
+ {% endif %}
36
+ {% endif %}
37
+ {% endfor %}
38
+ ```
39
+
40
+ ### Bibs
41
+
42
+ The [bib template](_layouts/bib.html) is more self explanatory. For each paper, it just dumps all of the information from the database into bib format.
43
+
44
+ If you do not have access to this repository, you can email someone who committed recently. You should be able to find my email [on my GitHub profile](https://github.com/mwt).
@@ -0,0 +1 @@
1
+ @import "list.scss";
data/_layouts/bib.html ADDED
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html><head></head><body><pre><code>@article{% raw %}{{% endraw %}{{page.id_key}},
3
+ title = "{{ page.title }}",
4
+ author = "{{ page.authors | join: " and "}}"{% if page.journal %},
5
+ journal = "{{ page.journal }}"{% endif %}{% if page.vol %},
6
+ volume = "{{ page.vol }}"{% endif %}{% if page.num %},
7
+ number = "{{ page.num }}"{% endif %}{% if page.pages %},
8
+ pages = "{{ page.pages }}"{% endif %}{% if page.year %},
9
+ year = "{{ page.year }}"{% endif %}{% if page.pub %},
10
+ publisher = "{{ page.pub }}"{% endif %}
11
+ {% raw %}}{% endraw %}</code></pre></body></html>
@@ -0,0 +1,10 @@
1
+ ---
2
+ # Jekyll layout that compresses HTML
3
+ # v3.1.0
4
+ # http://jch.penibelst.de/
5
+ # © 2014–2015 Anatol Broder
6
+ # MIT License
7
+ ---
8
+
9
+ {% capture _LINE_FEED %}
10
+ {% endcapture %}{% if site.compress_html.ignore.envs contains jekyll.environment or site.compress_html.ignore.envs == "all" %}{{ content }}{% else %}{% capture _content %}{{ content }}{% endcapture %}{% assign _profile = site.compress_html.profile %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}</{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if _profile and _endings %}{% assign _profile_endings = _content | size | plus: 1 %}{% endif %}{% for _element in site.compress_html.startings %}{% capture _start %}<{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _start %}{% endfor %}{% if _profile and site.compress_html.startings %}{% assign _profile_startings = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.comments == "all" %}{% assign _comments = "<!-- -->" | split: " " %}{% else %}{% assign _comments = site.compress_html.comments %}{% endif %}{% if _comments.size == 2 %}{% capture _comment_befores %}.{{ _content }}{% endcapture %}{% assign _comment_befores = _comment_befores | split: _comments.first %}{% for _comment_before in _comment_befores %}{% if forloop.first %}{% continue %}{% endif %}{% capture _comment_outside %}{% if _carry %}{{ _comments.first }}{% endif %}{{ _comment_before }}{% endcapture %}{% capture _comment %}{% unless _carry %}{{ _comments.first }}{% endunless %}{{ _comment_outside | split: _comments.last | first }}{% if _comment_outside contains _comments.last %}{{ _comments.last }}{% assign _carry = false %}{% else %}{% assign _carry = true %}{% endif %}{% endcapture %}{% assign _content = _content | remove_first: _comment %}{% endfor %}{% if _profile %}{% assign _profile_comments = _content | size | plus: 1 %}{% endif %}{% endif %}{% assign _pre_befores = _content | split: "<pre" %}{% assign _content = "" %}{% for _pre_before in _pre_befores %}{% assign _pres = _pre_before | split: "</pre>" %}{% assign _pres_after = "" %}{% if _pres.size != 0 %}{% if site.compress_html.blanklines %}{% assign _lines = _pres.last | split: _LINE_FEED %}{% capture _pres_after %}{% for _line in _lines %}{% assign _trimmed = _line | split: " " | join: " " %}{% if _trimmed != empty or forloop.last %}{% unless forloop.first %}{{ _LINE_FEED }}{% endunless %}{{ _line }}{% endif %}{% endfor %}{% endcapture %}{% else %}{% assign _pres_after = _pres.last | split: " " | join: " " %}{% endif %}{% endif %}{% capture _content %}{{ _content }}{% if _pre_before contains "</pre>" %}<pre{{ _pres.first }}</pre>{% endif %}{% unless _pre_before contains "</pre>" and _pres.size == 1 %}{{ _pres_after }}{% endunless %}{% endcapture %}{% endfor %}{% if _profile %}{% assign _profile_collapse = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.clippings == "all" %}{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}{% else %}{% assign _clippings = site.compress_html.clippings %}{% endif %}{% for _element in _clippings %}{% assign _edges = " <e;<e; </e>;</e>;</e> ;</e>" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{% if _profile and _clippings %}{% assign _profile_clippings = _content | size | plus: 1 %}{% endif %}{{ _content }}{% if _profile %} <table id="compress_html_profile_{{ site.time | date: "%Y%m%d" }}" class="compress_html_profile"> <thead> <tr> <td>Step <td>Bytes <tbody> <tr> <td>raw <td>{{ content | size }}{% if _profile_endings %} <tr> <td>endings <td>{{ _profile_endings }}{% endif %}{% if _profile_startings %} <tr> <td>startings <td>{{ _profile_startings }}{% endif %}{% if _profile_comments %} <tr> <td>comments <td>{{ _profile_comments }}{% endif %}{% if _profile_collapse %} <tr> <td>collapse <td>{{ _profile_collapse }}{% endif %}{% if _profile_clippings %} <tr> <td>clippings <td>{{ _profile_clippings }}{% endif %} </table>{% endif %}{% endif %}
@@ -0,0 +1,18 @@
1
+ ---
2
+ layout: compress
3
+ ---
4
+ <!DOCTYPE html>
5
+ <html lang="{{ page.lang | default: site.lang | default: "en" }}">
6
+ <head>
7
+ <title>{{ site.title }}</title>
8
+ <style>
9
+ {% capture scss_sheet %}{% include style.scss %}{% endcapture %}
10
+ {{ scss_sheet | scssify }}
11
+ </style>
12
+ </head>
13
+ <body>
14
+ <main>
15
+ {{ content }}
16
+ </main>
17
+ </body>
18
+ </html>
@@ -0,0 +1,47 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ {%- assign theory = site.pages | where_exp: "item", "item.dir == '/'" | sort: 'url' | shift -%}
6
+ {%- assign dt = site.pages | where_exp: "item", "item.url contains 'decision-theory'" | sort: 'url' -%}
7
+ {%- assign gt = site.pages | where_exp: "item", "item.url contains 'game-theory'" | sort: 'url' -%}
8
+ <h1>{{ site.title }}</h1>
9
+ <nav class="sidenav">
10
+ <ul>
11
+ {%- for sitepage in theory -%}
12
+ <li>
13
+ {%- case sitepage.title -%}
14
+ {%- when "Decision Theory" -%}
15
+ {%- for sitepage in dt -%}
16
+ {%- if forloop.first == true -%}
17
+ <a href="{{ sitepage.url | absolute_url }}">{{ sitepage.title }}</a>
18
+ <ul>
19
+ {%- else -%}
20
+ <li>
21
+ <p><a href="{{ sitepage.url | absolute_url }}">{{ sitepage.title }}</a></p>
22
+ </li>
23
+ {%- endif -%}
24
+ {%- endfor -%}
25
+ </ul>
26
+ {%- when "Game Theory" -%}
27
+ {%- for sitepage in gt -%}
28
+ {%- if forloop.first == true -%}
29
+ <a href="{{ sitepage.url | absolute_url }}">{{ sitepage.title }}</a>
30
+ <ul>
31
+ {%- else -%}
32
+ <li>
33
+ <p><a href="{{ sitepage.url | absolute_url }}">{{ sitepage.title }}</a></p>
34
+ </li>
35
+ {%- endif -%}
36
+ {%- endfor -%}
37
+ </ul>
38
+ {%- else -%}
39
+ <p><a href="{{ sitepage.url | absolute_url }}">{{ sitepage.title }}</a></p>
40
+ {%- endcase -%}
41
+ </li>
42
+ {%- endfor -%}
43
+ </ul>
44
+ </nav>
45
+ <div class="content">
46
+ {{ content }}
47
+ </div>
@@ -0,0 +1,13 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+ {%- assign sorted = site.papers | sort:"year" | reverse -%}
5
+ {%- for paper in sorted -%}
6
+ {%- if page.category == nil or paper.categories contains page.category -%}
7
+ {%- if page.tag == nil or paper.tags contains page.tag -%}
8
+ <p>
9
+ <a href="{{ site.url }}{{ site.baseurl }}/pdf/{{ paper.pdf }}" target="_blank">{{ paper.title }}</a>{% if paper.authors.size > 1 %} (with {{ paper.authors | where_exp:"item", "item != 'Dekel, Eddie'" | join: " and "}}){% endif %}, {% if paper.journal %}<em>{{ paper.journal }}</em>, {% endif %}{{ paper.year }} <a href="{{ paper.url | absolute_url }}" target="_blank">[bib]</a>
10
+ </p>
11
+ {%- endif -%}
12
+ {%- endif -%}
13
+ {%- endfor -%}
data/_sass/list.scss ADDED
@@ -0,0 +1 @@
1
+ // insert styling here
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-citations
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Matthew Thomas
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-02-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.5'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '3.5'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: bundler
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ description:
48
+ email:
49
+ - matthew.thomas@northwestern.edu
50
+ executables: []
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - LICENSE
55
+ - README.md
56
+ - _includes/style.scss
57
+ - _layouts/bib.html
58
+ - _layouts/compress.html
59
+ - _layouts/default.html
60
+ - _layouts/home.html
61
+ - _layouts/list.html
62
+ - _sass/list.scss
63
+ homepage: https://github.com/nucet/jekyll-citations
64
+ licenses:
65
+ - MIT
66
+ metadata:
67
+ plugin_type: theme
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubygems_version: 3.0.3
84
+ signing_key:
85
+ specification_version: 4
86
+ summary: A citation generator and organizer using jekyll.
87
+ test_files: []