Skip to content

Commit

Permalink
fix docs reference links again
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklambourne committed Jul 5, 2024
1 parent bd600f1 commit e3e2fc8
Show file tree
Hide file tree
Showing 7 changed files with 148 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs_src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The [Slack BlockKit API](https://api.slack.com/block-kit) defines a number of
classes that represent these resources.

### Objects
<<<<<<< Updated upstream
[`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/elements) and [`Blocks`](/slackblocks/latest/reference/blocks).
Expand All @@ -37,16 +38,43 @@ The [Slack BlockKit API](https://api.slack.com/block-kit) defines a number of
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/blocks/#blocks.RichTextBlock) on the other hand
=======
[`Objects`](/slackblocks/reference/objects) (e.g. [`Text`](/slackblocks/reference/objects/#objects.Text))
are the lowest level pimitives that are used to populate
[`Elements`](/slackblocks/reference/elements) and [`Blocks`](/slackblocks/reference/blocks).

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

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

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

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

Expand Down
4 changes: 4 additions & 0 deletions slackblocks/attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ class Color(Enum):
Color is a utility class for use with the Slack secondary attachments API.
Pass these to the `color` argument of
<<<<<<< Updated upstream
[`Attachment`](/slackblocks/latest/reference/attachments/#attachments.Attachment).
=======
[`Attachment`](/slackblocks/reference/attachments/#attachments.Attachment).
>>>>>>> Stashed changes
<table style="width:50%">
<tr>
Expand Down
26 changes: 26 additions & 0 deletions slackblocks/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,12 @@ class ActionsBlock(Block):
A `Block` that is used to hold interactive elements (normally for users to interface with).
Args:
<<<<<<< Updated upstream
elements: a list of [Elements](/slackblocks/latest/reference/elements)
(up to a maximum of 25).
=======
elements: a list of [Elements](/slackblocks/reference/elements) (up to a maximum of 25).
>>>>>>> Stashed changes
block_id: you can use this field to provide a deterministic identifier for the block.
Throws:
Expand Down Expand Up @@ -307,10 +311,16 @@ class InputBlock(Block):
Args:
label: the name which identifies the input field.
<<<<<<< Updated upstream
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.
=======
element: an interactive [Element](/slackblocks/reference/elements) (e.g. a text field).
dispatch_action: whether the [Element](/slackblocks/reference/elements) should trigger the
sending of a `block_actions` payload.
>>>>>>> Stashed changes
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.
optional: whether this input field may be empty when the user submits e.g. the modal.
Expand Down Expand Up @@ -358,10 +368,17 @@ class RichTextBlock(Block):
"""
A RichTextBlock is used to provide easier rich text formatting
than standard markdown text (e.g. in a
<<<<<<< Updated upstream
[`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/rich_text).
=======
[`SectionBlock`](/slackblocks/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/reference/rich_text).
>>>>>>> Stashed changes
Args:
elements: a single [rich text element](rich_text)
Expand Down Expand Up @@ -404,18 +421,27 @@ class SectionBlock(Block):
available block elements.
Section blocks can also optionally be given an "accessory,"
<<<<<<< Updated upstream
which is typically one of the interactive
[Elements](/slackblocks/latest/reference/elements).
=======
which is typically one of the interactive [Elements](/slackblocks/reference/elements).
>>>>>>> Stashed changes
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.
<<<<<<< Updated upstream
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`).
=======
accessory: an optional [Element](/slackblocks/reference/elements) object that will take a
secondary place in the block (after or to the side of `text` or `fields`).
>>>>>>> Stashed changes
Throws:
InvalidUsageError: if any of the provided arguments fail validation checks.
Expand Down
65 changes: 65 additions & 0 deletions slackblocks/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,19 @@ class CheckboxGroup(Element):
Args:
action_id: an identifier so the source of the action can be known.
options: a list of
<<<<<<< Updated upstream
[`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/objects/#objects.Option) objects that will
be initially selected when first presented to the user.
=======
[`Option`](/slackblocks/reference/objects/#objects.Option) objects that will form
the content of the checkbox group.
initial_options: a list of
[`Option`](/slackblocks/reference/objects/#objects.Option) objects that will be
initially selected when first presented to the user.
>>>>>>> Stashed changes
confirm: a `ConfirmationDialogue` object that will be presented when
the checkbox group is used.
focus_on_load: whether or not the checkbox group will be set to autofocus
Expand Down Expand Up @@ -423,8 +431,12 @@ 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`).
<<<<<<< Updated upstream
slack_file: a
[`SlackFile`](/slackblocks/latest/reference/objects/#objects.SlackFile)
=======
slack_file: a [`SlackFile`](/slackblocks/reference/objects/#objects.SlackFile)
>>>>>>> Stashed changes
(the user must provide either `image_url` or `slack_file`).
Throws:
Expand Down Expand Up @@ -466,6 +478,7 @@ class StaticMultiSelectMenu(Element):
Args:
action_id: an identifier so the source of the action can be known.
<<<<<<< Updated upstream
options: a list of [`Options`](/slackblocks/latest/reference/objects/#objects.Option)
(max 100). Only one of `options` or `option_groups` must be
provided.
Expand All @@ -474,6 +487,16 @@ class StaticMultiSelectMenu(Element):
(max 100). Only one of `options` or `option_groups` can be
provided.
initial_options: the [`Options`](/slackblocks/latest/reference/objects/#objects.Option)
=======
options: a list of [`Options`](/slackblocks/reference/objects/#objects.Option)
(max 100). Only one of `options` or `option_groups` must be
provided.
option_groups: a list of
[`OptionGroups`](/slackblocks/reference/objects/#objects.OptionGroup)
(max 100). Only one of `options` or `option_groups` can be
provided.
initial_options: the [`Options`](/slackblocks/reference/objects/#objects.Option)
>>>>>>> Stashed changes
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 @@ -593,7 +616,11 @@ 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).
<<<<<<< Updated upstream
initial_options: the [`Options`](/slackblocks/latest/reference/objects/#objects.Option)
=======
initial_options: the [`Options`](/slackblocks/reference/objects/#objects.Option)
>>>>>>> Stashed changes
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 @@ -730,7 +757,11 @@ class ConversationMultiSelectMenu(Element):
the menu is used.
max_selected_items: the maximum number of items that can be selected
in the menu.
<<<<<<< Updated upstream
filter: a [`Filter`](/slackblocks/latest/reference/objects/#objects.ConversationFilter)
=======
filter: a [`Filter`](/slackblocks/reference/objects/#objects.ConversationFilter)
>>>>>>> Stashed changes
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 @@ -953,7 +984,11 @@ class OverflowMenu(Element):
Args:
action_id: an identifier so the source of the action can be known.
options: a list of
<<<<<<< Updated upstream
[`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will form
=======
[`Option`](/slackblocks/reference/objects/#objects.Option) objects that will form
>>>>>>> Stashed changes
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 @@ -1065,10 +1100,17 @@ class RadioButtonGroup(Element):
Args:
action_id: an identifier so the source of the action can be known.
options: a list of
<<<<<<< Updated upstream
[`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/objects/#objects.Option) object that will be
=======
[`Option`](/slackblocks/reference/objects/#objects.Option) objects that will form
the content of the radio button group.
initial_option: an
[`Option`](/slackblocks/reference/objects/#objects.Option) object that will be
>>>>>>> Stashed changes
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 @@ -1123,6 +1165,7 @@ class StaticSelectMenu(Element):
Args:
action_id: an identifier so the source of the action can be known.
options: a list of
<<<<<<< Updated upstream
[`Option`](/slackblocks/latest/reference/objects/#objects.Option) objects that will form
the content of the menu (max 100).
option_groups: a list of
Expand All @@ -1131,6 +1174,16 @@ class StaticSelectMenu(Element):
provided.
initial_option: an
[`Option`](/slackblocks/latest/reference/objects/#objects.Option) object that will be
=======
[`Option`](/slackblocks/reference/objects/#objects.Option) objects that will form
the content of the menu (max 100).
option_groups: a list of
[`OptionGroups`](/slackblocks/reference/objects/#objects.OptionGroup)
(max 100). Only one of `options` or `option_groups` can be
provided.
initial_option: an
[`Option`](/slackblocks/reference/objects/#objects.Option) object that will be
>>>>>>> Stashed changes
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 @@ -1232,7 +1285,11 @@ class ExternalSelectMenu(Element):
Args:
action_id: an identifier so the source of the action can be known.
initial_option: an
<<<<<<< Updated upstream
[`Option`](/slackblocks/latest/reference/objects/#objects.Option) object that will be
=======
[`Option`](/slackblocks/reference/objects/#objects.Option) object that will be
>>>>>>> Stashed changes
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 @@ -1357,7 +1414,11 @@ 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).
<<<<<<< Updated upstream
filter: a [`Filter`](/slackblocks/latest/reference/objects/#objects.ConversationFilter)
=======
filter: a [`Filter`](/slackblocks/reference/objects/#objects.ConversationFilter)
>>>>>>> Stashed changes
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 @@ -1627,7 +1688,11 @@ class WorkflowButton(Element):
Args:
text: the text content that will appear in the button.
<<<<<<< Updated upstream
workflow: a [`Workflow`](/slackblocks/latest/reference/objects/#objects.Workflow) object
=======
workflow: a [`Workflow`](/slackblocks/reference/objects/#objects.Workflow) object
>>>>>>> Stashed changes
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
17 changes: 17 additions & 0 deletions slackblocks/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,17 @@ 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.
<<<<<<< Updated upstream
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/attachments/#attachments.Attachment)
=======
blocks: a list of [`Blocks`](/slackblocks/reference/blocks) to form the contents
of the message instead of the contents of `text`.
attachments: a list of
[`Attachments`](/slackblocks/reference/attachments/#attachments.Attachment)
>>>>>>> Stashed changes
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 +121,11 @@ class Message(BaseMessage):
automatically unfurl.
Throws:
InvalidUsageException: in the event that the items passed to `blocks`
<<<<<<< Updated upstream
are not valid [`Blocks`](/slackblocks/latest/reference/blocks).
=======
are not valid [`Blocks`](/slackblocks/reference/blocks).
>>>>>>> Stashed changes
"""

def __init__(
Expand Down Expand Up @@ -184,9 +195,15 @@ 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
<<<<<<< Updated upstream
[`Attachments`](/slackblocks/latest/reference/attachments/#attachments.Attachment)
that form the secondary contents of the message (deprecated).
blocks: a list of [`Blocks`](/slackblocks/latest/reference/blocks) to form the contents
=======
[`Attachments`](/slackblocks/reference/attachments/#attachments.Attachment)
that form the secondary contents of the message (deprecated).
blocks: a list of [`Blocks`](/slackblocks/reference/blocks) to form the contents
>>>>>>> Stashed changes
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
4 changes: 4 additions & 0 deletions slackblocks/modals.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@

class Modal(ModalView):
"""
<<<<<<< Updated upstream
Kept for backwards compatibility - see
[`ModalView`](/slackblocks/latest/reference/views/#views.ModalView)
=======
Kept for backwards compatibility - see [`ModalView`](/slackblocks/reference/views/#views.ModalView)
>>>>>>> Stashed changes
"""

def __repr__(self) -> str:
Expand Down
4 changes: 4 additions & 0 deletions slackblocks/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,12 @@ class Confirm(ConfirmationDialogue):
"""
Alias for `ConfirmationDialogue` to retain backwards compatibility.
<<<<<<< Updated upstream
See:
[`ConfirmationDialogue`](/slackblocks/latest/reference/objects/#objects.ConfirmationDialogue). # noqa: E501
=======
See: [`ConfirmationDialogue`](/slackblocks/reference/objects/#objects.ConfirmationDialogue).
>>>>>>> Stashed changes
"""

def __init__(self, *args, **kwargs):
Expand Down

0 comments on commit e3e2fc8

Please sign in to comment.