A powerful Python script to convert your Day One journal exports or standard Markdown files into a multitude of beautiful, organized formats, ready for archiving or sharing.
- Beautiful HTML Output 🎨: Generates a single, self-contained
.htmlfile with modern, built-in CSS for a clean and beautiful reading experience in any browser. - Dual Input Support ✌️: Works with both:
- Day One
.jsonexports: The script's primary function. - Standard
.mdfiles: For any of your other Markdown notes.
- Day One
- Multiple Output Formats 📚: Converts your content into a comprehensive set of formats:
- ✨ Styled HTML (
.html) - 📝 Consolidated Markdown (
.md) - 📄 Plain Text (
.txt) - ✒️ LaTeX (
.tex) - ✍️ Microsoft Word (
.docx) - 📑 PDF (requires Word on Windows)
- 📖 EPUB (
.epub)
- ✨ Styled HTML (
- Chronological Sorting 📅: Automatically sorts your Day One journal entries by their creation date.
- Markdown Preservation 💅: Keeps your Markdown formatting (headers, bold, italics) intact across all relevant formats.
- Smart EPUB Creation 🧠:
- Generates a dynamic Table of Contents based on
# H1 titlesin your content. - Allows you to add a custom book cover!
- Generates a dynamic Table of Contents based on
- Organized Output 📂: Creates a dedicated folder for each input file, keeping all your converted documents tidy.
You need to have Python 3 installed. Then, install the required libraries using pip:
pip install python-docx docx2pdf EbookLibNote on PDF Conversion: The
docx2pdflibrary requires Microsoft Word to be installed on a Windows machine. If you are on macOS or Linux, the script will simply skip the PDF conversion step without crashing.
- Prepare Your File: Get your Day One
.jsonexport or any.mdfile you want to convert. - Place Your Files: Put the
.jsonor.mdfile in the same directory as the Python script. - (Optional) Add a Cover: For a custom EPUB cover, place an image named
cover.jpgin the same directory.
Your folder structure might look like this:
.
├── Journal1.json <-- Your Day One export
├── MyNotes.md <-- OR your Markdown file
├── cover.jpg <-- Your optional EPUB cover
└── journal_converter.py <-- This Python script
Open the Python script and change the input_filename variable on line 111 to match your file.
# === Configure Input File ===
input_filename = "Journal1.json" Execute the script from your terminal:
python journal_converter.pyThe script will create a new folder named after your input file (e.g., Journal1). Inside, you will find all your converted documents.
- For Day One (
.json) files: The script reads all entries, sorts them by date, and processes them individually. - For Markdown (
.md) files: The script treats the entire file as a single entry. The date for this entry is automatically set to the file's "last modified" date. The chapter generation based on# H1 titlesworks perfectly.
Enjoy your newly archived documents! 🎉
