GithubHelp home page GithubHelp logo

citeproc-markdown's Introduction

citeproc-markdown

Python markdown extension to convert a CSL data block in markdown to a styled bibliography in the HTML output. Requires a citeproc-js server in order to work.

Example

Markdown source

# The origins of the term _anthropocene_

The term _anthropocene_ has been coined by Crutzen and Stoermer in the year 2000.

```csl-yaml
- id: crutzenAnthropocene2000
  author:
    - family: Crutzen
      given: P.J.
    - family: Stoermer
      given: E.F.
  container-title: Global Change Newsletter
  issued:
    raw: "2000"
  page: 17-18
  title: The “Anthropocene”
  type: article-journal
  volume: '41'
```

We use a fenced code block to store the CSL data. The data language is defined directly after the first backticks as csl-<language>, where <language> is the language the bibliographic data is stored in. Supported values are yaml, json and json5.

Python conversion snippet

from markdown import markdown
markdown(
    content, extensions=['citeproc'],
    extension_configs={
        'citeproc': {
            'citeproc_endpoint': 'DEFINE_ENDPOINT_HERE'
        }
    }
)

Alternatively, the endpoint can also be defined through the environment variable CITEPROC_ENDPOINT, either in memory or in a .env or settings.ini file in the working directory.

HTML output

<h1>The origins of the term <em>anthropocene</em></h1>
<p>The term <em>anthropocene</em> has been coined by Crutzen and Stoermer in the year 2000.</p>
<div class="csl-bib-body">
  <div class="csl-entry">Crutzen, P.J., and E.F. Stoermer. 2000. “The ‘Anthropocene.’” <i>Global Change Newsletter</i> 41: 17–18.</div>
</div>

citeproc-markdown's People

Contributors

andredelft avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.