Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklambourne committed May 31, 2024
1 parent 234b2b4 commit 1374598
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 50 deletions.
22 changes: 11 additions & 11 deletions docs_src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,33 @@ The [Slack BlockKit API](https://api.slack.com/block-kit) defines a number of
classes that represent these resources.

### Objects
[`Objects`](/slackblocks/latest/reference/messages/objects) (e.g. [`Text`](/slackblocks/latest/reference/messages/objects/#objects.Text))
[`Objects`](/slackblocks/latest/reference/objects) (e.g. [`Text`](/slackblocks/latest/reference/objects/#objects.Text))
are the lowest level pimitives that are used to populate
[`Elements`](/slackblocks/latest/reference/messages/elements) and [`Blocks`](/slackblocks/latest/reference/messages/blocks).
[`Elements`](/slackblocks/latest/reference/elements) and [`Blocks`](/slackblocks/latest/reference/blocks).

### Elements
[`Elements`](/slackblocks/latest/reference/messages/elements) are typically interactive UI elements that take
in [`Object`](/slackblocks/latest/reference/messages/objects) to define their content. For example, the
[`Elements`](/slackblocks/latest/reference/elements) are typically interactive UI elements that take
in [`Object`](/slackblocks/latest/reference/objects) to define their content. For example, the
[`CheckboxGroup`](/elements/#elements.CheckboxGroup) element takes in one or
more [`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) items and presents a
more [`Option`](/slackblocks/latest/reference/objects/#objects.Option) items and presents a
checkbox menu to the user with those options.

### Blocks
[`Blocks`](/slackblocks/latest/reference/messages/blocks) are the core element of the API, with different
[`Blocks`](/slackblocks/latest/reference/messages/blocks) used to create different types of visual
elements. For example, the [`DividerBlock`](/slackblocks/latest/reference/messages/blocks/#blocks.DividerBlock),
[`Blocks`](/slackblocks/latest/reference/blocks) are the core element of the API, with different
[`Blocks`](/slackblocks/latest/reference/blocks) used to create different types of visual
elements. For example, the [`DividerBlock`](/slackblocks/latest/reference/blocks/#blocks.DividerBlock),
when rendered, will show a visual element similar to a `<hr>` HTML element. The
[`RichTextBlock`](/slackblocks/latest/reference/messages/blocks/#blocks.RichTextBlock) on the other hand
[`RichTextBlock`](/slackblocks/latest/reference/blocks/#blocks.RichTextBlock) on the other hand
allows for the display of text elements with visual styling like italics,
block quotes, lists and code blocks.

### Messages
[`Messages`](/slackblocks/latest/reference/messages/messages/) are a convenience wrapper around `Blocks` that
[`Messages`](/slackblocks/latest/reference/messages/) are a convenience wrapper around `Blocks` that
can be unpacked as arguments straight into the official Slack Python SDK (or
its legacy `slackclient` counterpart).

### Views
[`Views`](reference/views/) are an alternative usage for [`Blocks`](/slackblocks/latest/reference/messages/blocks)
[`Views`](reference/views/) are an alternative usage for [`Blocks`](/slackblocks/latest/reference/blocks)
that allow for the creation of custom UI "surfaces" within Slack, e.g. for
third-party apps.

Expand Down
4 changes: 2 additions & 2 deletions slackblocks/attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Secondary (less important) content can be attached using the deprecated
attachments API.
See: <https://api.slack.com/slackblocks/latest/reference/messages/messaging/attachments>.
See: <https://api.slack.com/slackblocks/latest/reference/messaging/attachments>.
"""

from enum import Enum
Expand All @@ -19,7 +19,7 @@ class Color(Enum):
Color is a utility class for use with the Slack secondary attachments API.
Pass these to the `color` argument of
[`Attachment`](/slackblocks/latest/reference/messages/attachments/#attachments.Attachment).
[`Attachment`](/slackblocks/latest/reference/attachments/#attachments.Attachment).
<table style="width:50%">
<tr>
Expand Down
14 changes: 7 additions & 7 deletions slackblocks/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class ActionsBlock(Block):
A `Block` that is used to hold interactive elements (normally for users to interface with).
Args:
elements: a list of [Elements](/slackblocks/latest/reference/messages/elements) (up to a maximum of 25).
elements: a list of [Elements](/slackblocks/latest/reference/elements) (up to a maximum of 25).
block_id: you can use this field to provide a deterministic identifier for the block.
Throws:
Expand Down Expand Up @@ -304,8 +304,8 @@ class InputBlock(Block):
Args:
label: the name which identifies the input field.
element: an interactive [Element](/slackblocks/latest/reference/messages/elements) (e.g. a text field).
dispatch_action: whether the [Element](/slackblocks/latest/reference/messages/elements) should trigger the
element: an interactive [Element](/slackblocks/latest/reference/elements) (e.g. a text field).
dispatch_action: whether the [Element](/slackblocks/latest/reference/elements) should trigger the
sending of a `block_actions` payload.
block_id: you can use this field to provide a deterministic identifier for the block.
hint: an optional additional guide on what input the user should prodive.
Expand Down Expand Up @@ -354,10 +354,10 @@ class RichTextBlock(Block):
"""
A RichTextBlock is used to provide easier rich text formatting
than standard markdown text (e.g. in a
[`SectionBlock`](/slackblocks/latest/reference/messages/blocks/#blocks.SectionBlock))
[`SectionBlock`](/slackblocks/latest/reference/blocks/#blocks.SectionBlock))
and access to text formatting features not available in traditional
markdown (e.g. strikethrough). See the various rich text elements
you can include [here](/slackblocks/latest/reference/messages/rich_text).
you can include [here](/slackblocks/latest/reference/rich_text).
Args:
elements: a single [rich text element](rich_text)
Expand Down Expand Up @@ -400,15 +400,15 @@ class SectionBlock(Block):
available block elements.
Section blocks can also optionally be given an "accessory,"
which is typically one of the interactive [Elements](/slackblocks/latest/reference/messages/elements).
which is typically one of the interactive [Elements](/slackblocks/latest/reference/elements).
Args:
text: text to include in the block. Can be a string or `Text` object (of either
`mrkdwn` or `plaintext` variety). Defaults to markdown if unspecified. One of either
`text` or `fields` must be provided.
block_id: you can use this field to provide a deterministic identifier for the block.
fields: a list of text objects. One of either `text` or `fields` must be provided.
accessory: an optional [Element](/slackblocks/latest/reference/messages/elements) object that will take a
accessory: an optional [Element](/slackblocks/latest/reference/elements) object that will take a
secondary place in the block (after or to the side of `text` or `fields`).
Throws:
Expand Down
36 changes: 18 additions & 18 deletions slackblocks/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ class CheckboxGroup(Element):
Args:
action_id: an identifier so the source of the action can be known.
options: a list of
[`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) objects that will form
[`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will form
the content of the checkbox group.
initial_options: a list of
[`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) objects that will be
[`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will be
initially selected when first presented to the user.
confirm: a `ConfirmationDialogue` object that will be presented when
the checkbox group is used.
Expand Down Expand Up @@ -423,7 +423,7 @@ class Image(Element):
alt_text: a plain-text-only summary of the content of the image.
image_url: a URL for a publicly hosted image (the user must provide
either `image_url` or `slack_file`).
slack_file: a [`SlackFile`](/slackblocks/latest/reference/messages/objects/#objects.SlackFile)
slack_file: a [`SlackFile`](/slackblocks/latest/reference/objects/#objects.SlackFile)
(the user must provide either `image_url` or `slack_file`).
Throws:
Expand Down Expand Up @@ -465,14 +465,14 @@ class StaticMultiSelectMenu(Element):
Args:
action_id: an identifier so the source of the action can be known.
options: a list of [`Options`](/slackblocks/latest/reference/messages/objects/#objects.Option)
options: a list of [`Options`](/slackblocks/latest/reference/objects/#objects.Option)
(max 100). Only one of `options` or `option_groups` must be
provided.
option_groups: a list of
[`OptionGroups`](/slackblocks/latest/reference/messages/objects/#objects.OptionGroup)
[`OptionGroups`](/slackblocks/latest/reference/objects/#objects.OptionGroup)
(max 100). Only one of `options` or `option_groups` can be
provided.
initial_options: the [`Options`](/slackblocks/latest/reference/messages/objects/#objects.Option)
initial_options: the [`Options`](/slackblocks/latest/reference/objects/#objects.Option)
to be intially selected when the element is first rendered.
confirm: a `ConfirmationDialogue` object that will be presented when
the menu is used.
Expand Down Expand Up @@ -592,7 +592,7 @@ class ExternalMultiSelectMenu(Element):
action_id: an identifier so the source of the action can be known.
min_query_length: minimum number of characters entered before the query
is dispactched (defaults to 3 if not provided).
initial_options: the [`Options`](/slackblocks/latest/reference/messages/objects/#objects.Option)
initial_options: the [`Options`](/slackblocks/latest/reference/objects/#objects.Option)
to be intially selected when the element is first rendered.
confirm: a `ConfirmationDialogue` object that will be presented when
the menu is used.
Expand Down Expand Up @@ -729,7 +729,7 @@ class ConversationMultiSelectMenu(Element):
the menu is used.
max_selected_items: the maximum number of items that can be selected
in the menu.
filter: a [`Filter`](/slackblocks/latest/reference/messages/objects/#objects.ConversationFilter)
filter: a [`Filter`](/slackblocks/latest/reference/objects/#objects.ConversationFilter)
object that filters out conversations that don't match the settings
of the filter.
focus_on_load: whether or not the menu will be set to autofocus
Expand Down Expand Up @@ -952,7 +952,7 @@ class OverflowMenu(Element):
Args:
action_id: an identifier so the source of the action can be known.
options: a list of
[`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) objects that will form
[`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will form
the content of the overflow menu.
confirm: a `ConfirmationDialogue` object that will be presented when an
option in the overflow menu is selected.
Expand Down Expand Up @@ -1064,10 +1064,10 @@ class RadioButtonGroup(Element):
Args:
action_id: an identifier so the source of the action can be known.
options: a list of
[`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) objects that will form
[`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will form
the content of the radio button group.
initial_option: an
[`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) object that will be
[`Option`](/slackblocks/latest/reference/objects/#objects.Option) object that will be
initially selected when first presented to the user.
confirm: a `ConfirmationDialogue` object that will be presented when an
option in the overflow menu is selected.
Expand Down Expand Up @@ -1122,14 +1122,14 @@ class StaticSelectMenu(Element):
Args:
action_id: an identifier so the source of the action can be known.
options: a list of
[`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) objects that will form
[`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will form
the content of the menu (max 100).
option_groups: a list of
[`OptionGroups`](/slackblocks/latest/reference/messages/objects/#objects.OptionGroup)
[`OptionGroups`](/slackblocks/latest/reference/objects/#objects.OptionGroup)
(max 100). Only one of `options` or `option_groups` can be
provided.
initial_option: an
[`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) object that will be
[`Option`](/slackblocks/latest/reference/objects/#objects.Option) object that will be
initially selected when first presented to the user.
confirm: a `ConfirmationDialogue` object that will be presented when an
option in the overflow menu is selected.
Expand Down Expand Up @@ -1225,12 +1225,12 @@ class ExternalSelectMenu(Element):
"""
A select menu interactive UI element, sourced with externally provided options.
See: <https://api.slack.com/slackblocks/latest/reference/messages/block-kit/block-elements#external_select>.
See: <https://api.slack.com/slackblocks/latest/reference/block-kit/block-elements#external_select>.
Args:
action_id: an identifier so the source of the action can be known.
initial_option: an
[`Option`](/slackblocks/latest/reference/messages/objects/#objects.Option) object that will be
[`Option`](/slackblocks/latest/reference/objects/#objects.Option) object that will be
initially selected when first presented to the user.
min_query_length: minimum number of characters entered before the query
is dispactched (defaults to 3 if not provided).
Expand Down Expand Up @@ -1355,7 +1355,7 @@ class ConversationSelectMenu(Element):
response_url_enabled: When set to true, the view_submission payload from the
menu's parent view will contain a response_url. (This response_url can be
used for message responses).
filter: a [`Filter`](/slackblocks/latest/reference/messages/objects/#objects.ConversationFilter)
filter: a [`Filter`](/slackblocks/latest/reference/objects/#objects.ConversationFilter)
object that filters out conversations that don't match the settings
of the filter.
focus_on_load: whether or not the input will be set to autofocus
Expand Down Expand Up @@ -1625,7 +1625,7 @@ class WorkflowButton(Element):
Args:
text: the text content that will appear in the button.
workflow: a [`Workflow`](/slackblocks/latest/reference/messages/objects/#objects.Workflow) object
workflow: a [`Workflow`](/slackblocks/latest/reference/objects/#objects.Workflow) object
that contains details about the workflow that will run when the
button is clicked.
style: one of `Default`, `Primary`, or `Danger`, determines the
Expand Down
10 changes: 5 additions & 5 deletions slackblocks/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ class Message(BaseMessage):
channel: the Slack channel to send the message to, e.g. "#general".
text: markdown text to send in the message. If `blocks` are provided
then this is a fallback to display in notifications.
blocks: a list of [`Blocks`](/slackblocks/latest/reference/messages/blocks) to form the contents
blocks: a list of [`Blocks`](/slackblocks/latest/reference/blocks) to form the contents
of the message instead of the contents of `text`.
attachments: a list of
[`Attachments`](/slackblocks/latest/reference/messages/attachments/#attachments.Attachment)
[`Attachments`](/slackblocks/latest/reference/attachments/#attachments.Attachment)
that form the secondary contents of the message (deprecated).
thread_ts: the timestamp ID of another unthreaded message that will
become the parent message of this message (now a reply in a thread).
Expand All @@ -114,7 +114,7 @@ class Message(BaseMessage):
automatically unfurl.
Throws:
InvalidUsageException: in the event that the items passed to `blocks`
are not valid [`Blocks`](/slackblocks/latest/reference/messages/blocks).
are not valid [`Blocks`](/slackblocks/latest/reference/blocks).
"""

def __init__(
Expand Down Expand Up @@ -184,9 +184,9 @@ class WebhookMessage:
text: markdown text to send in the message. If `blocks` are provided
then this is a fallback to display in notifications.
attachments: a list of
[`Attachments`](/slackblocks/latest/reference/messages/attachments/#attachments.Attachment)
[`Attachments`](/slackblocks/latest/reference/attachments/#attachments.Attachment)
that form the secondary contents of the message (deprecated).
blocks: a list of [`Blocks`](/slackblocks/latest/reference/messages/blocks) to form the contents
blocks: a list of [`Blocks`](/slackblocks/latest/reference/blocks) to form the contents
of the message instead of the contents of `text`.
response_type: one of `ResponseType.EPHEMERAL` or `ResponseType.IN_CHANNEL`.
Ephemeral messages are shown only to the requesting user whereas
Expand Down
2 changes: 1 addition & 1 deletion slackblocks/modals.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class Modal(ModalView):
"""
Kept for backwards compatibility - see [`ModalView`](/slackblocks/latest/reference/messages/views/#views.ModalView)
Kept for backwards compatibility - see [`ModalView`](/slackblocks/latest/reference/views/#views.ModalView)
"""

def __repr__(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion slackblocks/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class Confirm(ConfirmationDialogue):
"""
Alias for `ConfirmationDialogue` to retain backwards compatibility.
See: [`ConfirmationDialogue`](/slackblocks/latest/reference/messages/objects/#objects.ConfirmationDialogue).
See: [`ConfirmationDialogue`](/slackblocks/latest/reference/objects/#objects.ConfirmationDialogue).
"""

def __init__(self, *args, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions slackblocks/rich_text/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def _resolve(self) -> Dict[str, Any]:
class RichTextUser(RichTextElement):
"""
Rich text element for representing users in
[`RichTextBlocks`](/slackblocks/latest/reference/messages/blocks/#blocks.RichTextBlock).
[`RichTextBlocks`](/slackblocks/latest/reference/blocks/#blocks.RichTextBlock).
See: <https://api.slack.com/reference/block-kit/blocks#user-element-type>.
Expand Down Expand Up @@ -297,7 +297,7 @@ def _resolve(self) -> Dict[str, Any]:
class RichTextUserGroup(RichTextElement):
"""
Rich text element for representing groups of users in
[`RichTextBlocks`](/slackblocks/latest/reference/messages/blocks/#blocks.RichTextBlock)`.
[`RichTextBlocks`](/slackblocks/latest/reference/blocks/#blocks.RichTextBlock)`.
See: <https://api.slack.com/reference/block-kit/blocks#user-element-type>.
Expand Down
Loading

0 comments on commit 1374598

Please sign in to comment.