mirror of
https://notabug.org/scuti/pleroma-comments
synced 2024-12-22 10:59:44 +05:30
Pandoc filter that generates a comments section based on replies from Pleroma.
https://antares.neocities.org/blog/pandoc-filter-pleroma-comments
pleroma-comments.css | ||
pleroma-comments.lua | ||
README.md |
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
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 availablepleroma
: 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)$
<hr/>
<h2 id="comments">Comments ($pleroma-comments-count$)</h2>
<p>Reply to any of the bulleted links to leave a comment.</p>
<ul>
$for(pleroma)$
<li><a href="$pleroma.link$">$pleroma.id$</a></li>
$endfor$
</ul>
$pleroma-comments$
$endif$
Add a link to jump to the comments section if there are any comments.
$if(pleroma-has-comments)$
<a href="#comments">View $pleroma-comments-count$ comment(s).</a>
$endif$