better pdf using headless chrome

This commit is contained in:
Waylon S. Walker 2024-10-15 15:53:32 -05:00
parent 16e207000f
commit 7f0934ac14
7 changed files with 143 additions and 26 deletions

View file

@ -3,16 +3,16 @@
{% block title %}Another Example{% endblock %}
{% block content %}
<h2>Example</h2>
<h2 class='text-gray-400 font-bold text-2xl'>Example</h2>
<p>
{{ data.message }}
</p>
<h3>Items</h3>
<p>
<h3 class='mt-4 text-gray-400 font-bold text-xl'>Items</h3>
<p class='text-gray-300 my-4'>
there are {{ data.get('items', [])|length }} items in the list
</p>
<ul>
<ul class='list-disc ml-8'>
{% for item in data.get('items', []) %}
<li>{{ item }}</li>
{% endfor %}

View file

@ -4,8 +4,9 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}FastAPI Dynamic Response{% endblock %}</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="/static/app.css" rel="stylesheet">
<!-- <link href="/static/app.css" rel="stylesheet"> -->
<link href="http://localhost:8000/static/app.css" rel="stylesheet">
</head>
<body class="bg-gray-900 text-gray-200 min-h-screen flex flex-col">
<header class="bg-gray-800 p-4">