Hint: The basename of an abstractor's file should exactly match the name of a field you want to abstract. E.g. if you have a field called rss_feed and you want to process it, you will need an /app/abstractors/rss_feed.js file.

Use cases

Abstractors are used on this very page to add markdown by using marked. Apart from this I used abstractors to fetch twitter post based on id.

Pro tip: abstractors work great with arrays of objects, templatitators and deeply nested structures too without the need to change abstractor's behaviour. So, if you want to display a series of sections with marked text in each, you can simply make an array of objects containing doc field each.

Initialization

Every abstractor need to export two functions: init() and abstract(). Init runs only once per enduro render event, while abstract run for every key named as the abstractor.

Abstractors and multilingual support

If you want your abstracted fields to be translated too, you should expand your code to add language-specific fields in your context files. The code may look like this: