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
@ -305,7 +306,14 @@ def generate_atom(iq, link):
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: else:
ET.SubElement(e_entry, 'content').text = 'No content.' 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') published = item_payload.find(namespace + 'published')
published_text = None if published == None else published.text published_text = None if published == None else published.text
ET.SubElement(e_entry, 'published').text = published_text ET.SubElement(e_entry, 'published').text = published_text

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'>
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> <i>
This is an Atom document which is conveyed as an XHTML This ASF (Atom Syndication Format)
document; document is conveyed as an XHTML document.
This document can also be viewed with a Syndication Feed This document was produced by an
Reader (also referred to as News Reader or RSS Reader) XSLT <a href="xsl/atom.xsl">stylesheet</a>.
which provides automated news updates and notifications XSLT is a powerful technology which transforms XML
on desktop and mobile. documents into HTML, JSON, PDF, Text XHTML, and
<span id="selection-link">Click here</span> for a (modified) XML documents;
selection of software and pick the ones that would fit <a href="https://www.w3.org/Style/XSL/">Learn more</a>
to you best! 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'>
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> <i>
This is an OPML document which is conveyed as an XHTML This OPML (Outline Processor Markup Language)
document; document is conveyed as an XHTML document.
This document includes a collection of subscriptions, This document was produced by an
and it can be imported to a Syndication Feed Reader XSLT <a href="xsl/opml.xsl">stylesheet</a>.
(also referred to as News Reader or RSS Reader) reader XSLT is a powerful technology which transforms XML
which provides automated news updates and notifications documents into HTML, JSON, PDF, Text XHTML, and
on desktop and mobile. (modified) XML documents;
<span id="selection-link">Click here</span> for a <a href="https://www.w3.org/Style/XSL/">Learn more</a>
selection of software and pick the ones that would fit about The Extensible Stylesheet Language Family (XSL).
to you best!
</i> </i>
</p> </p>
</body> </body>