Add OPML support;
Set a new default node (Thank you roughnecks); Improve CSS, JS, XSLT; Neglect external libraries to produce syndications.
This commit is contained in:
parent
e07ff6e838
commit
d1f1edbaca
8 changed files with 519 additions and 185 deletions
|
@ -8,22 +8,15 @@ element <meta/> inside of html element </head>
|
|||
-->
|
||||
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:output
|
||||
method = 'html'
|
||||
indent = 'yes'
|
||||
omit-xml-decleration='no' />
|
||||
|
||||
<xsl:output method = 'html'
|
||||
indent = 'yes'
|
||||
omit-xml-decleration='no' />
|
||||
<!-- Atom 1.0 Syndication Format -->
|
||||
<xsl:include href='atom_as_xhtml.xsl'/>
|
||||
|
||||
<!-- extract filename from given url string -->
|
||||
<xsl:include href='extract-filename.xsl'/>
|
||||
|
||||
<!-- set page metadata -->
|
||||
<xsl:include href='metadata.xsl'/>
|
||||
|
||||
<!-- transform filesize from given length string -->
|
||||
<xsl:include href='transform-filesize.xsl'/>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 2016 - 2017 Schimon Jehuda. Released under MIT license
|
||||
Copyright (C) 2016 - 2024 Schimon Jehuda. Released under MIT license
|
||||
Feeds rendered using this XSLT stylesheet, or it's derivatives, must
|
||||
include https://schimon.i2p/ in attribute name='generator' of
|
||||
element <meta/> inside of html element </head>
|
||||
|
@ -46,9 +46,12 @@ xmlns:atom='http://www.w3.org/2005/Atom'>
|
|||
</xsl:call-template>
|
||||
<title>
|
||||
<xsl:choose>
|
||||
<xsl:when test='atom:title and not(atom:title="")'>
|
||||
<xsl:when test='atom:title and not(atom:title="") and count(atom:entry) > 1'>
|
||||
<xsl:value-of select='atom:title'/>
|
||||
</xsl:when>
|
||||
<xsl:when test='atom:entry'>
|
||||
<xsl:value-of select='atom:entry/atom:title'/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>StreamBurner</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</title>
|
||||
|
@ -282,7 +285,7 @@ xmlns:atom='http://www.w3.org/2005/Atom'>
|
|||
<!-- entry content -->
|
||||
<!-- entry summary of GitLab Atom Syndication Feeds -->
|
||||
<xsl:if test='atom:content or atom:summary'>
|
||||
<p class='content'>
|
||||
<div class='content'>
|
||||
<xsl:choose>
|
||||
<xsl:when test='atom:summary[contains(@type,"text")]'>
|
||||
<xsl:attribute name='type'>
|
||||
|
@ -290,6 +293,12 @@ xmlns:atom='http://www.w3.org/2005/Atom'>
|
|||
</xsl:attribute>
|
||||
<xsl:value-of select='atom:summary'/>
|
||||
</xsl:when>
|
||||
<xsl:when test='atom:summary[contains(@type,"html")]'>
|
||||
<xsl:attribute name='type'>
|
||||
<xsl:value-of select='atom:summary/@type'/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select='atom:summary' disable-output-escaping='yes'/>
|
||||
</xsl:when>
|
||||
<xsl:when test='atom:summary[contains(@type,"base64")]'>
|
||||
<!-- TODO add xsl:template to handle inline media -->
|
||||
</xsl:when>
|
||||
|
@ -299,6 +308,12 @@ xmlns:atom='http://www.w3.org/2005/Atom'>
|
|||
</xsl:attribute>
|
||||
<xsl:value-of select='atom:content'/>
|
||||
</xsl:when>
|
||||
<xsl:when test='atom:content[contains(@type,"html")]'>
|
||||
<xsl:attribute name='type'>
|
||||
<xsl:value-of select='atom:content/@type'/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select='atom:content' disable-output-escaping='yes'/>
|
||||
</xsl:when>
|
||||
<xsl:when test='atom:content[contains(@type,"base64")]'>
|
||||
<!-- TODO add xsl:template to handle inline media -->
|
||||
</xsl:when>
|
||||
|
@ -313,7 +328,7 @@ xmlns:atom='http://www.w3.org/2005/Atom'>
|
|||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</p>
|
||||
</div>
|
||||
</xsl:if>
|
||||
<!-- entry enclosure -->
|
||||
<xsl:if test='atom:link[contains(@rel,"enclosure")]'>
|
||||
|
|
18
xsl/opml.xsl
Normal file
18
xsl/opml.xsl
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 2016 - 2017 Schimon Jehuda. Released under MIT license
|
||||
Feeds rendered using this XSLT stylesheet, or it's derivatives, must
|
||||
include https://schimon.i2p/ in attribute name='generator' of
|
||||
element <meta/> inside of html element </head>
|
||||
-->
|
||||
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method = 'html'
|
||||
indent = 'yes'
|
||||
omit-xml-decleration='no' />
|
||||
<!-- Atom 1.0 Syndication Format -->
|
||||
<xsl:include href='opml_as_xhtml.xsl'/>
|
||||
<!-- set page metadata -->
|
||||
<xsl:include href='metadata.xsl'/>
|
||||
</xsl:stylesheet>
|
226
xsl/opml_as_xhtml.xsl
Normal file
226
xsl/opml_as_xhtml.xsl
Normal file
|
@ -0,0 +1,226 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 2016 - 2024 Schimon Jehuda. Released under MIT license
|
||||
Feeds rendered using this XSLT stylesheet, or it's derivatives, must
|
||||
include https://schimon.i2p/ in attribute name='generator' of
|
||||
element <meta/> inside of html element </head>
|
||||
-->
|
||||
|
||||
<xsl:stylesheet version='1.0'
|
||||
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
|
||||
xmlns:xml='http://www.w3.org/XML/1998/namespace'>
|
||||
<!-- Outline Processor Markup Language 1.0 -->
|
||||
<xsl:output
|
||||
media-type='text/x-opml' />
|
||||
<xsl:template match='/opml'>
|
||||
<!-- index right-to-left language codes -->
|
||||
<!-- TODO http://www.w3.org/TR/xpath/#function-lang -->
|
||||
<xsl:variable name='rtl'
|
||||
select='lang[
|
||||
contains(self::node(),"ar") or
|
||||
contains(self::node(),"fa") or
|
||||
contains(self::node(),"he") or
|
||||
contains(self::node(),"ji") or
|
||||
contains(self::node(),"ku") or
|
||||
contains(self::node(),"ur") or
|
||||
contains(self::node(),"yi")]'/>
|
||||
<html>
|
||||
<head>
|
||||
<xsl:call-template name='metadata'>
|
||||
<xsl:with-param name='name' select='"description"' />
|
||||
<xsl:with-param name='content' select='subtitle' />
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name='metadata'>
|
||||
<xsl:with-param name='name' select='"generator"' />
|
||||
<xsl:with-param name='content' select='StreamBurner' />
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name='metadata'>
|
||||
<xsl:with-param name='name' select='"mimetype"' />
|
||||
<xsl:with-param name='content' select='"text/x-opml"' />
|
||||
</xsl:call-template>
|
||||
<title>
|
||||
<xsl:choose>
|
||||
<xsl:when test='title and not(title="")'>
|
||||
<xsl:value-of select='title'/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>StreamBurner</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</title>
|
||||
<!-- TODO media='print' -->
|
||||
<link href='/css/stylesheet.css' rel='stylesheet' type='text/css' media='screen'/>
|
||||
<link rel='icon' type='image/svg+xml' href='/graphic/xmpp.svg'/>
|
||||
<!-- whether language code is of direction right-to-left -->
|
||||
<xsl:if test='$rtl'>
|
||||
<link id='semitic' href='/css/stylesheet-rtl.css' rel='stylesheet' type='text/css' />
|
||||
</xsl:if>
|
||||
<script type='text/javascript' src='/script/marked.min.js'/>
|
||||
<script type='text/javascript' src='/script/postprocess.js'/>
|
||||
</head>
|
||||
<body>
|
||||
<div id='actions'>
|
||||
<a href='https://git.xmpp-it.net/sch/PubSubToAtom'
|
||||
title='About PubSub To Atom.'>
|
||||
About
|
||||
</a>
|
||||
<a href='https://aboutfeeds.com/'
|
||||
title='Of the benefits of syndication feed.'
|
||||
id='aboutfeeds'>
|
||||
Feeds
|
||||
</a>
|
||||
<a href='https://xmpp.org/about/technology-overview/'
|
||||
title='Of the benefits of XMPP.'>
|
||||
XMPP
|
||||
</a>
|
||||
<a href='https://join.jabber.network/#syndication@conference.movim.eu?join'
|
||||
title='Syndictaion and PubSub.'>
|
||||
Groupchat
|
||||
</a>
|
||||
</div>
|
||||
<div id='feed'>
|
||||
<div id='header'>
|
||||
<!-- feed title -->
|
||||
<h1 id='title'>
|
||||
<xsl:choose>
|
||||
<xsl:when test='//head/title and not(//head/title="") and count(//outline) > 1'>
|
||||
<xsl:value-of select='//head/title'/>
|
||||
</xsl:when>
|
||||
<xsl:when test='//outline'>
|
||||
<xsl:value-of select='//outline/@text'/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
StreamBurner OPML Feed
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</h1>
|
||||
<!-- feed subtitle -->
|
||||
<h2 id='subtitle'>
|
||||
<xsl:choose>
|
||||
<xsl:when test='//head/description and not(//head/description="") and count(//outline) > 1'>
|
||||
<xsl:value-of select='//head/description'/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
Outline Processor Markup Language
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</h2>
|
||||
</div>
|
||||
<xsl:if test='count(//outline) > 1'>
|
||||
<div id='menu'>
|
||||
<h3>Subscriptions</h3>
|
||||
<!-- xsl:for-each select='outline[position() <21]' -->
|
||||
<ul>
|
||||
<xsl:for-each select='//outline[not(position() > 20)]'>
|
||||
<li>
|
||||
<xsl:element name='a'>
|
||||
<xsl:attribute name='href'>
|
||||
<xsl:text>#stremburner-</xsl:text>
|
||||
<xsl:value-of select='position()'/>
|
||||
</xsl:attribute>
|
||||
<xsl:choose>
|
||||
<xsl:when test='string-length(@text) > 0'>
|
||||
<xsl:value-of select='@text'/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
*** No Title ***
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:element>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
</div>
|
||||
</xsl:if>
|
||||
<div id='articles'>
|
||||
<!-- opml outline -->
|
||||
<xsl:choose>
|
||||
<xsl:when test='//outline'>
|
||||
<ul>
|
||||
<xsl:for-each select='//outline[not(position() > 20)]'>
|
||||
<li>
|
||||
<div class='entry'>
|
||||
<!-- outline title -->
|
||||
<h3 class='title'>
|
||||
<xsl:element name='a'>
|
||||
<xsl:attribute name='href'>
|
||||
<xsl:value-of select='@xmlUrl'/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name='title'>
|
||||
<xsl:value-of select='@text'/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name='id'>
|
||||
<xsl:text>stremburner-</xsl:text>
|
||||
<xsl:value-of select='position()'/>
|
||||
</xsl:attribute>
|
||||
<xsl:choose>
|
||||
<xsl:when test='string-length(@text) > 0'>
|
||||
<xsl:value-of select='@text'/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
*** No Title ***
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:element>
|
||||
</h3>
|
||||
<!-- entry content -->
|
||||
<h4>
|
||||
<xsl:value-of select='@text'/>
|
||||
</h4>
|
||||
<p class='content'>
|
||||
<xsl:value-of select='@xmlUrl'/>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<div class='notice no-entry'></div>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</div>
|
||||
</div>
|
||||
<div id='references'>
|
||||
<a href='https://joinjabber.org/'
|
||||
title='An Inclusive Space On The Jabber Network.'>
|
||||
JoinJabber
|
||||
</a>
|
||||
<a href='https://libervia.org/'
|
||||
title='The Universal Communication Ecosystem.'>
|
||||
Libervia
|
||||
</a>
|
||||
<a href='https://join.movim.eu/'
|
||||
title='The Social Platform Shaped For Your Community.'>
|
||||
Movim
|
||||
</a>
|
||||
<a href='https://modernxmpp.org/'
|
||||
title='A Project To Improve The Quality Of User-To-User Messaging Applications That Use Xmpp.'>
|
||||
Modern
|
||||
</a>
|
||||
<a href='https://xmpp.org/'
|
||||
title='The Universal Messaging Standard.'>
|
||||
XMPP
|
||||
</a>
|
||||
<a href='https://xmpp.org/extensions/xep-0060.html'
|
||||
title='XEP-0060: Publish-Subscribe.'>
|
||||
PubSub
|
||||
</a>
|
||||
</div>
|
||||
<!-- note -->
|
||||
<p id='note'>
|
||||
<i>
|
||||
This is an
|
||||
<b title ='Outline Processor Markup Language'>OPML</b>
|
||||
document which is conveyed as an HTML document; This
|
||||
document includes a list of subscriptionsis and is
|
||||
intended to be imported to a syndication feed reader
|
||||
which provides automated notifications on desktop and
|
||||
mobile. <span id="selection-link">Click here</span> for
|
||||
a selection of software and pick the ones that would fit
|
||||
you best!
|
||||
</i>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
Loading…
Add table
Add a link
Reference in a new issue