aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md46
1 files changed, 36 insertions, 10 deletions
diff --git a/README.md b/README.md
index de613e8..811daac 100644
--- a/README.md
+++ b/README.md
@@ -1,20 +1,23 @@
# likha-pdf
-a simple and crappy web app that converts markdown to pdf using pandoc and lualatex.
+a simple web app that converts markdown to pdf.
+
+<img width="1280" height="800" alt="likha-pdf screenshot" src="https://github.com/user-attachments/assets/578b8410-53ad-4323-a45a-19ae3aabe61d" />
-<img width="1440" height="1080" alt="likha-pdf screenshot" src="https://github.com/user-attachments/assets/9fa15803-f0da-43d0-8a82-0fc490f3d5ff" />
## features
- markdown to pdf export
-- crappy image upload (but it works)
-- emoji-capable latex template
+- image upload with markdown snippet insertion
+- paper size, margin, font, line spacing, and page number options
+- syntax-highlighted code blocks
+- always produces a pdf (reportlab fallback if weasyprint fails)
## requirements
-- nim 1.6+
-- pandoc
-- lualatex
+- python 3.10+
+- system packages: `libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 shared-mime-info`
+- gunicorn (installed from `requirements.txt`)
## image usage
@@ -28,11 +31,34 @@ a simple and crappy web app that converts markdown to pdf using pandoc and luala
### local
```bash
+python -m venv .venv
+source .venv/bin/activate
+pip install -r requirements.txt
+cd src/
+python3 app.py
+```
+
+### production (vps + nginx)
+
+```bash
cd src/
-nim c -d:release -o:likha-pdf app.nim
-./likha-pdf
+../.venv/bin/gunicorn \
+ --bind 127.0.0.1:5001 \
+ --workers 2 \
+ --threads 4 \
+ --timeout 180 \
+ --graceful-timeout 30 \
+ --access-logfile - \
+ --error-logfile - \
+ app:app
```
+nginx should reverse proxy to `127.0.0.1:5001` and pass:
+
+- `X-Forwarded-For`
+- `X-Forwarded-Proto`
+- `X-Forwarded-Host`
+
### docker
```bash
@@ -40,4 +66,4 @@ docker build -t likha-pdf .
docker run -p 5001:5001 likha-pdf
```
-open `http://localhost:5000`
+open `http://localhost:5001`