Coder Social home page Coder Social logo

nucet / jekyll-citations Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 15 KB

A citation generator and organizer using Jekyll

Home Page: https://rubygems.org/gems/jekyll-citations/

License: BSD 2-Clause "Simplified" License

HTML 88.55% Ruby 10.89% SCSS 0.57%
papers citation-generator bibs

jekyll-citations's Introduction

Citation generator

How it works

You can see the template for the bibliography here and the template for the lists here.

Lists

Basically, for every tag (eg. reputation), the list template 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.

I describe the steps below

  1. Sort all papers in reverse chronological order
    {% assign sorted = site.papers | sort:"year" | reverse %}
    
  2. Start a for loop over the sorted papers
    {% for paper in sorted %}
    
  3. Continue if the page does not filter by category (Decision Theory/Game Theory) or if the category matches the filter.
    {% if page.category == nil or paper.categories contains page.category %}
    
  4. same thing but with tags (reputation, mechanism design, etc)
    {% if page.tag == nil or paper.tags contains page.tag %}
    
  5. Run the specific HTML to be repeated in the list using variables from the database. It also checks to see if the paper is single authored and reacts accordingly.
    <p>
        <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 != site.citations.author" | join: " and "}})
        {%- endif %},
        {% if paper.journal -%}
            <em>{{ paper.journal }}</em>,
        {%- endif %}
        {{ paper.year }}
        <a href="{{ paper.url | absolute_url }}" target="_blank">[bib]</a>
    </p>
    
  6. Close all the if statements and the fir loop
    {% endif %}
    {% endif %}
    {% endfor %}
    

Bibs

The bib template is more self explanatory. For each paper, it just dumps all of the information from the database into bib format.

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.

jekyll-citations's People

Contributors

mwt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mwt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.