Skip to content

santhoshtr/metapost-sandbox

Repository files navigation

Metapost Sandbox

Try Metapost quickly and easily with our online sandbox application! View and preview your results in a user-friendly interface. Perfect for anyone wanting to experiment with Metapost without the hassle of setting up an environment. Start creating illustrations now!

Try now!

Usage

Installation

Clone the repository. Install the system dependencies:

sudo apt install wget unzip build-essential cmake texlive-metapost

Install dependencies using uv:

uv sync

Configuration

The app uses GitHub Gists for storing saved metapost code and GitHub OAuth for authentication.

  1. Create a GitHub OAuth App at https://github.com/settings/developers

    • Application name: Metapost Sandbox
    • Homepage URL: http://localhost:8000 (or your production URL)
    • Authorization callback URL: http://localhost:8000/
  2. Copy .env.example to .env and fill in your credentials:

cp .env.example .env

Edit .env with your GitHub OAuth credentials:

GITHUB_CLIENT_ID=your_client_id_here
GITHUB_CLIENT_SECRET=your_client_secret_here
  1. Run the app:
uv run uvicorn app.main:app

Features

  • Code editor with syntax highlighting for Metapost
  • Live preview of the SVG generated from the code. No need to manually run it
  • Logs of compiling the code from metapost is available for debugging.
  • (todo) Saving the code in browser indexdb to continue from where you stopped.

Familiarize with Metafont, MetaPost

Familiarizing with the concepts of MetaFont and MetaPost are essential. In this guide, we are not going to explain this, but will provide a list of good tutorials to use.

It is important to practice MetaPost rather than just reading the book. Use this sandbox tool for practicing.

Docker

docker build -t mpostsandbox .
docker run -d --name mpostsandboxcontainer -p 80:80 mpostsandbox

About

Try Metapost quickly and easily with our online sandbox application!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors