From be0d0417bd9c8862e8d6fbb9e44bf0c7ad39acde Mon Sep 17 00:00:00 2001 From: Andrew Cantino Date: Wed, 5 Apr 2017 17:52:55 -0400 Subject: [PATCH] Fix #1799 by linking to Liquid docs (#1953) --- app/models/agents/change_detector_agent.rb | 2 +- app/models/agents/commander_agent.rb | 2 +- app/models/agents/data_output_agent.rb | 2 +- app/models/agents/email_agent.rb | 2 +- app/models/agents/google_calendar_publish_agent.rb | 2 +- app/models/agents/liquid_output_agent.rb | 4 +--- app/models/agents/pushover_agent.rb | 2 +- app/models/agents/website_agent.rb | 6 +++--- 8 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/models/agents/change_detector_agent.rb b/app/models/agents/change_detector_agent.rb index 3f5d718a..1a0ba03f 100644 --- a/app/models/agents/change_detector_agent.rb +++ b/app/models/agents/change_detector_agent.rb @@ -5,7 +5,7 @@ module Agents description <<-MD The Change Detector Agent receives a stream of events and emits a new event when a property of the received event changes. - `property` specifies a Liquid template that expands to the property to be watched, where you can use a variable `last_property` for the last property value. If you want to detect a new lowest price, try this: `{% assign drop = last_property | minus: price %}{% if last_property == blank or drop > 0 %}{{ price | default: last_property }}{% else %}{{ last_property }}{% endif %}` + `property` specifies a [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) template that expands to the property to be watched, where you can use a variable `last_property` for the last property value. If you want to detect a new lowest price, try this: `{% assign drop = last_property | minus: price %}{% if last_property == blank or drop > 0 %}{{ price | default: last_property }}{% else %}{{ last_property }}{% endif %}` `expected_update_period_in_days` is used to determine if the Agent is working. diff --git a/app/models/agents/commander_agent.rb b/app/models/agents/commander_agent.rb index 035d1ba0..ede7760e 100644 --- a/app/models/agents/commander_agent.rb +++ b/app/models/agents/commander_agent.rb @@ -19,7 +19,7 @@ module Agents * `configure`: Target Agents have their options updated with the contents of `configure_options`. - Here's a tip: you can use Liquid templating to dynamically determine the action type. For example: + Here's a tip: you can use [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) templating to dynamically determine the action type. For example: - To create a CommanderAgent that receives an event from a WeatherAgent every morning to kick an agent flow that is only useful in a nice weather, try this: `{% if conditions contains 'Sunny' or conditions contains 'Cloudy' %}` `run{% endif %}` diff --git a/app/models/agents/data_output_agent.rb b/app/models/agents/data_output_agent.rb index cb31a5d5..926f8e03 100644 --- a/app/models/agents/data_output_agent.rb +++ b/app/models/agents/data_output_agent.rb @@ -57,7 +57,7 @@ module Agents # Liquid Templating - In Liquid templating, the following variable is available: + In [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) templating, the following variable is available: * `events`: An array of events being output, sorted in the given order, up to `events_to_show` in number. For example, if source events contain a site title in the `site_title` key, you can refer to it in `template.title` by putting `{{events.first.site_title}}`. diff --git a/app/models/agents/email_agent.rb b/app/models/agents/email_agent.rb index b0b49350..65fbbd0a 100644 --- a/app/models/agents/email_agent.rb +++ b/app/models/agents/email_agent.rb @@ -9,7 +9,7 @@ module Agents description <<-MD The Email Agent sends any events it receives via email immediately. - You can specify the email's subject line by providing a `subject` option, which can contain Liquid formatting. E.g., + You can specify the email's subject line by providing a `subject` option, which can contain [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) formatting. E.g., you could provide `"Huginn email"` to set a simple subject, or `{{subject}}` to use the `subject` key from the incoming Event. By default, the email body will contain an optional `headline`, followed by a listing of the Events' keys. diff --git a/app/models/agents/google_calendar_publish_agent.rb b/app/models/agents/google_calendar_publish_agent.rb index 567c12ab..c852d48c 100644 --- a/app/models/agents/google_calendar_publish_agent.rb +++ b/app/models/agents/google_calendar_publish_agent.rb @@ -32,7 +32,7 @@ module Agents `google` `service_account_email` - The authorised service account. - `google` `key_file` OR `google` `key` - The path to the key file or the key itself. Liquid formatting is supported if you want to use a Credential. (E.g., `{% credential google_key %}`) + `google` `key_file` OR `google` `key` - The path to the key file or the key itself. [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) formatting is supported if you want to use a Credential. (E.g., `{% credential google_key %}`) `google` `key_secret` - The secret for the key, typically 'notasecret' diff --git a/app/models/agents/liquid_output_agent.rb b/app/models/agents/liquid_output_agent.rb index 44ba9f86..45fa9fe7 100644 --- a/app/models/agents/liquid_output_agent.rb +++ b/app/models/agents/liquid_output_agent.rb @@ -28,9 +28,7 @@ module Agents # Liquid Templating - The content you provide will be run as a Liquid template. The data from the last event received will be used when processing the Liquid template. - - To learn more about Liquid templates, go here: [http://liquidmarkup.org](http://liquidmarkup.org "Liquid Templating") + The content you provide will be run as a [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) template. The data from the last event received will be used when processing the Liquid template. # Modes diff --git a/app/models/agents/pushover_agent.rb b/app/models/agents/pushover_agent.rb index 09043579..f438a4f6 100644 --- a/app/models/agents/pushover_agent.rb +++ b/app/models/agents/pushover_agent.rb @@ -16,7 +16,7 @@ module Agents * `user`: the user or group key (not e-mail address). * `expected_receive_period_in_days`: is maximum number of days that you would expect to pass between events being received by this agent. - The following options are all Liquid templates whose evaluated values will be posted to the Pushover API. Only the `message` parameter is required, and if it is blank API call is omitted. + The following options are all [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) templates whose evaluated values will be posted to the Pushover API. Only the `message` parameter is required, and if it is blank API call is omitted. Pushover API has a `512` Character Limit including `title`. `message` will be truncated. diff --git a/app/models/agents/website_agent.rb b/app/models/agents/website_agent.rb index 67d7a9d9..4350f009 100644 --- a/app/models/agents/website_agent.rb +++ b/app/models/agents/website_agent.rb @@ -23,8 +23,8 @@ module Agents The WebsiteAgent can also scrape based on incoming events. - * Set the `url_from_event` option to a Liquid template to generate the url to access based on the Event. (To fetch the url in the Event's `url` key, for example, set `url_from_event` to `{{ url }}`.) - * Alternatively, set `data_from_event` to a Liquid template to use data directly without fetching any URL. (For example, set it to `{{ html }}` to use HTML contained in the `html` key of the incoming Event.) + * Set the `url_from_event` option to a [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) template to generate the url to access based on the Event. (To fetch the url in the Event's `url` key, for example, set `url_from_event` to `{{ url }}`.) + * Alternatively, set `data_from_event` to a [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) template to use data directly without fetching any URL. (For example, set it to `{{ html }}` to use HTML contained in the `html` key of the incoming Event.) * If you specify `merge` for the `mode` option, Huginn will retain the old payload and update it with new values. # Supported Document Types @@ -128,7 +128,7 @@ module Agents # Liquid Templating - In Liquid templating, the following variables are available: + In [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) templating, the following variables are available: * `_url_`: The URL specified to fetch the content from. When parsing `data_from_event`, this is not set.