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

View file

@ -16,8 +16,6 @@ try:
except:
import tomli as tomllib
app = FastAPI()
class XmppInstance(ClientXMPP):
def __init__(self, jid, password):
super().__init__(jid, password)
@ -27,6 +25,8 @@ class XmppInstance(ClientXMPP):
xmpp = None
app = FastAPI()
# Mount static graphic, script and stylesheet directories
app.mount("/css", StaticFiles(directory="css"), name="css")
app.mount("/data", StaticFiles(directory="data"), name="data")
@ -38,6 +38,7 @@ app.mount("/xsl", StaticFiles(directory="xsl"), name="xsl")
async def favicon():
return FileResponse('favicon.ico')
@app.route('/')
@app.get('/opml')
async def view_pubsub_nodes(request: Request):
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_text = 'html' if 'html' in content_type else '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:
ET.SubElement(e_entry, 'content').text = 'No content.'
published = item_payload.find(namespace + 'published')

View file

@ -199,7 +199,7 @@ window.onload = async function(){
let elementDiv = document.createElement('div');
elementDiv.id = 'selection-page';
let elementH1 = document.createElement('h1');
elementH1.textContent = 'Get A News Reader';
elementH1.textContent = 'Select A News Reader';
elementDiv.appendChild(elementH1);
let elementH2 = document.createElement('h2');
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>
<!-- entry enclosure -->
<xsl:if test='atom:link[@rel="enclosure"]'>
<h4>Enclosures</h4>
<h4>Media</h4>
<span class='enclosures' title='Right-click and Save link as…'>
<xsl:for-each select='atom:link[@rel="enclosure"]'>
<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.'>
Rivista
</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'
Title='An XMPP-Based Feed Reader.'>
title='An XMPP-Based Feed Reader.'>
Reeder
</a>
<a href='https://modernxmpp.org/'
@ -486,16 +490,25 @@ xmlns:atom='http://www.w3.org/2005/Atom'>
</div>
<!-- note -->
<p id='note'>
<i>
This is an Atom document which is conveyed as an XHTML
document;
This document can also be viewed with a Syndication Feed
Reader (also referred to as News Reader or RSS Reader)
which provides automated news updates and notifications
on desktop and mobile.
This an Atom document which can also be viewed with
a Syndication Feed 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
selection of software and pick the ones that would fit
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>
</p>
</body>

View file

@ -183,8 +183,12 @@ xmlns:xml='http://www.w3.org/XML/1998/namespace'>
title='A Journal Publisher And Browser For XMPP.'>
Rivista
</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'
Title='An XMPP-Based Feed Reader.'>
title='An XMPP-Based Feed Reader.'>
Reeder
</a>
<a href='https://modernxmpp.org/'
@ -202,17 +206,26 @@ xmlns:xml='http://www.w3.org/XML/1998/namespace'>
</div>
<!-- note -->
<p id='note'>
<i>
This is an OPML document which is conveyed as an XHTML
document;
This document includes a collection of subscriptions,
and it can be imported to a Syndication Feed Reader
(also referred to as News Reader or RSS Reader) reader
which provides automated news updates and notifications
on desktop and mobile.
This is an OPML document which includes a collection of
subscriptions, and it can be imported to
a Syndication Feed 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
selection of software and pick the ones that would fit
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>
</p>
</body>