Skip to content

Commit

Permalink
replace html string constants with actual files
Browse files Browse the repository at this point in the history
  • Loading branch information
knowsuchagency committed Jun 12, 2024
1 parent 5aadba5 commit 512bfbd
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 38 deletions.
35 changes: 0 additions & 35 deletions constants.py

This file was deleted.

5 changes: 5 additions & 0 deletions description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<p style="text-align:center">
<strong>Convert any PDF into a podcast episode! Experience research papers, websites, and more in a whole new way.</strong>
<br>
<a href="https://github.com/knowsuchagency/pdf-to-podcast">knowsuchagency/pdf-to-podcast</a>
</p>
49 changes: 49 additions & 0 deletions head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!-- Primary Meta Tags -->
<title>PDF to Podcast - Convert Your Documents to Audio</title>
<meta name="title" content="PDF to Podcast - Convert Your Documents to Audio" />
<meta
name="description"
content="Easily convert your PDF documents into audio podcasts. Perfect for listening on the go and making content more accessible."
/>

<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" content="https://pdf-to-podcast.com/" />
<meta
property="og:title"
content="PDF to Podcast - Convert Your Documents to Audio"
/>
<meta
property="og:description"
content="Easily convert your PDF documents into audio podcasts. Perfect for listening on the go and making content more accessible."
/>
<meta
property="og:image"
content="https://pdf-to-podcast.com/static/logo.png"
/>

<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://pdf-to-podcast.com/" />
<meta
property="twitter:title"
content="PDF to Podcast - Convert Your Documents to Audio"
/>
<meta
property="twitter:description"
content="Easily convert your PDF documents into audio podcasts. Perfect for listening on the go and making content more accessible."
/>
<meta
property="twitter:image"
content="https://pdf-to-podcast.com/static/logo.png"
/>

<!-- Additional Meta Tags -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="UTF-8" />
<meta name="author" content="Stephan Fitzpatrick" />
<meta
name="keywords"
content="PDF to Podcast, PDF to audio, document to podcast, audio conversion, podcast creation, accessible content"
/>
<link rel="icon" href="/static/icon.png" type="image/png" />
5 changes: 2 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from pypdf import PdfReader
from tenacity import retry, retry_if_exception_type

from constants import description, head

sentry_sdk.init(os.getenv("SENTRY_DSN"))

Expand Down Expand Up @@ -150,7 +149,7 @@ def generate_audio(file: str, openai_api_key: str = None) -> bytes:

demo = gr.Interface(
title="PDF to Podcast",
description=description,
description=Path("description.md").read_text(),
fn=generate_audio,
examples=[[str(p)] for p in Path("examples").glob("*.pdf")],
inputs=[
Expand All @@ -168,7 +167,7 @@ def generate_audio(file: str, openai_api_key: str = None) -> bytes:
],
allow_flagging=False,
clear_btn=None,
head=os.getenv("HEAD", "") + head,
head=os.getenv("HEAD", "") + Path("head.html").read_text(),
cache_examples="lazy",
api_name=False,
)
Expand Down

0 comments on commit 512bfbd

Please sign in to comment.