joomla export avec epub

This commit is contained in:
Tykayn 2024-06-12 15:26:47 +02:00 committed by tykayn
parent f1493a380d
commit a81be06d9b
5 changed files with 34618 additions and 7 deletions

File diff suppressed because it is too large Load Diff

View File

@ -44,9 +44,8 @@ def get_articles():
query = '''
SELECT id, title, introtext,created FROM cijliness.cijl_content
WHERE state = 1 AND featured = 1
ORDER BY created ASC
LIMIT 5000;
WHERE state = 1
ORDER BY id ASC;
'''
cursor.execute(query)
@ -73,14 +72,18 @@ def get_articles():
@app.route("/")
def index():
"""Render base.html with articles."""
print(os.getcwd())
articles = get_articles()
if articles is not None:
context = {'articles': articles}
output = render_template('base.html', **context)
with open("rendered.html", "w") as f:
f.write(output)
return render_template('base.html', **context)
return "Failed to fetch articles."
if __name__ == "__main__":
app.run()
index()

Binary file not shown.

23689
joomla-export/rendered.html Normal file

File diff suppressed because it is too large Load Diff

View File

@ -8,16 +8,26 @@
</head>
<body>
<header>
<h1>Welcome to My EBook</h1>
<h1>
<img class="logo" src="http://cdn.onlinewebfonts.com/svg/img_433734.png" alt="pingouin">
Liness - Linux en Essonne</h1>
<p>
Cet ebook présente l'intégralité des articles de <a href="Liness.org">Liness.org</a>
</p>
<style type="text/css">
body{
width: 40rem;
margin: 0 auto;
width: 80ch;
padding: 4rem;
}
.article{
margin-bottom: 2rem;
}
.logo{
width : 10rem;
}
</style>
</header>
<main>
@ -30,11 +40,32 @@
<div dangerouslySetInnerHTML={{ article.introtext|safe }}>
{{ article.introtext }}
</div>
<hr>
</section>
{% else %}
<p>No articles found.</p>
{% endfor %}
</main>
<footer>
<h2>
Mentions légales
</h2>
Raison sociale : LINESS
Adresse :
Association LinEss - Linux Essonne -
Chez Pasal Kouai
2 rue Condorcet
91260 Juvisy sur Orge
Directeur de la publication : Didier Clermonté mail : adm(at)liness.org
</footer>
<!-- Add any JavaScript scripts or external resources here -->
</body>
</html>