Coder Social home page Coder Social logo

pymarkdown's Introduction

pymarkdown

bib2md.py

BibTeX to Markdown Converter for Hugo

This Python script is originally intended to be used with Hugo, a popular static site generator. It converts a BibTeX bibliography file into a Markdown file that can be used to create a bibliography page on a Hugo website. The entries in the Markdown file are sorted by year in descending order and formatted in a specific style.

Dependencies

This script requires the bibtexparser library. You can install it using pip:

pip install bibtexparser

Usage

To use this script, you need to specify the paths to your input .bib file and your desired output .md file in the bib_filename and md_filename variables, respectively:

bib_filename = 'your_bib_file.bib'  # replace with your .bib file
md_filename = 'your_md_file.md'  # replace with your desired .md file
convert_bib_to_md(bib_filename, md_filename)

Then, run the script. It will read the .bib file, convert each entry into a Markdown formatted string, and write the strings to the .md file.

Output Format

Each entry in the .bib file is converted into the following format in the .md file:

1. Author1, Author2, ..., AuthorN. **Title.** *Journal*, Volume, Pages (Year). DOI

If the volume, pages, year, doi, or url field is not present in an entry in the .bib file, it will be omitted in the corresponding Markdown entry.

Note

This script assumes that each entry in your .bib file contains the fields author, title, and journal. If some entries do not contain these fields, you may need to modify the script accordingly.

pymarkdown's People

Contributors

melmo0504 avatar nano713 avatar

Watchers

 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.