From 7c031a76dfff92226d04c613b37825d8b966f444 Mon Sep 17 00:00:00 2001 From: Anthony Pizzurro Date: Fri, 9 Dec 2022 16:16:43 -0500 Subject: [PATCH 01/10] * Don't bother pulling snippets for tags * Use snippets from codeSnippets whenever possible --- scripts/generate.js | 51 ++++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/scripts/generate.js b/scripts/generate.js index 827c57ba..58d7330c 100644 --- a/scripts/generate.js +++ b/scripts/generate.js @@ -2,6 +2,8 @@ const fetch = require('node-fetch'); const fs = require('fs-extra'); const path = require('path'); +const SNIPPET_TYPES = ['expTests', 'filters', 'functions', 'tags']; + const PREFIX = { expTests: '', filters: '|', @@ -9,19 +11,6 @@ const PREFIX = { tags: '~', }; -// Skip snippet generation if format is incompatible -const SKIP_SNIPPET_GENERATION = [ - 'set', - 'for', - 'if', - 'flip', - 'import', - 'include', - 'from', - 'do', - 'module_attribute', -]; - const OMIT_SNIPPET = [ 'dnd_area', 'dnd_section', @@ -101,34 +90,31 @@ const buildSnippetDescription = (docEntry) => { return description; }; -const getFirstDefaultSnippet = (docEntry) => { - return docEntry.snippets.shift().code; -}; - const createSnippet = (docEntry, type) => { if (OMIT_SNIPPET.includes(docEntry.name)) { return; } - let snippetEntry = { - body: [ - SKIP_SNIPPET_GENERATION.includes(docEntry.name) - ? getFirstDefaultSnippet(docEntry) - : buildSnippetBody(docEntry, type), - ], - description: buildSnippetDescription(docEntry, type), - prefix: PREFIX[type] + docEntry.name, - }; - - return snippetEntry; + return [ + { + body: buildSnippetBody(docEntry, type), + description: buildSnippetDescription(docEntry, type), + prefix: PREFIX[type] + docEntry.name, + }, + ]; }; const createFile = async (data, type) => { - const docEntries = Object.values(data); + const snippetData = data[type]; + const docEntries = Object.values(snippetData); let snippets = {}; for (let entry of docEntries) { - snippets[entry['name']] = createSnippet(entry, type); + if (type === 'tags' && snippetData.codeSnippets[entry['name']]) { + snippets[entry['name']] = snippetData.codeSnippets[entry['name']]; + } else { + snippets[entry['name']] = createSnippet(entry, type); + } } try { @@ -149,10 +135,9 @@ const createFile = async (data, type) => { const createSnippetFiles = async () => { const data = await fetchHubldocs(); - const snippetTypes = Object.keys(data); - for (let type of snippetTypes) { - createFile(data[type], type); + for (let type of SNIPPET_TYPES) { + createFile(data, type); } }; From 93c3f5c3bb4c05491abf6c592b49b1608e754d80 Mon Sep 17 00:00:00 2001 From: Anthony Pizzurro Date: Fri, 9 Dec 2022 16:20:57 -0500 Subject: [PATCH 02/10] use correct property key --- scripts/generate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/generate.js b/scripts/generate.js index 58d7330c..c979ffdb 100644 --- a/scripts/generate.js +++ b/scripts/generate.js @@ -110,8 +110,8 @@ const createFile = async (data, type) => { let snippets = {}; for (let entry of docEntries) { - if (type === 'tags' && snippetData.codeSnippets[entry['name']]) { - snippets[entry['name']] = snippetData.codeSnippets[entry['name']]; + if (type === 'tags' && data.codeSnippets[entry['name']]) { + snippets[entry['name']] = data.codeSnippets[entry['name']]; } else { snippets[entry['name']] = createSnippet(entry, type); } From 2eb2e61c911b71da3db8118774023389e96b503a Mon Sep 17 00:00:00 2001 From: Anthony Pizzurro Date: Fri, 9 Dec 2022 16:23:01 -0500 Subject: [PATCH 03/10] fix snippet body shape --- scripts/generate.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/scripts/generate.js b/scripts/generate.js index c979ffdb..0f86acc3 100644 --- a/scripts/generate.js +++ b/scripts/generate.js @@ -95,13 +95,11 @@ const createSnippet = (docEntry, type) => { return; } - return [ - { - body: buildSnippetBody(docEntry, type), - description: buildSnippetDescription(docEntry, type), - prefix: PREFIX[type] + docEntry.name, - }, - ]; + return { + body: [buildSnippetBody(docEntry, type)], + description: buildSnippetDescription(docEntry, type), + prefix: PREFIX[type] + docEntry.name, + }; }; const createFile = async (data, type) => { From 4e9d17d74f18ad3fff3a8407f296fbace7851c11 Mon Sep 17 00:00:00 2001 From: Anthony Pizzurro Date: Fri, 9 Dec 2022 16:26:34 -0500 Subject: [PATCH 04/10] * fix snippet shape for exissting tags * commit example hubl tags for reference --- scripts/generate.js | 12 +- snippets/auto_gen/hubl_tags.json | 186 +++++++++++++++++-------------- 2 files changed, 109 insertions(+), 89 deletions(-) diff --git a/scripts/generate.js b/scripts/generate.js index 0f86acc3..7e325ea6 100644 --- a/scripts/generate.js +++ b/scripts/generate.js @@ -90,13 +90,15 @@ const buildSnippetDescription = (docEntry) => { return description; }; -const createSnippet = (docEntry, type) => { +const createSnippet = (docEntry, type, existingSnippet) => { if (OMIT_SNIPPET.includes(docEntry.name)) { return; } return { - body: [buildSnippetBody(docEntry, type)], + body: [ + existingSnippet ? existingSnippet : buildSnippetBody(docEntry, type), + ], description: buildSnippetDescription(docEntry, type), prefix: PREFIX[type] + docEntry.name, }; @@ -109,7 +111,11 @@ const createFile = async (data, type) => { let snippets = {}; for (let entry of docEntries) { if (type === 'tags' && data.codeSnippets[entry['name']]) { - snippets[entry['name']] = data.codeSnippets[entry['name']]; + snippets[entry['name']] = createSnippet( + entry, + type, + data.codeSnippets[entry['name']] + ); } else { snippets[entry['name']] = createSnippet(entry, type); } diff --git a/snippets/auto_gen/hubl_tags.json b/snippets/auto_gen/hubl_tags.json index 3192b844..50b8d188 100644 --- a/snippets/auto_gen/hubl_tags.json +++ b/snippets/auto_gen/hubl_tags.json @@ -1,553 +1,567 @@ { "block": { "body": [ - "{% block 'my_block' \n\tblock_name='${1:block_name}'%}\n\n{% endblock %}" + "{% block ${1:block_name} %}\n$0\n{% endblock %}" ], "description": "Blocks are regions in a template which can be overridden by child templates\nParameters:\n- block_name(String) A unique name for the block that should be used in both the parent and child template", "prefix": "~block" }, "blog_comments": { "body": [ - "{% blog_comments 'my_blog_comments' \n\tselect_blog='${1:select_blog}', \n\tlimit='${2:limit}', \n\tskip_css='${3:skip_css}'%}" + "{% blog_comments ${1:select_blog} ${2:limit} ${3:skip_css} %}" ], "description": "Renders the blog comments embed tag\nParameters:\n- select_blog('default' or blog id) Species which blog is connected to the comments embed\n- limit(number) Sets maximum number of comments\n- skip_css(bool) ", "prefix": "~blog_comments" }, "blog_social_sharing": { "body": [ - "{% blog_social_sharing 'my_blog_social_sharing' \n\tselect_blog='${1:select_blog}', \n\tdowngrade_shared_url='${2:downgrade_shared_url}'%}" + "{% blog_social_sharing ${1:select_blog} ${2:downgrade_shared_url} %}" ], "description": "Blog social sharing module\nParameters:\n- select_blog('default' or blog id) Species which blog is connected to the share counters\n- downgrade_shared_url(boolean) Use http in the url sent to the social media networks. Used to preserve counts when upgrading domains to https only.", "prefix": "~blog_social_sharing" }, "blog_subscribe": { "body": [ - "{% blog_subscribe 'my_blog_subscribe' \n\tselect_blog='${1:select_blog}', \n\ttitle='${2:title}', \n\tno_title='${3:no_title}', \n\tresponse_message='${4:response_message}', \n\tedit_form_link='${5:edit_form_link}'%}" + "{% blog_subscribe ${1:select_blog} ${2:title} ${3:no_title} ${4:response_message} ${5:edit_form_link} %}" ], "description": "Blog subscription module\nParameters:\n- select_blog('default' or blog id) Selects which blog subscription form to render\n- title(String) Defines text in an h3 tag title above the subscribe form\n- no_title(boolean) If True, the h3 tag above the title is removed\n- response_message(String) Defines the inline thank-you message that is rendered when a user submits a form\n- edit_form_link(String) Generates a link that allows users to click through to the corresponding Form editor screen", "prefix": "~blog_subscribe" }, "boolean": { "body": [ - "{% boolean 'my_boolean' \n\tvalue='${1:value}'%}" + "{% boolean ${1:value} %}" ], "description": "A boolean option\nParameters:\n- value(boolean) Determines whether the checkbox is checked or unchecked", "prefix": "~boolean" }, "call": { "body": [ - "{% call 'my_call' %}\n\n{% endcall %}" + "{% call ${1:macro_name}(${2:argument_names}) %}\n$0\n{% endcall %}" ], "description": "In some cases it can be useful to pass a macro to another macro. For this purpose you can use the special call block.", "prefix": "~call" }, "choice": { "body": [ - "{% choice 'my_choice' \n\tchoices='${1:choices}', \n\tvalue='${2:value}'%}" + "{% choice ${1:choices} ${2:value} %}" ], "description": "A list of options\nParameters:\n- choices(String) Comma-separated list of values, or list of value-label pairs\n- value(String) The default field value for the dropdown", "prefix": "~choice" }, "color": { "body": [ - "{% color 'my_color' \n\tcolor='${1:color}'%}" + "{% color ${1:color} %}" ], "description": "A color picker module\nParameters:\n- color(String) A default HEX color value for the color picker module", "prefix": "~color" }, "content_attribute": { "body": [ - "{% content_attribute 'my_content_attribute' %}\n\n{% end_content_attribute %}" + "{% content_attribute %}\n{% end_content_attribute %}" ], "description": "Sets default content in an attribute of the content object, such as content.email_body", "prefix": "~content_attribute" }, "cta": { "body": [ - "{% cta 'my_cta' \n\tembed_code='${1:embed_code}', \n\tfull_html='${2:full_html}', \n\timage_src='${3:image_src}', \n\timage_editor='${4:image_editor}', \n\tguid='${5:guid}', \n\timage_html='${6:image_html}', \n\timage_email='${7:image_email}'%}" + "{% cta ${1:embed_code} ${2:full_html} ${3:image_src} ${4:image_editor} ${5:guid} ${6:image_html} ${7:image_email} %}" ], "description": "Renders a CTA module\nParameters:\n- embed_code(String) The embed code for the CTA\n- full_html(String) The embed code for the CTA. Same as embed_code\n- image_src(String) Image src url that defines the preview image in the content editor\n- image_editor(String) Markup for the image editor preview\n- guid(String) The unique ID number of the default CTA\n- image_html(String) CTA image HTML without the CTA script\n- image_email(String) Email-friendly version of the CTA code", "prefix": "~cta" }, "custom_widget": { "body": [ - "{% custom_widget 'my_custom_widget' \n\twidget_definition='${1:widget_definition}', \n\twidget_name='${2:widget_name}'%}" + "{% custom_widget ${1:widget_definition} ${2:widget_name} %}" ], "description": "A custom module\nParameters:\n- widget_definition(json object) \n- widget_name(String) Specifies the internal Design Manager name of the custom module that you would like to render", "prefix": "~custom_widget" }, "cycle": { "body": [ - "{% cycle 'my_cycle' \n\tstring_to_print='${1:string_to_print}'%}" + "{% cycle ${1:string_to_print} %}" ], "description": "The cycle tag can be used within a for loop to cycle through a series of string values and print them with each iteration\nParameters:\n- string_to_print(String) A comma separated list of strings to print with each interation. The list will repeat if there are more iterations than string parameter values.", "prefix": "~cycle" }, "do": { "body": [ - "{% do list.append('value 2') %}" + "{% do ${1:expr} %}" ], "description": "Evaluates expression without printing out result.", "prefix": "~do" }, "email_each": { "body": [ - "{% email_each 'my_email_each' \n\tlist='${1:list}', \n\titem='${2:item}'%}\n\n{% endemail_each %}" + "{% email_each ${1:list} ${2:item} %}\n{% endemail_each %}" ], "description": "Allows looping over a list value in an email where a for loop would not work. Use \"item.\" to access the current element of the list.\nParameters:\n- list(String) \n- item(String) ", "prefix": "~email_each" }, "email_flex_area": { "body": [ - "{% email_flex_area 'my_email_flex_area' \n\tname='${1:name}', \n\tno_wrapper='${2:no_wrapper}', \n\textra_classes='${3:extra_classes}'%}" + "{% email_flex_area ${1:name} ${2:no_wrapper} ${3:extra_classes} %}" ], "description": "An email flexible area tag is a widget container which renders its contained widgets in a box grid, \nwith an email friendly table-based layout.\n\nThe layout schema is defined in a JSON structure at the content level; these tags are always empty\nin their declaring templates.\nParameters:\n- name(String) \n- no_wrapper(boolean) \n- extra_classes(String) ", "prefix": "~email_flex_area" }, "email_simple_subscription": { "body": [ - "{% email_simple_subscription 'my_email_simple_subscription' \n\theader='${1:header}', \n\tinput_help_text='${2:input_help_text}', \n\tbutton_text='${3:button_text}', \n\tinput_placeholder='${4:input_placeholder}'%}" + "{% email_simple_subscription ${1:header} ${2:subheader} ${3:input_help_text} ${4:button_text} ${5:input_placeholder} %}" ], - "description": "Simple email unsubscribe form\nParameters:\n- header(String) Renders text in an h1 tag above the unsubscribe form\n- input_help_text(String) Renders help text in an h3 tag above your email unsubscribe form field\n- button_text(String) Changes the text of the unsubscribe form submit button\n- input_placeholder(String) Adds placeholder text within the email address form field", + "description": "Simple email unsubscribe form\nParameters:\n- header(String) Renders text in an h1 tag above the unsubscribe form\n- subheader(String) Renders text in an h2 tag above the unsubscribe form below the h1\n- input_help_text(String) Renders help text in an h3 tag above your email unsubscribe form field\n- button_text(String) Changes the text of the unsubscribe form submit button\n- input_placeholder(String) Adds placeholder text within the email address form field", "prefix": "~email_simple_subscription" }, "email_subscriptions": { "body": [ - "{% email_subscriptions 'my_email_subscriptions' \n\theader='${1:header}', \n\tsubheader_text='${2:subheader_text}', \n\tunsubscribe_single_text='${3:unsubscribe_single_text}', \n\tunsubscribe_all_text='${4:unsubscribe_all_text}', \n\tunsubscribe_all_unsubbed_text='${5:unsubscribe_all_unsubbed_text}', \n\tunsubscribe_all_option='${6:unsubscribe_all_option}', \n\tbutton_text='${7:button_text}', \n\tresubscribe_button_text='${8:resubscribe_button_text}'%}" + "{% email_subscriptions ${1:header} ${2:subheader_text} ${3:unsubscribe_single_text} ${4:unsubscribe_all_text} ${5:unsubscribe_all_unsubbed_text} ${6:unsubscribe_all_option} ${7:button_text} ${8:resubscribe_button_text} %}" ], "description": "Email subscription preferences form\nParameters:\n- header(String) Renders text in an h1 tag above the subscription preferences form\n- subheader_text(String) Populates text below the heading above the unsubscribe preferences\n- unsubscribe_single_text(String) Renders text in a

