GithubHelp home page GithubHelp logo

pelican-bibtex's People

Contributors

andreas-h avatar jvkersch avatar vene avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pelican-bibtex's Issues

upload tarball to PyPI

A PyPI entry for pelican_bibtex exists, but no tarball has been uploaded, so

$ pip install pelican_bibtex
Collecting pelican_bibtex
  Could not find a version that satisfies the requirement pelican_bibtex (from versions: )
No matching distribution found for pelican_bibtex

url key

It would be a good idea in my opinion to support the url key, for linking for example to an arXiv page.

Improve rendering

HTML rendering is pretty bad. Evaluate how much it improves in the dev version of pybtex.

Grouping by type of publications

Nice work for this plugin ! I helped me a lot !

I took your plugin for my website, but I wanted to group the publication by types (Journal, Conference, ... and so on). So, I did a very little modification to your plugin to get this feature (sorry for my Python, I do not program often in this language, this code must certainly be improved that's why I didn't do a pull request):

diff --git a/pelican_bibtex.py b/pelican_bibtex.py
index be12dda..42e7f00 100644
--- a/pelican_bibtex.py
+++ b/pelican_bibtex.py
@@ -19,6 +19,28 @@ from pelican import signals
 __version__ = '0.2'


+def entrytype(label):
+    entries = {
+        'book'          : (0, 'Book'),
+        'incollection'  : (1, 'Book in a Collection'),
+        'booklet'       : (2, 'Booklet'),
+        'proceedings'   : (3, 'Proceedings'),
+        'inbook'        : (4, 'Chapter in a Book'),
+        'article'       : (5, 'Journal'),
+        'inproceedings' : (6, 'Conference'),
+        'phdthesis'     : (7, 'PhD Thesis'),
+        'masterthesis'  : (8, 'Master Thesis'),
+        'techreport'    : (9, 'Technical Report'),
+        'manual'        : (10, 'Manual'),
+        'misc'          : (11, 'Miscellaneous'),
+        'unpublished'   : (12, 'Unpublished'),
+    }
+
+    if label in entries:
+        return entries[label]
+    else:
+        return label
+
 def add_publications(generator):
     """
     Populates context with a list of BibTeX publications.
@@ -69,6 +91,7 @@ def add_publications(generator):
     for formatted_entry in formatted_entries:
         key = formatted_entry.key
         entry = bibdata_all.entries[key]
+        type = entry.type
         year = entry.fields.get('year')
         pdf = entry.fields.pop('pdf', None)
         slides = entry.fields.pop('slides', None)
@@ -80,13 +103,14 @@ def add_publications(generator):
         Writer().write_stream(bibdata_this, bib_buf)
         text = formatted_entry.text.render(html_backend)

-        publications.append((key,
-                             year,
-                             text,
-                             bib_buf.getvalue(),
-                             pdf,
-                             slides,
-                             poster))
+        publications.append({'entry'  : entrytype(type),
+                             'key'    : key,
+                             'year'   : year,
+                             'text'   : text,
+                             'bibtex' : bib_buf.getvalue(),
+                             'pdf'    : pdf,
+                             'slides' : slides,
+                             'poster' : poster})

      generator.context['publications'] = publications

With this version, the HTML template can be as follow:

    {% for group in publications|groupby('entry') %}
    <h2>{{ group.grouper[1] }}</h2>
    <ul>
      {% for publication in group.list|sort(attribute='year')|reverse %}
      <li id="{{ publication.key }}">{{ publication.text }}
        [<a href="javascript:disp('{{ publication.bibtex|replace('\n', '<br>')|escape }}');">Bibtex</a>]
        {% for label, target in [('PDF', publication.pdf), ('Slides', publication.slides), ('Poster', publication.poster)] %}
         {{ "[<a href=\"publications/%s\">%s</a>]" % (target, label) if target }}
        {% endfor %}
      </li>
      {% endfor %}
    </ul>
     {% endfor %}

I don't know if you can find something useful in what I did, but if this is the case feel free to use and/or modify my code !

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.