jekyll-scholar 5.14.0 → 5.14.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd0dce701856f7a79d97fa09d8588178990d844d2f7d9ae119625c1cf38edf35
4
- data.tar.gz: 0ed8d1968b07c393f098640e16c77a4265672832686fc4fa455acc36eec874d8
3
+ metadata.gz: dc3a085adf1accd384777754f269e3d5d367d7bd460c561a381aa5b058cae5d8
4
+ data.tar.gz: a24a018883dd8eb5d468cfe79d778aa284a21f9c8edcf2fa0eafdeb6c3df2ba3
5
5
  SHA512:
6
- metadata.gz: f3b2b3aa1e84ebfdcc4013162c37f61b447461ef823448108d119a71e35f15099c9dc56c6ab35ab61b2b9d06a27ddb406f1e98a23e339a4b3f9aecfc1c9af324
7
- data.tar.gz: ef5bff524cd70702b239bd4e260afe8907fd54139b02079af87eed5432ebdc4dfe7fe339cc2d0757380168935e6e30f4dd3bd6345fec0671c71fbd263d4ea2f7
6
+ metadata.gz: 9caadbd232a0fccbf5b43e28c8de9d078978ee8a19aea22c774fffce183a3d0b128abae12a68907fbc02b9989186eb98283f050ba2e9ee5d59300f3f98eaa3c0
7
+ data.tar.gz: 98692f7f538e0dc2082ffdea20f3070538b5182beee571324b558cfd3ee10df31ad28856515682d093859674b7a33bb0e7f38200a2208bb63652085948dfcdf4
data/README.md CHANGED
@@ -8,7 +8,6 @@ and gives your blog posts citation super-powers.
8
8
 
