Our project revitalizes the art of letter writing, fostering deeper relationships through personalized notes. In a world dominated by digital communication, we encourage embracing the handwritten word to express sentiments authentically. Join us in discovering the power of connection, one letter at a time.
Mdexport is a powerful command-line interface (CLI) tool designed to seamlessly convert your Markdown files into high-quality PDF documents using customizable Jinja2 templates. Ideal for writers and developers working with Markdown in applications like Obsidian, Mdexport allows you to leverage Frontmatter metadata for personalized content in your templates.
Key Features
- Markdown to PDF Conversion: Effortlessly publish your Markdown files as professional-looking PDFs.
- Template Customization: Utilize Jinja2 templates to create visually appealing PDF layouts tailored to your needs.
- Frontmatter Integration: Incorporate metadata from your Markdown files directly into your templates for dynamic content.
Simple Setup
Setting up Mdexport is straightforward. All you need to do is create a directory for your HTML templates, update the Mdexport configuration to point to your template directory, and you’re ready to go. An example structure for your templates directory is as follows:
templates/
├── invoice/
│ ├── template.html
│ └── (any files or images that template.html depends on)
└── thesis/
├── template.html
└── (any files or images that template.html depends on)
Example Template
Creating a Jinja2 template is easy. Here’s a simple example:
<html>
<body>
<section>
<b>Date: {{date}}</b>
<b>To: {{to}}</b>
</section>
<section>
<p>{{body}}</p>
</section>
</body>
</html>
Markdown File Structure
You can structure your Markdown document with Frontmatter for quick referencing within your template:
---
date: 14/10/2024
to: Bob
---
Body of my markdown file.
Generating PDFs
With everything set up, generating a PDF is as easy as running a single command:
mdexport publish file.md -o output.pdf -t invoice
Important Dependencies
Mdexport relies on Weasyprint for PDF generation. Installation could be tricky across different platforms, particularly on Mac. If you run into any issues, refer to Weasyprint’s detailed installation guide here.
Conclusion
Whether you are compiling reports, thesis documents, or invoices, Mdexport makes the process efficient and adaptable, ensuring that your Markdown content can be transformed into polished PDF presentations with ease.