citation-js-showdown
v2.0.0
Published
Cite references in Showdown
Downloads
12
Readme
citation.js-showdown
Showdown extension for Citation.js.
Install
Node.js
npm install citation-js-showdown
Browser
Download this file.
Use
Node.js
First, load showdown:
const Showdown = require('showdown')
Second, register extension:
require('citation-js-showdown')
Third, use extension in the showdown converter:
const converter = new Showdown.Converter({ extensions: ['citation.js'] })
Now you can use the converter like you normally would.
Browser
<script src="showdown.js"></script>
<script src="showdown.citation.js"></script>
<script>
const converter = new Showdown.Converter({ extensions: ['citation.js'] })
</script>
Now you can use the converter like you normally would.
Syntax
^[<INPUT>]
Where <INPUT>
is any string that can be inputted to Cite
, omitting
the quotes. Arrays may not work currently, see todos.
Todo
- Sorting based on IDs
- Add support for
^[<AUTHOR>, <YEAR>, <TITLE>, <ETC>]
syntax - DOI input (actually a todo for Citation.js; if support for DOI is added there, it will automatically work here, assuming I update the dependencies)
- Work async (Citation.js will probably be at least partly async soon). Requires either:
- a hack in whatever program you're rendering the HTML in; or
- async support in showdown
- Configuration
- output options available in Citation.js (assuming we want formatted citations that's only style and language)
- Wikipedia-style references (i.e. [1]) or following style guides (i.e. (Willighagen, 2017))