9
9
  [![Build Status](https://travis-ci.org/inukshuk/jekyll-scholar.png?branch=master)](https://travis-ci.org/inukshuk/jekyll-scholar)
10
10
  [![Coverage Status](https://coveralls.io/repos/inukshuk/jekyll-scholar/badge.png)](https://coveralls.io/r/inukshuk/jekyll-scholar)
11
- [![Dependency Status](https://gemnasium.com/inukshuk/jekyll-scholar.png)](https://gemnasium.com/inukshuk/jekyll-scholar)
12
11
 
13
12
  Already using Jekyll-Scholar and interested to help out? Please get in touch with us if you would like to become a maintainer!
14
13
 
@@ -24,10 +23,10 @@ Or add it to your `Gemfile`:
24
23
  ### Github Pages
25
24
 
26
25
  Note that it is not possible to use this plugin with the
27
- [default Github pages workflow](https://help.github.com/articles/using-jekyll-with-pages/).
26
+ [default Github pages workflow](https://help.github.com/articles/using-jekyll-with-pages/).
28
27
  Github does not allow any but a few select plugins to run for security reasons,
29
28
  and Jekyll-Scholar is not among them.
30
- You will have to generate your site locally and push the results to the `master` resp. `gh-pages`
29
+ You will have to generate your site locally and push the results to the `master` resp. `gh-pages`
31
30
  branch of your site repository.
32
31
  You can keep sources, configuration and plugins in a separate branch; see e.g.
33
32
  [here](http://davidensinger.com/2013/07/automating-jekyll-deployment-to-github-pages-with-rake/)
@@ -65,7 +64,7 @@ description of all options and their defaults, see
65
64
 
66
65
  | Option | Default | Description |
67
66
  |--------|---------|-------------|
68
- | `style` | `apa` | Indicates the style used for the bibliography and citations. You can use any style that ships with [CiteProc-Ruby](https://github.com/inukshuk/citeproc-ruby) by name (e.g., apa, mla, chicago-fullnote-bibliography) which is usually the filename as seen [here](https://github.com/citation-style-language/styles) without the `.csl` ending; note that you have to use `dependent/style` if you want to use one from that directory. Alternatively you can add a link to any CSL style (e.g., you could link to any of the styles available at the official [CSL style repository](https://github.com/citation-style-language/styles)). |
67
+ | `style` | `apa` | Indicates the style used for the bibliography and citations. You can use any style that ships with [CiteProc-Ruby](https://github.com/inukshuk/citeproc-ruby) by name (e.g., apa, mla, chicago-fullnote-bibliography) which is usually the filename as seen [here](https://github.com/citation-style-language/styles) without the `.csl` ending; note that you have to use `dependent/style` if you want to use one from that directory. Alternatively you can add a link to any CSL style (e.g., you could link to any of the styles available at the official [CSL style repository](https://github.com/citation-style-language/styles)). |
69
68
  | `locale` | `en` | Defines what language to use when formatting your references (this typically applies to localized terms, e.g., 'Eds.' for editors in English). |
70
69
  | `source` | `./_bibliography` | Indicates where your bibliographies are stored. |
71
70
  | `bibliography` | `references.bib` | Indicates the name of your default bibliography. For best results, please ensure that your bibliography is encoded as ASCII or UTF-8. A string that contains a `*` will be passed to `Dir::glob`, so `**/*.bib{,tex}` will find all files named `*.bib` and `*.bibtex` under `source`. |
@@ -169,9 +168,9 @@ applied). Limiting entries is disabled if grouping is active.
169
168
 
170
169
  ### Return number of publications in bibliography
171
170
 
172
- The `bibliography_count` returns the number of items that would be
173
- rendered in a bibliography. This tag accepts the same parameters as the
174
- `bibliography` tag.
171
+ The `bibliography_count` returns the number of items that would be
172
+ rendered in a bibliography. This tag accepts the same parameters as the
173
+ `bibliography` tag.
175
174
 
176
175
  {% bibliography_count -f references --query @book[year <=2000] %}
177
176
 
@@ -302,16 +301,16 @@ of the items you wish to quote separated by spaces. For example,
302
301
 
303
302
  #### Citations when there's more than one bibliography
304
303
 
305
- Let's return to the example above where you have two bibliographies stored
304
+ Let's return to the example above where you have two bibliographies stored
306
305
  in `_bibliography/books.bib` and `_bibliography/papers.bib`. We also must
307
306
  have the main bibliography, e.g., `_bibliography/references.bib`. As we
308
307
  know from above, it's possible to use bibliographies other than the main
309
- bibliography by calling `{% bibliography --file books %}` or
310
- `{% bibliography --file papers %}`.
308
+ bibliography by calling `{% bibliography --file books %}` or
309
+ `{% bibliography --file papers %}`.
311
310
 
312
- Though what if we want to cite an article that's not in the main bibliography?
313
- We use the same approach as above; to cite an article in the `books.bib`
314
- bibliography, we simply call `{% cite ruby --file books %}`
311
+ Though what if we want to cite an article that's not in the main bibliography?
312
+ We use the same approach as above; to cite an article in the `books.bib`
313
+ bibliography, we simply call `{% cite ruby --file books %}`
315
314
 
316
315
  #### Suppressing author names
317
316
 
@@ -423,6 +422,15 @@ assigned unique identifiers linking to the respective references
423
422
  section, although both posts will be rendered into a single HTML
424
423
  document.
425
424
 
425
+ #### Add a custom class for the citation reference
426
+ By default Jekyll Scholar generate a link with a class:
427
+
428
+ <a href="#ruby" class="citation">(Derrida, 1975)</a>
429
+
430
+ You can custom this class in your configuration:
431
+
432
+ scholar:
433
+ cite_class: citation
426
434
 
427
435
  ### File Repositories
428
436
 
@@ -364,6 +364,53 @@ Feature: BibTeX
364
364
  And I should not see "<i>The Ruby Programming Language</i>" in "_site/scholar.html"
365
365
  And I should see "<i>Smalltalk Best Practice Patterns</i>" in "_site/scholar.html"
366
366
 
367
+ @filter @regex
368
+ Scenario: Filter using interpolated query variable
369
+ Given I have a scholar configuration with:
370
+ | key | value |
371
+ | source | ./_bibliography |
372
+ And I have a "_bibliography" directory
373
+ And I have a file "_bibliography/references.bib":
374
+ """
375
+ @article{testa,
376
+ title={test1},
377
+ author={Albert, Alex A and Booth, Brian and Cook, Cathy},
378
+ journal={Irrelevant},
379
+ year={2018}
380
+ }
381
+ @article{testb,
382
+ title={test2},
383
+ author={Booth, Brian and Albert, Alex and Cook, Cathy},
384
+ journal={Irrelevant},
385
+ year={2018}
386
+ }
387
+ @article{testc,
388
+ title={test3},
389
+ author={Cook, Cathy and Booth, Brian and Albert, Alex},
390
+ journal={Irrelevant},
391
+ year={2018}
392
+ }
393
+ @article{testd,
394
+ title={test4},
395
+ author={Done, Daniel},
396
+ journal={Irrelevant},
397
+ year={2018}
398
+ }
399
+ """
400
+ And I have a page "scholar.html":
401
+ """
402
+ ---
403
+ ---
404
+ {% bibliography --query @*[author ~= \bAlbert\b] %}
405
+ """
406
+ When I run jekyll
407
+ Then the _site directory should exist
408
+ And the "_site/scholar.html" file should exist
409
+ And I should see "test1" in "_site/scholar.html"
410
+ And I should see "test2" in "_site/scholar.html"
411
+ And I should see "test3" in "_site/scholar.html"
412
+ And I should not see "test4" in "_site/scholar.html"
413
+
367
414
  @tags @bibliography @prefix
368
415
  Scenario: A Prefixed Bibliography
369
416
  Given I have a scholar configuration with:
@@ -58,6 +58,8 @@ module Jekyll
58
58
 
59
59
  'query' => '@*',
60
60
 
61
+ 'cite_class' => 'citation',
62
+
61
63
  'type_names' => {
62
64
  'article' => 'Journal Articles',
63
65
  'book' => 'Books',
@@ -147,7 +147,7 @@ module Jekyll
147
147
  def bibtex_paths
148
148
  @bibtex_paths ||= bibtex_files.map { |file|
149
149
  interpolated_file = interpolate file
150
- extend_path interpolated_file
150
+ extend_path interpolated_file
151
151
  }
152
152
  end
153
153
 
@@ -488,7 +488,7 @@ module Jekyll
488
488
  :filters => [Jekyll::Filters]
489
489
  }
490
490
  )
491
- # process the generated reference with Liquid, to get the same behaviour as
491
+ # process the generated reference with Liquid, to get the same behaviour as
492
492
  # when it is used on a page
493
493
  Liquid::Template.parse(tmp).render(
494
494
  site.site_payload,
@@ -656,7 +656,7 @@ module Jekyll
656
656
  end
657
657
  end
658
658
 
659
- link_to link_target_for(keys[0]), render_citation(items)
659
+ link_to link_target_for(keys[0]), render_citation(items), {class: config['cite_class']}
660
660
  end
661
661
 
662
662
  def cite_details(key, text)
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  class Scholar
3
- VERSION = '5.14.0'.freeze
3
+ VERSION = '5.14.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-scholar
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.14.0
4
+ version: 5.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-09 00:00:00.000000000 Z
11
+ date: 2019-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll