Compare commits

...

2 Commits

Author SHA1 Message Date
pictuga 7375adce33 sheet.xsl: fix & improve 2020-04-15 23:34:28 +02:00
pictuga 663212de0a sheet.xsl: various cosmetic improvements 2020-04-15 23:22:45 +02:00
2 changed files with 23 additions and 9 deletions

View File

@ -52,8 +52,9 @@ def parse_rules(filename=None):
# for each rule
if rules[section][arg].startswith('file:'):
paths = [os.path.join(sys.prefix, 'share/morss', rules[section][arg][5:]),
os.path.join(os.path.dirname(__file__), '..', rules[section][arg][5:])]
paths = [os.path.join(sys.prefix, 'share/morss/www', rules[section][arg][5:]),
os.path.join(os.path.dirname(__file__), '../www', rules[section][arg][5:]),
os.path.join(os.path.dirname(__file__), '../..', rules[section][arg][5:])]
for path in paths:
try:

View File

@ -11,7 +11,6 @@
<xsl:output method="html"/>
<xsl:template match="/">
<!DOCTYPE html>
<html>
<head>
<title>RSS feed by morss</title>
@ -35,14 +34,28 @@
.item {
background-color: #FFFAF4;
border: 1px solid silver;
padding: 1%;
margin: 1%;
max-width: 100%;
}
.item > a {
.item > * {
padding: 1%;
}
.item > :not(:last-child) {
border-bottom: 1px solid silver;
}
.item > a {
display: block;
font-weight: bold;
font-size: 1.5em;
}
.content * {
max-width: 100%;
}
</style>
</head>
@ -74,11 +87,11 @@
</a>
<div class="desc">
<xsl:value-of select="rssfake:description|description|atom:summary|atom03:summary"/>
<xsl:copy-of select="rssfake:description|description|atom:summary|atom03:summary"/>
</div>
<div class="content">
<xsl:value-of select="content:encoded|atom:content|atom03:content"/>
<xsl:copy-of select="content:encoded|atom:content|atom03:content"/>
</div>
</div>
</xsl:for-each>
@ -88,8 +101,8 @@
document.getElementById("url").innerHTML = window.location.href.replace(':html/', '')
if (!/:html/.test(window.location.href))
for (var content of document.getElementsByClassName("content"))
content.innerHTML = content.innerText
for (var content of document.querySelectorAll(".desc,.content"))
content.innerHTML = content.children.children ? content.innerHTML : content.innerText
</script>
</body>
</html>