From 045d993ddc6499b4514a1001417f499668f7b6e1 Mon Sep 17 00:00:00 2001 From: antares Date: Sat, 30 Nov 2024 20:17:10 -0800 Subject: [PATCH] Added README --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..1bdb674 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ + +# Pleroma Comments + +**Pleroma Comments** is a Pandoc filter that generates a comments section by fetching replies from the Fediverse (through Pleroma servers). + +Example: [https://antares.neocities.org/blog/pandoc-filter-pleroma-comments](https://antares.neocities.org/blog/pandoc-filter-pleroma-comments) + +## Variables + +The filter uses the variable `pleroma-urls` for input which can be defined in the manuscript's YAML header. + +* `pleroma-urls`: a list of strings that should contain the URLs of the posts to source replies from. + +The filter exports variables that can be used in a pandoc template. + +* `pleroma-comments`: string, the full comments section rendered by the script. +* `pleroma-comments-count`: integer, the number of comments received by the script. +* `pleroma-has-comments`: boolean, whether or not there are comments available +* `pleroma`: table of strings, post IDs and their full URLs. + +## Usage + +In a Pandoc template, include the following to generate the entire comments section. + + $if(pleroma-urls)$ +
+

Comments ($pleroma-comments-count$)

+

Reply to any of the bulleted links to leave a comment.

+ + $pleroma-comments$ + $endif$ + +Add a link to jump to the comments section if there are any comments. + + $if(pleroma-has-comments)$ + View $pleroma-comments-count$ comment(s). + $endif$