Skip to content

CubicrootXYZ/Markdown-to-PDF-Webtool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Markdown-to-PDF-Webtool

A simple and leightweight Markdown to PDF converter

Describtion

A simple and leightweight tool for converting Markdown syntax to a PDF.

Parts

API

The API is responsible for handling requests from the frontend. The tasks are easy, so the API also works as the backend.

Frontend

The frontend is a simple one-pager written in HTML and JavaScript. It sends and receives stuff to/from the API.

Database

The database stores the PDF files, there is a dump provided that includes a routine to auto-delete files older than 5 days.

Installation

From scratch

  1. Make sure to have a MySQL-Server and Python3 running.
  2. Setup a MySQL database. I strongly recommend using the provided dump, the dump provides not only the database structure, but also the auto-deletion routine.
  3. Setup the API. Therefore install all needed python librarys. The API runs with gunicorn, install gunicorn itself and the python library (pip3 install gunicorn).
  4. Run the API as daemon (e.g. use systemd). You can manually run it via bash startapi.sh in the API-folder.
  5. Change the settings in the config.ini according to your needs. The baseurl should be the baseurl (url without endpoint; e.g.: http://api.domain.org or http://domain.org/api) from the API, NOT the frontend.
  6. Setup the frontend, it requires HTML and JavaScript. I recommend a Webserver like Apache.
  7. The frontend uses 127.0.0.1:8080 for calling the API, if your API is elsewhere please adapt that in the index.html file.

Via docker

Use this API image, setup the frontend with your prefered webserver.

Documentation

View the GitHub Wiki

Known Problems

Links not clickable

This is an issue with the cairo library on which weasyprint depends. Make sure to install a newer version (> 1.15 should fix that).