GithubHelp home page GithubHelp logo

arunpersaud / lektor-bibtex-support Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 6 KB

Bibtex file support to include publication list. Multiple bibtex files and filtering by name, year, tag, and label are supported.

License: MIT License

Python 76.26% HTML 23.74%

lektor-bibtex-support's Introduction

Lektor Bibtex Plugin

The plugin allows adding a list of publications generated from bibtex files to a page.

Enabling the plugin

To enable the plugin add this to your project file:

[packages]
lektor-bibtex-support = 0.1

Configuring

Create a file configs/bibtex-support.ini with a section called Bibtex. Define a variable files that is a white space separated list of bibtex files. Put these files into the assets directory of your project.

[Bibtex]
files = A.bib B.bib

Optionally you can also create a template file that should leave in the template directory to render the bibtex entries. If you skip this entry a default template will be used that sorts the entries by year.

Usage

You can add the the publication anywhere in your jinja template by calling

{{ list_publications(name=name, tag=tag, year=year, labels=labels, fname=fname)|safe }}

The arguments are optional and can be used for filtering.

By name: the name has to show up in the author list to be included

by year: only publications from this year

labels: white space separated list of bibtex labels (the name of each entry in the bibtex file)

fname: white space separated list files to search (by default all files will be searched)

Javascript

For the default template, you can also add the following javascript to show some entries if you have a long list (relies on jquery):

$(document).ready(function()
	   {
	      $(".BIBTeX").hide();
	      $(".BIBTeXtoggle").click( function () {
		  $(this).parent().children(".BIBTeX").toggle(300);
		  return false;
		});
	      $(".BIBYear").hide();
	      $(".BIBYear:first").show();
	      $(".BIBYearheader").click( function () {
		  $(this).parent().children(".BIBYear").toggle(300);
		  return false;
		});
	      $(".bibshowall").click( function () {
		  $(".BIBYear").show();
		});
	      $(".bibhideall").click( function () {
		  $(".BIBYear").hide();
		  $(".BIBYear:first").show();
		});
           });

lektor-bibtex-support's People

Contributors

arunpersaud avatar

Watchers

 avatar  avatar

Forkers

znbiz

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.