Bibliographies in forum posts (and on the web)

About openscience.femtolab.ca, and admin + technical notes.


Post Reply
forumAdmin
Site Admin
Posts: 11
Joined: Fri May 22, 2020 7:51 pm
Location: Ottawa
Contact:

Bibliographies in forum posts (and on the web)

Post by forumAdmin »

Image

BibBase renders a supplied BibTex file to an interactive HTML page, see here for example.

Our original aim here was to use Bibbase for embedded HTML bibs, from a standard .bib file. However, I can't seem to get this to render in posts in a satisfactory manner, so for now there are a couple of quick and dirty methods implemented, illustrated below.

BibBase link

To link to a file directly, you can generate a link from the BibBase home page, or manually format a BibBase link, which includes the source .bib file in the URL, e.g. http://bibbase.org/show?bib=http://femtolab.ca/pubs/group_2018.bib

There's also a BBcode set, [bibBaseLink], and accessible via the menu when posting, which does some of the formatting and sets a link to the relevant BibBase page.

Here's an example to illustrate the mechanics...

BibBase tests (Bibbase link)

Where the BBCode (as written in this post) is:

Code: Select all

[bibBase=http://femtolab.ca/pubs/group_2018.bib]BibBase tests[/bibBase]

... and is replaced with the HTML:

Code: Select all

<a href="http://bibbase.org/show?bib=http://femtolab.ca/pubs/group_2018.bib" title="Bibbase link" target="_blank" class="postlink" rel="noreferrer">BibBase tests (Bibbase link)</a>

The generic prototype is:

Code: Select all

[bibBaseLink={URL}]{TEXT}[/bibBaseLink]

where the URL points to a bibtex (.bib) file.

... and is replaced with the HTML:

Code: Select all

<a href="http://bibbase.org/show?bib={URL}" title="Bibbase link" target="_blank">{TEXT} (Bibbase link)</a>

BibBase iFrame

Using an iFrame sort-of works for rendering the BibBase output in a post, but is a little clunky. This is set by [bibBaseFrame] (also on the post toolbar). Here's an example...

Where the code is

Code: Select all

[bibBaseFrame=http://femtolab.ca/pubs/group_2018.bib]

And the HTML

Code: Select all

<iframe src="https://bibbase.org/show?bib=http://femtolab.ca/pubs/group_2018.bib" width="100%" height="600"></iframe>

(Note the fixed width and height here - a quick hack to get things working, but ugly.)

Additional notes

  • Currently this doesn't seem to work for OSF download or Github raw file links - not sure why, but get a "bad gateway" error message.
  • BibBase can take info directly from Mendeley or Zotero. In both cases, you'll need to authorise BibBase access via the webpage, which will provide you with a suitable BibBase page.
    • For Mendeley, this only supports 'My Publications' and groups. Here's an example.
    • From Zotero, here's an example. In principle this works for all use cases, but due to API limitation this might fail for "large" libraries - see comment thread here. For further custom options, see additional notes below.

Other methods...?

Currently the preferred BibBase method, using <script>, doesn't seem to render in posts, although I'm not sure why.

If you have suggestions, or alternatives, please post below...


Image
For Zotero users, here's a couple of methods...

BibBase + Zotero

You can pull directly from Zotero if you already have your user name, API key (get this from the BibBase homepage and Zotero link option) and Zotero collection ID (you can find this in the web library). For pulling from Zotero, manually formatting a link is a bit ugly, as is a BBCode implementation... but it is pretty flexible. This follows the format [bibBaseZotero={ID},{API key},{collection ID}]{Link text}[/bibBaseZotero]

Here's an example:

Sample BibBase-Zotero link (Bibbase link)

Where the code in the post is

Code: Select all

[bibBaseZotero=6669448,IuvTawSQKx1x8TRyHfK2p1i4,EQEB39KY]Sample BibBase-Zotero link[/bibBaseZotero]

And the generated HTML

Code: Select all

<a href="https://bibbase.org/show?bib=https%3A%2F%2Fapi.zotero.org%2Fusers%2F6669448%2Fcollections%2FEQEB39KY%2Fitems%3Fkey%3DIuvTawSQKx1x8TRyHfK2p1i4%26format%3Dbibtex%26limit%3D100&amp;msg=embed" title="Bibbase link" target="_blank" class="postlink" rel="noreferrer">Sample BibBase-Zotero link (Bibbase link)</a>

Groups

Sharing bibliographies via BibBase, as noted above, is one approach. In some cases, Zotero's group libraries are quite handy, especially if you want to share items in nested collections, allow comments, and allow open editing (requires Zotero account).

Here's an example group webpage, and the full library, on the Zotero platform.

For forum use, there are again BBCodes, e.g. this BibBase Group Library link example (Bibbase link)

Where the code in the post is

Code: Select all

[bibBaseZoteroG=PHzot2020,2515309]BibBase Group Library link example[/bibBaseZoteroG]

Note that for groups via BibBase the link format is a little different, with the link format https://bibbase.org/zotero-group/:userID/:groupID (see comment thread here for details), and the corresponding BBCode is set as [bibBaseZoteroG={user name},{group ID}]{Link text}[/bibBaseZoteroG].

This can also be embedded directly with an iFrame, using the "F" appended version

Code: Select all

[bibBaseZoteroGF=PHzot2020,2515309]


To do:

  • Better embedding with PHP or JavaScript methods
  • Rationalise BBCodes - they have multiplied unnecessarily!
  • Methods using multiple nested BBCodes?

Post Reply