above the subscription options\n- unsubscribe_all_text(String) Renders text in a

above the unsubscribe from all emails checkbox input\n- unsubscribe_all_unsubbed_text(String) Populates text within a

that renders, if a contact is currently unsubscribed from all emails\n- unsubscribe_all_option(String) Sets the text next to the unsubscribe from all emails checkbox input\n- button_text(String) Sets the text of the submit button that updates subscription preferences\n- resubscribe_button_text(String) Sets the text of the submit button for when contacts are resubscribing", "prefix": "~email_subscriptions" }, "email_subscriptions_confirmation": { "body": [ - "{% email_subscriptions_confirmation 'my_email_subscriptions_confirmation' \n\theader='${1:header}', \n\tsubheader_text='${2:subheader_text}', \n\tunsubscribe_all_success='${3:unsubscribe_all_success}', \n\tsubscription_update_success='${4:subscription_update_success}'%}" + "{% email_subscriptions_confirmation ${1:header} ${2:subheader_text} ${3:unsubscribe_all_success} ${4:subscription_update_success} %}" ], "description": "Email unsubscribe form\nParameters:\n- header(String) Renders text in an h1 tag above the unsubscribe form\n- subheader_text(String) Populates text above the confirmation message\n- unsubscribe_all_success(String) Sets the text that will display when someone unsubscribes from all email communications\n- subscription_update_success(String) Sets the text when a recipient updates his or her subscription preferences", "prefix": "~email_subscriptions_confirmation" }, "extends": { "body": [ - "{% extends 'my_extends' \n\tpath='${1:path}'%}" + "{% extends '${1:path}' %}" ], "description": "Template inheritance allows you to build a base “skeleton” template that contains all the common elements of your site and defines blocks that child templates can override.\nParameters:\n- path(String) Design Manager file path to parent template", "prefix": "~extends" }, "flip": { "body": [ - "{% flip val_true %}\nworld\n{% with %}\nhello\n{% endflip %}" + "{% flip %}\n{% endflip %}" ], "description": "Outputs the first and second block in specified or reverse order depending on the evaluation of the condition", "prefix": "~flip" }, "follow_me": { "body": [ - "{% follow_me 'my_follow_me' \n\ttitle='${1:title}', \n\tmodule_title_tag='${2:module_title_tag}'%}" + "{% follow_me ${1:title} ${2:module_title_tag} %}" ], "description": "Deprecated: Use follow me default module instead.\nParameters:\n- title(String) Prints an h3 heading tag above the follow me module\n- module_title_tag(String) Specifies a heading tag h1-h6 to use for the module title", "prefix": "~follow_me" }, "for": { "body": [ - "{% for item in items %}\n {{ item }}\n{% endfor %}" + "{% for ${1:items} in ${2:list} %}\n{{ ${1} }}$0\n{% endfor %}" ], "description": "Outputs the inner content for each item in the given iterable\nParameters:\n- items_to_iterate(String) Specifies the name of a single item in the sequence or dict.", "prefix": "~for" }, "form": { "body": [ - "{% form 'my_form' \n\tform_key='${1:form_key}', \n\tform_to_use='${2:form_to_use}', \n\ttitle='${3:title}', \n\tno_title='${4:no_title}', \n\tform_follow_ups_follow_up_type='${5:form_follow_ups_follow_up_type}', \n\tsimple_email_for_live_id='${6:simple_email_for_live_id}', \n\tsimple_email_for_buffer_id='${7:simple_email_for_buffer_id}', \n\tfollow_up_type_simple='${8:follow_up_type_simple}', \n\tfollow_up_type_automation='${9:follow_up_type_automation}', \n\tsimple_email_campaign_id='${10:simple_email_campaign_id}', \n\tform_follow_ups_workflow_id='${11:form_follow_ups_workflow_id}', \n\tresponse_redirect_url='${12:response_redirect_url}', \n\tresponse_redirect_id='${13:response_redirect_id}', \n\tresponse_response_type='${14:response_response_type}', \n\tresponse_message='${15:response_message}', \n\tnotifications_are_overridden='${16:notifications_are_overridden}', \n\tnotifications_override_guid_buffer='${17:notifications_override_guid_buffer}', \n\tnotifications_override_guid='${18:notifications_override_guid}', \n\tnotifications_override_email_addresses='${19:notifications_override_email_addresses}', \n\tgotowebinar_webinar_key='${20:gotowebinar_webinar_key}', \n\tsfdc_campaign='${21:sfdc_campaign}'%}" + "{% form ${1:form_key} ${2:form_to_use} ${3:title} ${4:no_title} ${5:form_follow_ups_follow_up_type} ${6:simple_email_for_live_id} ${7:simple_email_for_buffer_id} ${8:follow_up_type_simple} ${9:follow_up_type_automation} ${10:simple_email_campaign_id} ${11:form_follow_ups_workflow_id} ${12:response_redirect_url} ${13:response_redirect_id} ${14:response_response_type} ${15:response_message} ${16:notifications_are_overridden} ${17:notifications_override_guid_buffer} ${18:notifications_override_guid} ${19:notifications_override_email_addresses} ${20:notifications_override_user_ids} ${21:gotowebinar_webinar_key} ${22:sfdc_campaign} ${23:override_styles} %}" ], - "description": "Insert one of the forms created in the Form Manager\nParameters:\n- form_key(String) A unique id to target this form instance on the page\n- form_to_use(String) The form ID of the form to render by default\n- title(String) Populates an h3 header tag above the form\n- no_title(boolean) If True, the h3 tag above the title is removed.\n- form_follow_ups_follow_up_type(enum no_action|simple|automation) Specifies follow up action\n- simple_email_for_live_id(number) Specifies the ID of the simple follow-up email for the live page\n- simple_email_for_buffer_id(number) Specifies the ID of the simple follow-up email for the auto-save version of a page\n- follow_up_type_simple(boolean) If true, enables a simple follow-up email\n- follow_up_type_automation(boolean) If true, enrolls submissions in a workflow\n- simple_email_campaign_id(number) Specifies the ID of the simple follow-up email\n- form_follow_ups_workflow_id(number) Specifies the ID of the follow-up workflow\n- response_redirect_url(String) If redirecting to an external page, this parameter specifies the URL to redirect to\n- response_redirect_id(number) If redirecting to HubSpot hosted page, this parameter specifies the page ID of that page\n- response_response_type(enum inline|redirect) Determines whether to redirect to another page or to display an inline thank you message on submission\n- response_message(String) Sets an inline thank you message\n- notifications_are_overridden(boolean) If True, the form will send notifications to specified addresses selected in the notifications_override_email_addresses\n- notifications_override_guid_buffer(String) ID of override settings in auto-save version of page\n- notifications_override_guid(String) ID of override settings in live version of page\n- notifications_override_email_addresses(JSON list) These email addresses will override the email notification settings set in the form\n- gotowebinar_webinar_key(String) Specifies the GoToWebinar webinar to enroll contacts who submit the form into\n- sfdc_campaign(String) Specifies the Salesforce campaign to enroll contacts who submit the form into", + "description": "Insert one of the forms created in the Form Manager\nParameters:\n- form_key(String) A unique id to target this form instance on the page\n- form_to_use(String) The form ID of the form to render by default\n- title(String) Populates an h3 header tag above the form\n- no_title(boolean) If True, the h3 tag above the title is removed.\n- form_follow_ups_follow_up_type(enum no_action|simple|automation) Specifies follow up action\n- simple_email_for_live_id(number) Specifies the ID of the simple follow-up email for the live page\n- simple_email_for_buffer_id(number) Specifies the ID of the simple follow-up email for the auto-save version of a page\n- follow_up_type_simple(boolean) If true, enables a simple follow-up email\n- follow_up_type_automation(boolean) If true, enrolls submissions in a workflow\n- simple_email_campaign_id(number) Specifies the ID of the simple follow-up email\n- form_follow_ups_workflow_id(number) Specifies the ID of the follow-up workflow\n- response_redirect_url(String) If redirecting to an external page, this parameter specifies the URL to redirect to\n- response_redirect_id(number) If redirecting to HubSpot hosted page, this parameter specifies the page ID of that page\n- response_response_type(enum inline|redirect) Determines whether to redirect to another page or to display an inline thank you message on submission\n- response_message(String) Sets an inline thank you message\n- notifications_are_overridden(boolean) If True, the form will send notifications to specified addresses selected in the notifications_override_email_addresses\n- notifications_override_guid_buffer(String) ID of override settings in auto-save version of page\n- notifications_override_guid(String) ID of override settings in live version of page\n- notifications_override_email_addresses(JSON list) (Deprecated) These email addresses will override the email notification settings set in the form\n- notifications_override_user_ids(JSON list) The user IDs to override email addresses for the email notification settings set in the form\n- gotowebinar_webinar_key(String) Specifies the GoToWebinar webinar to enroll contacts who submit the form into\n- sfdc_campaign(String) Specifies the Salesforce campaign to enroll contacts who submit the form into\n- override_styles(json object) Override config for forms styles", "prefix": "~form" }, "from": { "body": [ - "{% macro header(tag, title_text) %}\n

