From e515ca109faa897e84be8a97a1240c59df612dd4 Mon Sep 17 00:00:00 2001 From: ConfuSomu Date: Wed, 5 Jul 2023 15:14:46 +0200 Subject: Implement a small library of ActivityPub objects These objects allow, and will allow us, to move HTML rendering out of the archive parser and into separate classes. Each of the derived classes specialise HTML rendering for their specific requirements. Furthermore, these ActivityPub objects will be able to be expanded upon and have support to be written to disk, in a database, for instance. Separating ActivityPub object retrieving from rendering allows us to implement other retrieving sources and methods, such as downloading posts from a configured remote instance. --- src/templates/apactivity.html | 16 ++++++++++++++++ src/templates/apattachment.html | 3 +++ src/templates/apattachmentlist_item.html | 3 +++ src/templates/appost.html | 13 +++++++++++++ src/templates/apreblog.html | 4 ++++ 5 files changed, 39 insertions(+) create mode 100644 src/templates/apactivity.html create mode 100644 src/templates/apattachment.html create mode 100644 src/templates/apattachmentlist_item.html create mode 100644 src/templates/appost.html create mode 100644 src/templates/apreblog.html (limited to 'src/templates') diff --git a/src/templates/apactivity.html b/src/templates/apactivity.html new file mode 100644 index 0000000..298c28c --- /dev/null +++ b/src/templates/apactivity.html @@ -0,0 +1,16 @@ + + + + + Status info + + +

{{type}}

+

Activity info:

+ + {{object}} + + diff --git a/src/templates/apattachment.html b/src/templates/apattachment.html new file mode 100644 index 0000000..3befd3c --- /dev/null +++ b/src/templates/apattachment.html @@ -0,0 +1,3 @@ + +

{{filename}}

+

Alt: {{alt-text}}

diff --git a/src/templates/apattachmentlist_item.html b/src/templates/apattachmentlist_item.html new file mode 100644 index 0000000..dc2fd67 --- /dev/null +++ b/src/templates/apattachmentlist_item.html @@ -0,0 +1,3 @@ +

Attachment {{id}}


+
{{attachment}}
+
diff --git a/src/templates/appost.html b/src/templates/appost.html new file mode 100644 index 0000000..12d2f1e --- /dev/null +++ b/src/templates/appost.html @@ -0,0 +1,13 @@ +

Post info:

+ + +
CW: {{summary}}
+
{{content}}
+
{{attachment-div}}
diff --git a/src/templates/apreblog.html b/src/templates/apreblog.html new file mode 100644 index 0000000..da99268 --- /dev/null +++ b/src/templates/apreblog.html @@ -0,0 +1,4 @@ + +
{{content}}
-- cgit v1.2.3-54-g00ecf