about summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2022-11-09 07:35:40 +0900
committerNguyễn Gia Phong <mcsinyx@disroot.org>2022-11-09 07:35:40 +0900
commit81854d85ac7a825f430e925344176abfe3a16e55 (patch)
tree1c6c9554e72b961665d821be25b4f6f06222cd2a /doc
parentf5906a926b80717691ef55bbaf02c9e06c257cbf (diff)
downloadfead-81854d85ac7a825f430e925344176abfe3a16e55.tar.gz
Polish for distribution 0.1.0
Diffstat (limited to 'doc')
-rw-r--r--doc/fead.h2m34
1 files changed, 34 insertions, 0 deletions
diff --git a/doc/fead.h2m b/doc/fead.h2m
new file mode 100644
index 0000000..c3b19b9
--- /dev/null
+++ b/doc/fead.h2m
@@ -0,0 +1,34 @@
+[template]
+The template is used by Python str.format to generate each advert.
+It can contain the following fields, delimited by braces ('{' and '}').
+
+  source_title   title of the web feed
+  source_link    URL to the feed's website
+  title          title of the feed item
+  link           URL to the item
+  time           publication time
+  summary        truncated content or description
+
+The publication time is a Python datetime.datetime object,
+which supports at least C89 format codes, e.g. {time:%Y-%m-%d}.
+
+[examples]
+Given the these URLs in a feeds file:
+
+  https://adol.pw/index.xml
+  https://cnx.gdn/feed.xml
+  https://xrvs.net/index.xml
+
+Advertisement of the two latest blogs among them, along with articles
+by Drew DeVault, can be generated via the following command.
+
+  echo "<article>
+    <h3><a href='{link}'>{title}</a></h3>
+    {summary}&mdash;<a href='{source_link}'>{source_title}</a>, {time:%F}
+  </article>" | fead -F feeds -f https://drewdevault.com/blog/index.xml -n 2
+
+[reporting bugs]
+Issues should be reported to <~cnx/misc@lists.sr.ht>.
+
+[see also]
+python(1), strftime(3)