This gem extends the default kramdown parser to support citation a la pandoc. Citations are rendered by citeproc-ruby. Currently only BibTeX input is supported.
LaTeX output expect the natbib
package in the template.
Add this line to your application Gemfile:
gem `kramdown-cite`
And then execute:
$ bundle
Or install it yourself as:
$ gem install kramdown-cite
Just import the Gem and use kramdown normally.
require 'kramdown-cite'
Kramdown::Document.new(content).to_html
An helper is provided to use kramdown-cite
instead of classic kramdown in the helper directory. Drop this helper in your <site>/helper
directory and voilĂ .
The Gem provide a kramdown-cite
executable. Otherwise add (or replace) kramdown-cite
in the require section of kramdown.
Currently only two options are available:
bib : This option allows to override the default bibliography file.
csl : This option allows to override the default csl file.
Passing this options to kramdown depends on the context usage :
command line
: --option value
plain ruby
: Kramdown::Document.new(content, :option => value).to_html
nanoc : options are normal attributes (activation within a document, through a document meta-data file, or inside nanoc.yaml)
Syntax is currently a small subset of pandoc and exists in two flavor.
inline citation
: @citationkey
Parenthesis citation
: [@citation]
or [@citation1;@citation2]
- Currently
kramdown-cite
is not really resilient to bad usage. - Citation syntax is only limited to basic forms
- citeproc-ruby does not render well multiple citation
- Html output is not perfect
- Fork
- Create a topic branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
I don't really fu**ing mind about license, thus I use the kramdown's one (i.e., I guess MIT). But honestly I don't mind, use it if you like it, claim that's yours, change it ... or don't. Life is too short to fight for useless things.