Skip to content

breezy-codes/obsidian-bibtex-2-md-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bib2md

BibTeX → Markdown note generator

This tool takes entries from a .bib file and automatically generates Markdown files with YAML-style frontmatter. Each file is named after the BibTeX citation key and filled with metadata such as title, year, and institution.

It’s especially handy for building research or whitepaper databases in tools like Obsidian.


✨ Features

  • Converts each BibTeX entry into a Markdown file

  • Automatically fills in frontmatter fields from BibTeX:

    • Paper title → from title
    • Company → from institution
    • Year → from year
    • Date created / modified → today’s date
  • One file per citation key (e.g. Smith2023_6GSecurity.md)

  • Works with your own template.md so you control the file layout

  • Outputs to a papers/ directory


📂 Example

Sample BibTeX entry

@techreport{Smith2023_6GSecurity,
  type        = {White Paper},
  title       = {Securing the Path to 6G: Challenges and Opportunities},
  author      = {John Smith and Alice Johnson},
  year        = {2023},
  month       = sep,
  institution = {Future Networks Alliance}
}

Generated file: papers/Smith2023_6GSecurity.md

---
title:
date created: 2025-09-24
date modified: 2025-09-24
Paper title: Securing the Path to 6G: Challenges and Opportunities
Company: Future Networks Alliance
year: 2023
tags:
  - telecom-database/whitepaper
---

🚀 Setup & Usage

1. Clone this repo

git clone https://github.com/yourusername/bib2md.git
cd bib2md

2. Create and activate a virtual environment

python3 -m venv venv
source venv/bin/activate   # Linux/macOS
venv\Scripts\activate      # Windows (PowerShell)

3. Install dependencies

Install directly:

pip install bibtexparser

Or use the provided requirements.txt:

pip install -r requirements.txt

requirements.txt contains just:

bibtexparser

4. Place your files

  • references.bib → your BibTeX file
  • template.md → your Markdown template

5. Run the script

python3 bib2md.py

Markdown files will appear in the papers/ directory.


Customisation

You can modify how the script works:

  • Template fields
    Edit template.md to add/remove frontmatter fields. The script looks for placeholders like Paper title:, Company:, year: etc.
    See the full list of supported fields.

  • Fallbacks
    Add fallback logic for missing fields (e.g. use author if institution isn’t present).

  • Output folder
    Change:

    OUTPUT_DIR = Path("papers")

    to any path you prefer.

  • Extra fields
    To include more BibTeX fields (like author, journal, doi), just add lines to the script:

    doi = entry.get("doi", "")
    content = content.replace("DOI:", f"DOI: {doi}")
  • Obsidian tags
    You can expand the YAML tags: section to automatically add categories.


📜 License

This project is licensed under the GNU General Public License (GPL). See the LICENSE file for details.

About

Automatically convert BibTeX references into Markdown files (with YAML frontmatter) for integration with knowledge-base tools like Obsidian.

Topics

Resources

License

Stars

Watchers

Forks

Contributors