Skip to content

Commit

Permalink
docs: polishing custom functions
Browse files Browse the repository at this point in the history
  • Loading branch information
lukegalbraithrussell committed Jun 25, 2024
1 parent 81071fd commit aea4c85
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 12 deletions.
3 changes: 3 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ collections:
output: false
advanced:
output: false
functions:
output: false
steps:
output: false
deployments:
Expand All @@ -38,6 +40,7 @@ t:
advanced: Advanced concepts
start: Getting started
reference: Reference
functions: Custom functions
steps: Workflow steps
deployments: Deployments
contribute: Contributing
Expand Down
8 changes: 4 additions & 4 deletions docs/_functions/creating.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ order: 1
<div class="section-content">
Custom functions allow your app to create and process workflow steps that users can add in Workflow Builder.

We recommend using custom functions as a replacement for the deprecated Workflow Steps from Apps.
We recommend using custom functions as a replacement for the [deprecated Workflow Steps from Apps](#steps).

A custom function requires two components:

* A function definition in the app’s manifest
* A listener to handle the function execution event
* [A function definition in the app’s manifest](#defining-custom-functions)
* [A listener to handle the function execution event](#listening-to-custom-functions)

Read more about custom functions in the API documentation.
Read more about custom functions in the [Slack API documentation](https://api.slack.com/automation/functions/custom-bolt).

</div>
6 changes: 3 additions & 3 deletions docs/_functions/defining.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ To make a custom function available for use in Workflow Builder, the app’s man

A function’s definition contains information about the function, including its `callback_id`, `input_parameters`, `output_parameters`, as well as display information.

To learn more about defining a function, see the [Slack API documentation](https://api.slack.com/automation/functions/custom-bolt#define-function).

</div>

```json
Expand Down Expand Up @@ -39,6 +41,4 @@ A function’s definition contains information about the function, including its
}
}
}
```

To learn more about defining a function, see the API documentation.
```
3 changes: 3 additions & 0 deletions docs/_functions/listening.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ The callback is where you can access `inputs`, make third-party API calls, save

Your app must call `complete()` to indicate that the function’s execution was successful, or `fail()` to signal that the function failed to complete.

To learn more about listening to custom function executions, see the [Slack API documentation](https://api.slack.com/automation/functions/custom-bolt#listener).


</div>

```js
Expand Down
6 changes: 1 addition & 5 deletions docs/_functions/responding.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ Interactive elements provided to the user from within the `function()` method’

Incoming actions that are associated with a function have the same `inputs`, `complete`, and `fail` utilities as offered by the `function()` method.

// If associated with a function, function-specific utilities are made available
app.action('approve_button', async ({ complete, fail }) => {
// Signal the function has completed once the button is clicked
await complete({ outputs: { message: 'Request approved 👍' } });
});
To learn more about responding to interactivity, see the [Slack API documentation](https://api.slack.com/automation/functions/custom-bolt#interactivity).

</div>

Expand Down
12 changes: 12 additions & 0 deletions docs/_includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@
</ul>
{% endif %}

<ul class="sidebar-section">
<a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/concepts#functions"
><li class="title">{{ site.t[page.lang].functions }}</li></a
>
{% assign functions_sections = site.functions | sort: "order" | where: "lang", page.lang %} {% for section in functions_sections
%}
<a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/concepts#{{ section.slug }}">
<li>{{section.title}}</li>
</a>
{% endfor %}
</ul>

<ul class="sidebar-section">
<a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/concepts#steps">
<li class="title">
Expand Down
13 changes: 13 additions & 0 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ <h3 id="{{section.slug}}">{{ section.title }}</h3>
{% endfor %}
</div>

<div id="functions">
{% assign functions_sections = site.functions | sort: "order" | where: "lang", page.lang %} {% for section in
functions_sections %}
<div class="section-wrapper">
<h3 id="{{section.slug}}">{{ section.title }}</h3>

{{ section.content | markdownify }}

<hr />
</div>
{% endfor %}
</div>

<div id="steps">
{% assign workflow_steps = site.steps | sort: "order" | where: "lang", page.lang %} {% for section in
workflow_steps %}
Expand Down

0 comments on commit aea4c85

Please sign in to comment.