0.01
No commit activity in last 3 years
No release in over 3 years
Markdown with BibTeX citations.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 2.4.7

Runtime

 Project Readme

BibMarkown

bibmarkdown gem version

BibMarkdown is a Ruby pre-processor for Markdown, adding support for citations realized by a BibTex back-end.

Syntax and result

This Markdown snippet

The way _clients_ and _servers_ exchange information on the Web
is modeled by the [REST architectural style](cite:citesAsAuthority REST).

will be processed into the following Markdown snippet:

The way _clients_ and _servers_ exchange information on the Web
is modeled by the <a rel="http://purl.org/spar/cito/citesAsAuthority" href="http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm">REST architectural style</a> <a class="reference" href="#ref-1">[1]</a>.

This Markdown snippet

The way _clients_ and _servers_ exchange information on the Web
is modeled by the REST architectural style [](cite:citesAsAuthority REST).

will be processed into the following Markdown snippet:

The way _clients_ and _servers_ exchange information on the Web
is modeled by the REST architectural style <a class="reference" href="#ref-1">[1]</a>.

Furthermore, at the end of the Markdown document, a References section will be added:

<h2 id="references">References</h2>
<dl class="references">
  <dt id="ref-1">[1]</dt>
  <dd>Fielding, R.T., 2000. Architectural Styles and the Design of Network-based Software Architectures (PhD thesis). University of California.</dd>
</dl>

Usage

require 'bibmarkdown'
require 'bibtex'
require 'csl/styles'

content = <<-md
The way _clients_ and _servers_ exchange information on the Web
is modeled by the [REST architectural style](cite:citesAsAuthority REST).
md

bibliography = <<-bib
@phdthesis{REST,
  author = {Roy Thomas Fielding},
  title = {Architectural Styles and the Design of Network-based Software Architectures},
  school = {University of California},
  year = 2000,
  url = {http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm},
}
bib

entries = BibTeX.parse(bibliography).entries
document = BibMarkdown::Document.new content,
             entries: entries, style: 'elsevier-harvard'
puts document.to_markdown

Related work

This library was inspired by Pieter Colpaert's jekyll-refs, which has some nice CSS suggestions as well.

License

Copyright ©2016 Ruben Verborgh – MIT License