From 704be3f90bb4536c73922cd2dc18e42baf39d71b Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Mon, 14 Mar 2022 06:33:03 +0100 Subject: [PATCH] docs upd --- resources/desktop/com.github.rssguard.appdata.xml | 2 +- resources/docs/Documentation.md | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/resources/desktop/com.github.rssguard.appdata.xml b/resources/desktop/com.github.rssguard.appdata.xml index 03977a5b5..034dccd76 100644 --- a/resources/desktop/com.github.rssguard.appdata.xml +++ b/resources/desktop/com.github.rssguard.appdata.xml @@ -26,7 +26,7 @@ https://github.com/sponsors/martinrotter - + none diff --git a/resources/docs/Documentation.md b/resources/docs/Documentation.md index f54010dd1..f1ab2e245 100644 --- a/resources/docs/Documentation.md +++ b/resources/docs/Documentation.md @@ -89,21 +89,23 @@ Sometimes you need to tweak incoming article - mark it starred, remove ads from alt-img #### Writing article filter -Article filters are small JavaScript pieces of code which must provide function with prototype: +Article filters are small `JavaScript` pieces of code which must provide function with prototype: ```js function filterMessage() { } ``` -The function should be fast enough and must return values which belong to enumeration [`FilteringAction`](#FilteringAction-enum). +The function should be fast and must return values which belong to enumeration [`FilteringAction`](#FilteringAction-enum). Each article is accessible in your script via global variable named `msg` of type `MessageObject`, see [this file](https://github.com/martinrotter/rssguard/blob/master/src/librssguard/core/messageobject.h) for the declaration. Some properties are writeable, allowing you to change contents of the article before it is written to RSS Guard's DB. You can mark article important, change its description, perhaps change author name or even assign some label to it!!! +Almost any changes you make are synchronized back to feed service if the particular RSS Guard plugin supports it. + You can use [special placeholders](#userd-plac) within article filter. Also, there is a special variable named `utils`. This variable is of type `FilterUtils` and offers some useful [utility functions](#utils-object) for you to use in your filters. -RSS Guard allows to use the list of labels assigned to each article. You can, therefore, execute actions in your filtering script, based on which labels are assigned to the article. The property is called `assignedLabels` and is array of [`Label`](#Label-class) objects. If you change labels assigned to some article, then the change will be eventually [synchronized](#sfrl) back to server if respective plugin/service supports it. +RSS Guard allows to use the list of labels assigned to each article. You can, therefore, execute actions in your filtering script, based on which labels are assigned to the article. The property is called `assignedLabels` and is array of [`Label`](#Label-class) objects. Passed article also offers special function: ```js