Skip to content

farirpgs/drafts

Repository files navigation

Drafts

Draft documents of RP

Setup

This project uses md-to-pdf with Tailwind CSS Typography to generate beautifully styled PDFs from Markdown files.

Installation

npm install

Usage

Generate PDFs

To generate PDFs from all Markdown files:

npm run pdf

This will:

  1. Build the Tailwind CSS styles with the Typography plugin
  2. Clean existing PDF files
  3. Generate new PDFs with enhanced typography

Individual Scripts

  • npm run build:css - Build Tailwind CSS styles
  • npm run clean:pdf - Remove all generated PDFs
  • npm run pdf-debug - Output HTML instead of PDF for debugging styles (usage: npm run pdf-debug -- path/to/file.md)

Configuration

Tailwind CSS

The Tailwind configuration is in input.css with the Typography plugin enabled:

@import "tailwindcss";
@plugin "@tailwindcss/typography";

md-to-pdf

The PDF generation is configured in md-to-pdf.config.js with:

  • Tailwind Typography prose classes for beautiful typography
  • A4 format with 25mm margins
  • Print background enabled for styled elements

You can customize the configuration by editing md-to-pdf.config.js.

Custom Fonts

Add front-matter at the top of any markdown file to use custom Google Fonts:

---
stylesheet:
  - https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;700&display=swap
css: |-
  .prose { font-family: 'Crimson Pro', serif; }
---

Browse fonts at Google Fonts.

Directory Structure

  • active/ - Active draft documents
  • archives/ - Archived documents
  • chats/ - Conversation logs and notes
  • input.css - Tailwind CSS source file
  • output.css - Generated CSS output (built by Tailwind)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published