Add support for contents of Libervia (XEP-0277);

Various of visual improvements.
This commit is contained in:
Schimon Jehudah, Adv. 2024-07-31 19:21:33 +03:00
parent 44e7778578
commit ad34af72ff
5 changed files with 67 additions and 28 deletions

View file

@ -191,6 +191,7 @@ h3.title > a {
#articles div.entry span.tags { #articles div.entry span.tags {
display: inline-flex; display: inline-flex;
/* display: ruby; */ /* display: ruby; */
flex-wrap: wrap;
} }
#articles div.entry span.tags > div { #articles div.entry span.tags > div {
@ -271,16 +272,20 @@ h3.title > a {
margin:3px; margin:3px;
} }
#note { #note, #small {
line-height: 30px; line-height: 30px;
margin: auto; margin: auto;
margin-top: 0.67em; margin-top: 0.67em;
max-width: 70%; max-width: 80%;
padding: 10px; padding: 10px;
text-align: center; text-align: center;
user-select: none; user-select: none;
} }
#small {
font-size: 80%;
}
@media (max-width: 1550px) { @media (max-width: 1550px) {
#articles { #articles {
display: unset; display: unset;

View file

@ -16,8 +16,6 @@ try:
except: except:
import tomli as tomllib import tomli as tomllib
app = FastAPI()
class XmppInstance(ClientXMPP): class XmppInstance(ClientXMPP):
def __init__(self, jid, password): def __init__(self, jid, password):
super().__init__(jid, password) super().__init__(jid, password)
@ -27,6 +25,8 @@ class XmppInstance(ClientXMPP):
xmpp = None xmpp = None
app = FastAPI()
# Mount static graphic, script and stylesheet directories # Mount static graphic, script and stylesheet directories
app.mount("/css", StaticFiles(directory="css"), name="css") app.mount("/css", StaticFiles(directory="css"), name="css")
app.mount("/data", StaticFiles(directory="data"), name="data") app.mount("/data", StaticFiles(directory="data"), name="data")
@ -38,6 +38,7 @@ app.mount("/xsl", StaticFiles(directory="xsl"), name="xsl")
async def favicon(): async def favicon():
return FileResponse('favicon.ico') return FileResponse('favicon.ico')
@app.route('/')
@app.get('/opml') @app.get('/opml')
async def view_pubsub_nodes(request: Request): async def view_pubsub_nodes(request: Request):
global xmpp global xmpp
@ -304,6 +305,13 @@ def generate_atom(iq, link):
content_type = content.attrib['type'] if 'type' in content.attrib else 'html' content_type = content.attrib['type'] if 'type' in content.attrib else 'html'
content_type_text = 'html' if 'html' in content_type else 'text' content_type_text = 'html' if 'html' in content_type else 'text'
ET.SubElement(e_entry, 'content', {'type': content_type_text}).text = content_text ET.SubElement(e_entry, 'content', {'type': content_type_text}).text = content_text
else:
summary = item_payload.find(namespace + 'summary')
summary_text = summary.text
if summary_text:
summary_type = summary.attrib['type'] if 'type' in summary.attrib else 'html'
summary_type_text = 'html' if 'html' in summary_type else 'text'
ET.SubElement(e_entry, 'content', {'type': summary_type_text}).text = summary_text
else: else:
ET.SubElement(e_entry, 'content').text = 'No content.' ET.SubElement(e_entry, 'content').text = 'No content.'
published = item_payload.find(namespace + 'published') published = item_payload.find(namespace + 'published')

View file

@ -199,7 +199,7 @@ window.onload = async function(){
let elementDiv = document.createElement('div'); let elementDiv = document.createElement('div');
elementDiv.id = 'selection-page'; elementDiv.id = 'selection-page';
let elementH1 = document.createElement('h1'); let elementH1 = document.createElement('h1');
elementH1.textContent = 'Get A News Reader'; elementH1.textContent = 'Select A News Reader';
elementDiv.appendChild(elementH1); elementDiv.appendChild(elementH1);
let elementH2 = document.createElement('h2'); let elementH2 = document.createElement('h2');
elementH2.textContent = 'Install A Feed Reader For Desktop And Mobile'; elementH2.textContent = 'Install A Feed Reader For Desktop And Mobile';

View file

@ -390,7 +390,7 @@ xmlns:atom='http://www.w3.org/2005/Atom'>
</xsl:if> </xsl:if>
<!-- entry enclosure --> <!-- entry enclosure -->
<xsl:if test='atom:link[@rel="enclosure"]'> <xsl:if test='atom:link[@rel="enclosure"]'>
<h4>Enclosures</h4> <h4>Media</h4>
<span class='enclosures' title='Right-click and Save link as…'> <span class='enclosures' title='Right-click and Save link as…'>
<xsl:for-each select='atom:link[@rel="enclosure"]'> <xsl:for-each select='atom:link[@rel="enclosure"]'>
<div class='enclosure' title='Right-click and Save link as…'> <div class='enclosure' title='Right-click and Save link as…'>
@ -467,8 +467,12 @@ xmlns:atom='http://www.w3.org/2005/Atom'>
title='A Journal Publisher And Browser For XMPP.'> title='A Journal Publisher And Browser For XMPP.'>
Rivista Rivista
</a> </a>
<a href='https://git.xmpp-it.net/sch/Blasta'
title='A Social Bookmark Manager For XMPP.'>
Blasta
</a>
<a href='https://github.com/SeveFP/Reeder' <a href='https://github.com/SeveFP/Reeder'
Title='An XMPP-Based Feed Reader.'> title='An XMPP-Based Feed Reader.'>
Reeder Reeder
</a> </a>
<a href='https://modernxmpp.org/' <a href='https://modernxmpp.org/'
@ -486,16 +490,25 @@ xmlns:atom='http://www.w3.org/2005/Atom'>
</div> </div>
<!-- note --> <!-- note -->
<p id='note'> <p id='note'>
<i> This an Atom document which can also be viewed with
This is an Atom document which is conveyed as an XHTML a Syndication Feed Reader (also referred to as News Reader
document; or RSS Reader) which provides automated news updates and
This document can also be viewed with a Syndication Feed notifications on desktop and mobile.
Reader (also referred to as News Reader or RSS Reader)
which provides automated news updates and notifications
on desktop and mobile.
<span id="selection-link">Click here</span> for a <span id="selection-link">Click here</span> for a
selection of software and pick the ones that would fit selection of software and pick the ones that would fit
to you best! to you best!
</p>
<p id='small'>
<i>
This ASF (Atom Syndication Format)
document is conveyed as an XHTML document.
This document was produced by an
XSLT <a href="xsl/atom.xsl">stylesheet</a>.
XSLT is a powerful technology which transforms XML
documents into HTML, JSON, PDF, Text XHTML, and
(modified) XML documents;
<a href="https://www.w3.org/Style/XSL/">Learn more</a>
about The Extensible Stylesheet Language Family (XSL).
</i> </i>
</p> </p>
</body> </body>

View file

@ -183,8 +183,12 @@ xmlns:xml='http://www.w3.org/XML/1998/namespace'>
title='A Journal Publisher And Browser For XMPP.'> title='A Journal Publisher And Browser For XMPP.'>
Rivista Rivista
</a> </a>
<a href='https://git.xmpp-it.net/sch/Blasta'
title='A Social Bookmark Manager For XMPP.'>
Blasta
</a>
<a href='https://github.com/SeveFP/Reeder' <a href='https://github.com/SeveFP/Reeder'
Title='An XMPP-Based Feed Reader.'> title='An XMPP-Based Feed Reader.'>
Reeder Reeder
</a> </a>
<a href='https://modernxmpp.org/' <a href='https://modernxmpp.org/'
@ -202,17 +206,26 @@ xmlns:xml='http://www.w3.org/XML/1998/namespace'>
</div> </div>
<!-- note --> <!-- note -->
<p id='note'> <p id='note'>
<i> This is an OPML document which includes a collection of
This is an OPML document which is conveyed as an XHTML subscriptions, and it can be imported to
document; a Syndication Feed Reader (also referred to as News Reader
This document includes a collection of subscriptions, or RSS Reader) which provides automated news updates and
and it can be imported to a Syndication Feed Reader notifications on desktop and mobile.
(also referred to as News Reader or RSS Reader) reader
which provides automated news updates and notifications
on desktop and mobile.
<span id="selection-link">Click here</span> for a <span id="selection-link">Click here</span> for a
selection of software and pick the ones that would fit selection of software and pick the ones that would fit
to you best! to you best!
</p>
<p id='small'>
<i>
This OPML (Outline Processor Markup Language)
document is conveyed as an XHTML document.
This document was produced by an
XSLT <a href="xsl/opml.xsl">stylesheet</a>.
XSLT is a powerful technology which transforms XML
documents into HTML, JSON, PDF, Text XHTML, and
(modified) XML documents;
<a href="https://www.w3.org/Style/XSL/">Learn more</a>
about The Extensible Stylesheet Language Family (XSL).
</i> </i>
</p> </p>
</body> </body>