Merge branch 'develop' into main
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
commit
4546aed507
|
@ -2,7 +2,7 @@
|
||||||
:doctype: manpage
|
:doctype: manpage
|
||||||
:Author: tastytea
|
:Author: tastytea
|
||||||
:Email: tastytea@tastytea.de
|
:Email: tastytea@tastytea.de
|
||||||
:Date: 2019-09-20
|
:Date: 2019-09-21
|
||||||
:Revision: 0.0.0
|
:Revision: 0.0.0
|
||||||
:man source: remwharead
|
:man source: remwharead
|
||||||
:man manual: General Commands Manual
|
:man manual: General Commands Manual
|
||||||
|
@ -92,7 +92,12 @@ Print version, copyright and license.
|
||||||
|
|
||||||
.Output all articles by Jan Müller, consider different spellings.
|
.Output all articles by Jan Müller, consider different spellings.
|
||||||
====
|
====
|
||||||
`remwharead -e simple -S 'Jan\[[:space:]]+M(ü|ue)ller' -r`
|
`remwharead -e simple -S 'Jan[\s]+M(ü|ue?)ller' -r`
|
||||||
|
====
|
||||||
|
|
||||||
|
.Export all things from the last week to an RSS feed.
|
||||||
|
====
|
||||||
|
`remwharead -e rss -T $(date -d "-1 week" -I),$(date -I) | sed 's|<link/>|<link>https://example.com/</link>|' > /var/www/feed.rss`
|
||||||
====
|
====
|
||||||
|
|
||||||
=== Display database
|
=== Display database
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
#include <cstdint>
|
||||||
#include <Poco/XML/XMLWriter.h>
|
#include <Poco/XML/XMLWriter.h>
|
||||||
#include <Poco/SAX/AttributesImpl.h>
|
#include <Poco/SAX/AttributesImpl.h>
|
||||||
#include <Poco/DateTime.h>
|
#include <Poco/DateTime.h>
|
||||||
|
@ -57,7 +58,6 @@ namespace remwharead
|
||||||
writer.endElement("", "", "title");
|
writer.endElement("", "", "title");
|
||||||
|
|
||||||
writer.startElement("", "", "link");
|
writer.startElement("", "", "link");
|
||||||
// FIXME: There has to be an URL here.
|
|
||||||
writer.endElement("", "", "link");
|
writer.endElement("", "", "link");
|
||||||
|
|
||||||
writer.startElement("", "", "description");
|
writer.startElement("", "", "description");
|
||||||
|
@ -79,7 +79,20 @@ namespace remwharead
|
||||||
writer.startElement("", "", "item");
|
writer.startElement("", "", "item");
|
||||||
|
|
||||||
writer.startElement("", "", "title");
|
writer.startElement("", "", "title");
|
||||||
writer.characters(entry.title);
|
if (!entry.title.empty())
|
||||||
|
{
|
||||||
|
writer.characters(entry.title);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
constexpr std::uint8_t maxlen = 100;
|
||||||
|
string title = entry.description.substr(0, maxlen);
|
||||||
|
if (entry.description.length() > maxlen)
|
||||||
|
{
|
||||||
|
title += " […]";
|
||||||
|
}
|
||||||
|
writer.characters(title);
|
||||||
|
}
|
||||||
writer.endElement("", "", "title");
|
writer.endElement("", "", "title");
|
||||||
|
|
||||||
writer.startElement("", "", "link");
|
writer.startElement("", "", "link");
|
||||||
|
@ -101,11 +114,11 @@ namespace remwharead
|
||||||
string description = entry.description;
|
string description = entry.description;
|
||||||
if (!description.empty())
|
if (!description.empty())
|
||||||
{
|
{
|
||||||
description += "\n\n";
|
description = "<p>" + description + "</p>";
|
||||||
}
|
}
|
||||||
if (!entry.tags.empty())
|
if (!entry.tags.empty())
|
||||||
{
|
{
|
||||||
description += "Tags: ";
|
description += "<p><strong>Tags:</strong> ";
|
||||||
for (const string &tag : entry.tags)
|
for (const string &tag : entry.tags)
|
||||||
{
|
{
|
||||||
description += tag;
|
description += tag;
|
||||||
|
@ -114,10 +127,13 @@ namespace remwharead
|
||||||
description += ", ";
|
description += ", ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
description += "</p>";
|
||||||
}
|
}
|
||||||
if (!entry.archive_uri.empty())
|
if (!entry.archive_uri.empty())
|
||||||
{
|
{
|
||||||
description += "\n\nArchived version: " + entry.archive_uri;
|
description += "<p><strong>Archived version:</strong> "
|
||||||
|
"<a href=\"" + entry.archive_uri + "\">"
|
||||||
|
+ entry.archive_uri + "</a>";
|
||||||
}
|
}
|
||||||
writer.startElement("", "", "description");
|
writer.startElement("", "", "description");
|
||||||
writer.characters(description);
|
writer.characters(description);
|
||||||
|
|
Loading…
Reference in New Issue