diff --git a/Dockerfile b/Dockerfile
index 1dd726f..37d0de1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,11 +2,9 @@ FROM python:3
MAINTAINER tiyn tiyn@mail-mk.eu
-COPY src /blog
-
-WORKDIR /blog
-
-RUN pip3 install -r requirements.txt
+ENV LANG en_US.UTF-8
+ENV LANGUAGE en_US:en
+ENV LC_ALL en_US.UTF-8
RUN apt-get update && \
apt-get install -y locales && \
@@ -14,9 +12,13 @@ RUN apt-get update && \
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales
-ENV LANG en_US.UTF-8
-ENV LANGUAGE en_US:en
-ENV LC_ALL en_US.UTF-8
+RUN apt-get install -y espeak
+
+COPY src /blog
+
+WORKDIR /blog
+
+RUN pip3 install -r requirements.txt
VOLUME /blog/templates/entry
diff --git a/README.md b/README.md
index 5ccc114..9e0b362 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,7 @@ via plain text files.
- [x] Links to standalone article
- [x] Standalone article page
- [x] Links to scrolling blog page
+ - [x] TTS Functionality
- [x] RSS feed
- [x] Navigation
- [x] Header
diff --git a/src/app.py b/src/app.py
index 8035d32..60c1495 100644
--- a/src/app.py
+++ b/src/app.py
@@ -137,4 +137,5 @@ def feed():
if __name__ == "__main__":
+ con_gen.prepare_tts()
app.run(host="0.0.0.0")
diff --git a/src/content.py b/src/content.py
index bc92506..5ec7cb5 100644
--- a/src/content.py
+++ b/src/content.py
@@ -1,3 +1,4 @@
+import glob
import locale
import os
import pathlib
@@ -7,6 +8,7 @@ from os import path
import markdown
from bs4 import BeautifulSoup
+from gtts import gTTS
import config
import search
@@ -144,6 +146,11 @@ def gen_stand_string(path_ex):
content_string += "" + curr_date + ""
content_string += "
\n"
+ if os.path.isfile("static/tmp/" + filename_no_end + ".mp3"):
+ content_string += "\n"
+ content_string += "
\n"
if filename.endswith(".html"):
for line in text:
content_string += line
@@ -270,3 +277,50 @@ def create_preview(path, is_markdown):
preview = "\n
" + first_p.text + "
\n" preview += "...