<{{ tag }}>{{ title_text }}
\n{% endmacro %}\n{% macro footer(tag, footer_text) %}\n
<{{ tag }}>{{ footer_text }}
\n{% endmacro %}" + "{% from '${1:path}' import ${2:macro_name} %}" ], "description": "Alternative to the import tag that lets you import and use specific macros from one template to another\nParameters:\n- path(String) Design Manager path to file to import from\n- macro_name(String) Name of macro or comma separated macros to import (import macro_name)", "prefix": "~from" }, "gallery": { "body": [ - "{% gallery 'my_gallery' \n\tslides='${1:slides}', \n\tloop_slides='${2:loop_slides}', \n\tnum_seconds='${3:num_seconds}', \n\tshow_pagination='${4:show_pagination}', \n\tsizing='${5:sizing}', \n\tauto_advance='${6:auto_advance}', \n\ttransition='${7:transition}', \n\tcaption_position='${8:caption_position}', \n\tdisplay_mode='${9:display_mode}', \n\tlightboxRows='${10:lightboxRows}'%}" + "{% gallery ${1:slides} ${2:loop_slides} ${3:num_seconds} ${4:show_pagination} ${5:sizing} ${6:auto_advance} ${7:transition} ${8:caption_position} ${9:display_mode} ${10:lightboxRows} %}" ], "description": "Gallery\nParameters:\n- slides(json list) A JSON list of the default caption, the link url, the alt text, the image src, and whether to open in a new tab\n- loop_slides(boolean) When True, continuously loop through slides\n- num_seconds(number) Time in seconds to pause between slides\n- show_pagination(boolean) Provide buttons below slider to randomly navigate among slides\n- sizing(enum static|resize) Determines whether the slider changes sizes, based on the height of the slides\n- auto_advance(boolean) Automatically advance slides after the time set in num_seconds\n- transition(enum slide|) Sets the type of slide transition\n- caption_position(enum below|superimpose) Affects positioning of caption on or below the slide\n- display_mode(enum standard|thumbnail|lightbox) Determines which mode the slider will display\n- lightboxRows(number) Rows in lightbox mode", "prefix": "~gallery" }, "global_module": { "body": [ - "{% global_module 'my_global_module' %}" + "{% global_module %}" ], "description": "", "prefix": "~global_module" }, "global_widget": { "body": [ - "{% global_widget 'my_global_widget' \n\tglobal_widget_name='${1:global_widget_name}'%}" + "{% global_widget ${1:global_widget_name} %}" ], "description": "A global widget is one which can be shared across templates\nParameters:\n- global_widget_name(String) Global module name", "prefix": "~global_widget" }, "google_search": { "body": [ - "{% google_search 'my_google_search' \n\tprefill_input_with_pathname='${1:prefill_input_with_pathname}', \n\tsearch_field_label='${2:search_field_label}', \n\tsearch_button_text='${3:search_button_text}'%}" + "{% google_search ${1:prefill_input_with_pathname} ${2:search_field_label} ${3:search_button_text} %}" ], "description": "Allow visitors to search your site on Google\nParameters:\n- prefill_input_with_pathname(boolean) Uses the end part of the URL to fill the search query field\n- search_field_label(String) Populates the label text in the