Skip to content

Instantly share code, notes, and snippets.

Sylvester Keil inukshuk

Block or report user

Report or block inukshuk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@inukshuk
inukshuk / _config.yml
Created Jan 21, 2015
Jekyll-Scholar: Highlight Author
View _config.yml
gems:
- 'jekyll/scholar'
scholar:
bibliography_template: "{{ reference | replace_first: 'Zelle, R. M.', '<b>Zelle, R. M.</b>' }}"
View style-gen.rb
require 'anystyle'
require 'citeproc/ruby'
require 'csl/styles'
# Load all dependent CSL styles and create a Renderer
# Those should be cached!
styles = CSL::Style.list.map { |id| CSL::Style.load id }.reject { |s| s.bibliography.nil? }
cp = CiteProc::Ruby::Renderer.new
# Parse a reference to CSL/JSON
@inukshuk
inukshuk / README.md
Last active Jun 3, 2017
Jekyll-Scholar Bibliography Template Example
View README.md

This is a sample Jekyll-Scholar bibliography template. The file bibliography.html should be placed in the _layouts directory. Furthermore, this assumes you have a ./pdf directory: this directory contains all you PDFs or Postscripts (possibly in sub-directories of ./pdf), e.g.: ./pdf/Bartlett-2010-ICML.pdf and ./pdf/talks/Wood-2004-EMBS.pdf both work. You can specify the repository root folder using the repository configuration option.

The bibliography template assumes you have Bootstrap configured on your site.

@inukshuk
inukshuk / predict.rb
Last active Apr 10, 2017
Citation Style Predicor
View predict.rb
#!/usr/bin/env ruby
require 'csl/styles'
require 'citeproc/ruby'
require 'httparty'
require 'thread'
API_KEY = '' # Add your key here!
exit if API_KEY.empty?
@inukshuk
inukshuk / Gemfile
Created Jan 27, 2014
Experiment with the CiteProc-Ruby pre-release!
View Gemfile
source 'https://rubygems.org'
gem 'citeproc', :git => 'https://github.com/inukshuk/citeproc.git'
gem 'citeproc-ruby', :git => 'https://github.com/inukshuk/citeproc-ruby.git'
gem 'csl', :git => 'https://github.com/inukshuk/csl-ruby.git'
gem 'nokogiri' # not required: speeds up XML parsing
gem 'edtf' # not required: more advanced name parsers
gem 'bibtex-ruby'
@inukshuk
inukshuk / analyze.rb
Created May 3, 2013
Analyze CSL Styles Strip-Periods
View analyze.rb
require 'csl'
# Set the styles root directory
CSL::Style.root = '/Users/sylvester/Work/citeproc/styles'
# Set the locales root directory
CSL::Locale.root = '/Users/sylvester/Work/citeproc/locales'
# Either load all styles or those passed from command line.
# Calling the script with no arguments will go though all
@inukshuk
inukshuk / generate_dependent_style.rb
Last active Dec 15, 2015
Generate dependent CSL style
View generate_dependent_style.rb
require 'csl' # gem install csl --pre
style = CSL::Style.new do |s|
s['class'] = 'in-text'
s['default-locale'] = 'en-US'
s.title = 'Natura'
s.id = 'http://www.zotero.org/styles/natura.csl'
@inukshuk
inukshuk / result.html
Created Jul 15, 2012
CiteProc APA Style Example
View result.html
<div class="csl-bib-body">
  <div class="csl-entry">Silva, G. M. H. da, Rademaker, A., Vasconcelos, D. R. de, Amaral, F. N. do, Martins, C. B., Costa, V., &#38; Haeusler, E. H. (2007). Dealing with the Formal Analysis of Information Security Policies through Ontologies: A Case Study. In <i>Third Australasian Ontology Workshop (AOW 2007)</i>. Sydney: Australian Computer Society.</div>
</div>
@inukshuk
inukshuk / output
Created Nov 20, 2011
Pandoc CSL Tests for citeproc-js
View output
require 'bibtex'
require 'citeproc/js'
repo = 'https://raw.github.com/citation-style-language/styles/master/'
data = BibTeX.open('http://johnmacfarlane.net/pandoc/csltest/biblio.bib')
# styles to test
styles = %w{ aaa apa ama }
styles.each do |style|
View gist:1329348
M = 'M'
o = 'o'
X = 'X'
world = [
[o,o,o,o,o,M,o,o,o,o,o],
[o,o,o,o,M,M,o,o,o,o,o],
[o,o,o,o,o,M,o,o,M,M,o],
[o,o,o,M,o,M,o,o,o,M,o],
[o,o,o,o,o,M,M,o,o,o,o],
You can’t perform that action at this time.