pcooksey/bibtex-js

Linking PDF and sorting by authors upon clicking author name

Closed this issue · 4 comments

As shown here, after each entry, it would be great to provide a link to a local file whose file name follows the BibTex id, or some other variable in or based on some bibtex property (stored in ./static/files/pdf/knuth1970a.pdf)

Also, in your Demo website, the list of authors are shown as a drop down menu that would easily get too large. Would it be possible to make the author name's into links, so when you click on one, you show items only by that author?

The above features are implemented here, obviously using PHP:

http://cocosci.berkeley.edu/publications.php

For accessing variables, it is implemented like this:
<a class="bibtexVar" href="./static/files/pdf/+BIBTEXKEY+.pdf" extra="BIBTEXKEY">
More information is found in the wiki here.

With the search bar you can just type in the name of the author.
<input type="text" class="bibtex_search" id="searchbar" placeholder="Search publications">

But if you really want links around each author I can use the same functionality as the search bar. Though I don't see an easy way to undo the hiding of the other bibtex entries other than reloading the page, which isn't exactly ideal.

Checkout the new branch linkedAuthors. Use the code below:
<span class="author" extra="linked"></span>
This will add links to the authors that function similar to the PHP code you provided.
You may want a reset button like I have in the full demo (it uses the function Reset() that can be found in the html page.

Let me know what you think.

After quite a while there is now a solution that can be written in html and opens up many opportunities for customization on the users part. Below is an example that will create <a> around each author's name and when clicked with hide any bibtex entry that does not contain that author's name.

<!-- Note: Spacing out for clarity normally keep all span elements on the same line -->
<div class="bibtex_template">
  <div class="if author">
    <span class="author">
      <a onclick="(new BibTeXSearcher()).searcher(this.innerText || this.textContent, true)">
        <span class="first"></span>
        <span class="last"> </span>
      </a>
    </span>
  </div>
</div>

As its been quite awhile, I am closing this issue. If you have any further issues please reopen the issue.

Thx much! I'll now convince my lab site to switch to this.