Sign inSign up

c2stack/cc-md-to-pdf

By c2stack

โ€ขUpdated 8 months ago

Image
0

1.2K

c2stack/cc-md-to-pdf repository overview

โ CC Markdown to PDF

A modern, browser-based Markdown to PDF converter with live preview. Write your Markdown content and instantly see how it will look when printed or converted to PDF.

โ โœจ Features

  • Live Markdown Preview: See your formatted content in real-time as you type
  • Split-Pane Editor: Side-by-side Markdown editor and preview
  • Print to PDF: Generate PDF files directly from your browser using the print dialog
  • Toggle Preview: Option to show/hide the preview pane for focused writing
  • Example Template: Quick-start with a pre-filled Markdown example including tables
  • Table Support: Full support for Markdown tables and formatting
  • Responsive Design: Works seamlessly on desktop and mobile devices
  • Dark Mode Support: Built with modern UI components and theming

โ ๐Ÿš€ Getting Started

โ Prerequisites
โ Installation
  1. Clone the repository and navigate to the app directory:
cd apps/cc-md-to-pdf
  1. Install dependencies:
bun install
โ Development

Run the development server:

bun dev

The app will be available at http://localhost:5173 (or another port if 5173 is in use).

โ ๐Ÿ—๏ธ Building For Production

Build the application for production:

bun build

Preview the production build:

bun preview

โ ๐Ÿ“– Usage

  1. Write Markdown: Type or paste your Markdown content in the left pane
  2. Preview: See the formatted output in real-time on the right pane
  3. Insert Example: Click "Insert example" to load a sample Markdown document with tables
  4. Toggle Preview: Use the switch to show/hide the preview pane
  5. Generate PDF: Click "Print Preview" to open the print dialog and save as PDF
โ Supported Markdown Features
  • Headings (H1-H6)
  • Bold and italic text
  • Links
  • Lists (ordered and unordered)
  • Tables
  • Code blocks
  • Blockquotes
  • And more...

โ ๐Ÿงช Testing

Run the test suite:

bun test

This project uses Vitestโ  for testing.

โ ๐Ÿ› ๏ธ Tech Stack

โ ๐Ÿ“ Project Structure

cc-md-to-pdf/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ routes/          # TanStack Router file-based routes
โ”‚   โ”‚   โ”œโ”€โ”€ __root.tsx   # Root layout
โ”‚   โ”‚   โ””โ”€โ”€ index.tsx    # Main app component
โ”‚   โ”œโ”€โ”€ utils/           # Utility functions
โ”‚   โ”œโ”€โ”€ main.tsx         # Application entry point
โ”‚   โ””โ”€โ”€ styles.css       # Global styles
โ”œโ”€โ”€ public/              # Static assets
โ””โ”€โ”€ index.html           # HTML template

โ ๐Ÿณ Docker

A Dockerfile is included for containerized deployment. Build and run with (run from the monorepo root directory):

docker build -t cc-photo-tools -f apps/cc-photo-tools/Dockerfile .
docker run -p 8080:80 cc-md-to-pdf

โ ๐Ÿค Contributing

This is part of the cc-web-tools monorepo. See the main repository for contribution guidelines.

โ ๐Ÿ“„ License

Part of the cc-web-tools project.

Tag summary

Content type

Image

Digest

sha256:b19e96981โ€ฆ

Size

25.2 MB

Last updated

8 months ago

docker pull c2stack/cc-md-to-pdf