fix: markdown to pdf spacing and added mermaid diagram support

This commit is contained in:
abdullahalam123
2025-12-29 14:32:12 +05:30
parent b4c77acee7
commit 8bae2b662a
22 changed files with 2457 additions and 58 deletions

View File

@@ -11,7 +11,7 @@ Host BentoPDF using Apache HTTP Server.
## Step 1: Build the Project
```bash
git clone https://github.com/bentopdf/bentopdf.git
git clone https://github.com/alam00000/bentopdf.git
cd bentopdf
npm install
npm run build

View File

@@ -7,9 +7,9 @@ The easiest way to self-host BentoPDF in a production environment.
```bash
docker run -d \
--name bentopdf \
-p 3000:80 \
-p 3000:8080 \
--restart unless-stopped \
ghcr.io/bentopdf/bentopdf:latest
ghcr.io/alam00000/bentopdf:latest
```
## Docker Compose
@@ -17,17 +17,15 @@ docker run -d \
Create `docker-compose.yml`:
```yaml
version: '3.8'
services:
bentopdf:
image: ghcr.io/bentopdf/bentopdf:latest
image: ghcr.io/alam00000/bentopdf:latest
container_name: bentopdf
ports:
- "3000:80"
- "3000:8080"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
test: ["CMD", "curl", "-f", "http://localhost:8080"]
interval: 30s
timeout: 10s
retries: 3
@@ -50,10 +48,10 @@ RUN npm ci
COPY . .
RUN npm run build
FROM nginx:alpine
FROM nginxinc/nginx-unprivileged:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]
```
@@ -61,7 +59,7 @@ Build and run:
```bash
docker build -t bentopdf:custom .
docker run -d -p 3000:80 bentopdf:custom
docker run -d -p 3000:8080 bentopdf:custom
```
## Environment Variables
@@ -76,15 +74,13 @@ Example:
```bash
docker run -d \
-e SIMPLE_MODE=true \
-p 3000:80 \
ghcr.io/bentopdf/bentopdf:latest
-p 3000:8080 \
ghcr.io/alam00000/bentopdf:latest
```
## With Traefik (Reverse Proxy)
```yaml
version: '3.8'
services:
traefik:
image: traefik:v2.10
@@ -103,20 +99,19 @@ services:
- ./letsencrypt:/letsencrypt
bentopdf:
image: ghcr.io/bentopdf/bentopdf:latest
image: ghcr.io/alam00000/bentopdf:latest
labels:
- "traefik.enable=true"
- "traefik.http.routers.bentopdf.rule=Host(`pdf.example.com`)"
- "traefik.http.routers.bentopdf.entrypoints=websecure"
- "traefik.http.routers.bentopdf.tls.certresolver=letsencrypt"
- "traefik.http.services.bentopdf.loadbalancer.server.port=8080"
restart: unless-stopped
```
## With Caddy (Reverse Proxy)
```yaml
version: '3.8'
services:
caddy:
image: caddy:2
@@ -128,7 +123,7 @@ services:
- caddy_data:/data
bentopdf:
image: ghcr.io/bentopdf/bentopdf:latest
image: ghcr.io/alam00000/bentopdf:latest
restart: unless-stopped
volumes:
@@ -139,7 +134,7 @@ Caddyfile:
```
pdf.example.com {
reverse_proxy bentopdf:80
reverse_proxy bentopdf:8080
}
```
@@ -148,7 +143,7 @@ pdf.example.com {
```yaml
services:
bentopdf:
image: ghcr.io/bentopdf/bentopdf:latest
image: ghcr.io/alam00000/bentopdf:latest
deploy:
resources:
limits:

View File

@@ -142,9 +142,9 @@ AddType image/webp .webp
# ============================================
# 5. REDIRECTS & ROUTING
# ============================================
# Canonical WWW (update domain name)
RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC]
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [L,R=301]
# Canonical WWW
RewriteCond %{HTTP_HOST} ^bentopdf\.com [NC]
RewriteRule ^(.*)$ https://www.bentopdf.com/$1 [L,R=301]
# Force HTTPS
RewriteCond %{HTTPS} off
@@ -161,15 +161,27 @@ RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Language routes
RewriteRule ^(de|en)$ /$1/ [R=301,L]
RewriteRule ^(de|en|zh|vi)/(.*)$ /$2 [L]
RewriteRule ^(de|en|zh|vi)/?$ / [L]
# SPA Fallback
# ============================================
# 5.5. DOCS ROUTING (VitePress)
# ============================================
RewriteCond %{REQUEST_URI} ^/docs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html [L]
# ============================================
# 6. SPA FALLBACK
# ============================================
# SPA Fallback (exclude /docs)
RewriteCond %{REQUEST_URI} !^/docs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /index.html [L]
ErrorDocument 404 /index.html
ErrorDocument 404 /index.html
```
## Subdirectory .htaccess Example

View File

@@ -7,19 +7,18 @@ BentoPDF can be self-hosted on your own infrastructure. This guide covers variou
The fastest way to self-host BentoPDF:
```bash
docker run -d -p 3000:80 ghcr.io/bentopdf/bentopdf:latest
docker run -d -p 3000:8080 ghcr.io/alam00000/bentopdf:latest
```
Or with Docker Compose:
```yaml
# docker-compose.yml
version: '3.8'
services:
bentopdf:
image: ghcr.io/bentopdf/bentopdf:latest
image: ghcr.io/alam00000/bentopdf:latest
ports:
- "3000:80"
- "3000:8080"
restart: unless-stopped
```
@@ -31,7 +30,7 @@ docker compose up -d
```bash
# Clone and build
git clone https://github.com/bentopdf/bentopdf.git
git clone https://github.com/alam00000/bentopdf.git
cd bentopdf
npm install
npm run build
@@ -60,7 +59,7 @@ SIMPLE_MODE=true npm run build
docker run -p 3000:8080 bentopdf/bentopdf-simple:latest
```
See [SIMPLE_MODE.md](https://github.com/bentopdf/bentopdf/blob/main/SIMPLE_MODE.md) for full details.
See [SIMPLE_MODE.md](https://github.com/alam00000/bentopdf/blob/main/SIMPLE_MODE.md) for full details.
### Base URL

View File

@@ -4,7 +4,7 @@
## One-Click Deploy
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/bentopdf/bentopdf)
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/alam00000/bentopdf)
## Manual Deployment

View File

@@ -11,7 +11,7 @@ Host BentoPDF on your own server using Nginx.
## Step 1: Build the Project
```bash
git clone https://github.com/bentopdf/bentopdf.git
git clone https://github.com/alam00000/bentopdf.git
cd bentopdf
npm install
npm run build

View File

@@ -4,13 +4,13 @@
## One-Click Deploy
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/bentopdf/bentopdf)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/alam00000/bentopdf)
## Manual Deployment
### Step 1: Fork the Repository
Fork [bentopdf/bentopdf](https://github.com/bentopdf/bentopdf) to your GitHub account.
Fork [bentopdf/bentopdf](https://github.com/alam00000/bentopdf) to your GitHub account.
### Step 2: Import to Vercel