Skip to content

giovanicavila/markdown-to-pdf

Repository files navigation

Markdown to PDF Converter

A modern web application for converting Markdown text into PDF documents. Built with React and TypeScript, featuring a real-time preview, animated UI components, and seamless PDF generation.

Overview

This application provides a clean, intuitive interface for writing Markdown content and converting it to PDF format. Users can edit their Markdown in a dedicated editor, preview the rendered output in real-time, and generate professional PDF documents with a single click.

Features

  • Real-time Markdown preview with GitHub Flavored Markdown support
  • Split-pane editor and preview interface with animated tab transitions
  • One-click PDF conversion with progress indicators
  • Dark and light theme support
  • Responsive design optimized for desktop and mobile devices
  • Toast notifications for user feedback
  • Client-side processing with no server required

Technology Stack

  • React 19 with TypeScript
  • Vite 7 for build tooling and development
  • Tailwind CSS 4 for styling
  • shadcn/ui and animate-ui for component library
  • html2canvas and jsPDF for PDF generation
  • react-markdown for Markdown rendering
  • Sonner for toast notifications
  • Bun as the package manager

Prerequisites

  • Bun 1.0 or higher
  • Node.js 18 or higher (if not using Bun)

Installation

  1. Clone the repository:
git clone <repository-url>
cd markdown-to-pdf
  1. Install dependencies:
bun install
  1. Start the development server:
bun run dev
  1. Open your browser and navigate to http://localhost:5173

Available Scripts

  • bun run dev - Start the development server
  • bun run build - Build for production
  • bun run preview - Preview the production build locally
  • bun run lint - Run ESLint
  • bun run test - Run Vitest tests
  • bun run check - Run code quality checks with Ultracite
  • bun run fix - Auto-fix code style issues

Usage

  1. Enter or paste your Markdown content in the Editor tab
  2. Switch to the Preview tab to see the rendered output
  3. Click "Convert to PDF" to generate and download the PDF file
  4. The PDF will be automatically downloaded to your device

Project Structure

src/
β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”œβ”€β”€ animate-ui/     # Animated UI components
β”‚   └── ui/             # Base UI components (shadcn/ui)
β”œβ”€β”€ contexts/           # React context providers
β”‚   └── theme-provider.tsx
β”œβ”€β”€ hooks/              # Custom React hooks
β”œβ”€β”€ layout/             # Layout components
β”œβ”€β”€ pages/              # Page components
β”‚   └── converter/      # Main converter page
β”‚       β”œβ”€β”€ components/ # Converter-specific components
β”‚       β”œβ”€β”€ hooks/      # Converter hooks
β”‚       └── utils/      # PDF conversion utilities
└── lib/                # Utility functions

Deployment

This project includes a GitHub Actions workflow for automatic deployment to GitHub Pages. The workflow triggers on pushes to the main branch and automatically builds and deploys the application.

To enable GitHub Pages:

  1. Navigate to your repository Settings
  2. Go to Pages section
  3. Select "GitHub Actions" as the source
  4. The workflow will deploy automatically on the next push to main

Development Guidelines

  • Use kebab-case for file names
  • Keep components under 300 lines
  • Maximum 6 props per component
  • Use TypeScript for all new code
  • Follow the existing project structure
  • Write tests for new components and utilities

License

This project is private and proprietary.

About

πŸ“ Turn Markdown files into PDF documents.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages