Skip to content

Commit

Permalink
docs: slack template functions
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Sep 2, 2024
1 parent 310fe95 commit 0346938
Showing 1 changed file with 101 additions and 0 deletions.
101 changes: 101 additions & 0 deletions mission-control/docs/reference/notifications/template_functions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
title: Template Functions
---

Special Slack template functions are made available on notifications to complex block formation easier.

Check warning on line 5 in mission-control/docs/reference/notifications/template_functions.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/reference/notifications/template_functions.mdx#L5

[alex.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'Special'.
Raw output
{"message": "[alex.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'Special'.", "location": {"path": "mission-control/docs/reference/notifications/template_functions.mdx", "range": {"start": {"line": 5, "column": 1}}}, "severity": "WARNING"}

**slackHealthEmoji:**
<SlackHealthEmoji />

**labelsFormat:**

Check failure on line 10 in mission-control/docs/reference/notifications/template_functions.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/reference/notifications/template_functions.mdx#L10

[Flanksource.Spelling] Is 'labelsFormat' spelled correctly? Is it missing code formatting?
Raw output
{"message": "[Flanksource.Spelling] Is 'labelsFormat' spelled correctly? Is it missing code formatting?", "location": {"path": "mission-control/docs/reference/notifications/template_functions.mdx", "range": {"start": {"line": 10, "column": 3}}}, "severity": "ERROR"}
<LabelsFormat />

**slackSectionLabels:**
<SlackSectionLabels />

**slackSectionTextFieldPlain:**
<SlackSectionTextFieldPlain />

**slackSectionTextFieldMD:**
<SlackSectionTextFieldMD />

**slackSectionTextMD:**
<SlackSectionTextMD />

**slackSectionTextPlain:**
<SlackSectionTextPlain />

**SlackURLAction:**
<SlackURLAction />

export function SlackHealthEmoji() {
return <>
<pre>
slackHealthEmoji(health): string
</pre>
<p>Returns a slack emoji based on the supplied health</p>
</>
}

export function LabelsFormat() {
return <>
<pre>
labelsFormat(map[string]any): string
</pre>
<p>Formats the given set of labels</p>
</>
}

export const SlackSectionLabels = () => (

Check failure on line 49 in mission-control/docs/reference/notifications/template_functions.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/reference/notifications/template_functions.mdx#L49

[Flanksource.Spelling] Is 'const' spelled correctly? Is it missing code formatting?
Raw output
{"message": "[Flanksource.Spelling] Is 'const' spelled correctly? Is it missing code formatting?", "location": {"path": "mission-control/docs/reference/notifications/template_functions.mdx", "range": {"start": {"line": 49, "column": 8}}}, "severity": "ERROR"}
<>
<pre>
slackSectionLabels(map[string]any): SlackSection
</pre>
<p>Formats the given set of labels into fields of a <a href="https://api.slack.com/reference/block-kit/blocks#section">slack section block</a></p>
</>
)

export const SlackSectionTextFieldPlain = () => (

Check failure on line 58 in mission-control/docs/reference/notifications/template_functions.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/reference/notifications/template_functions.mdx#L58

[Flanksource.Spelling] Is 'const' spelled correctly? Is it missing code formatting?
Raw output
{"message": "[Flanksource.Spelling] Is 'const' spelled correctly? Is it missing code formatting?", "location": {"path": "mission-control/docs/reference/notifications/template_functions.mdx", "range": {"start": {"line": 58, "column": 8}}}, "severity": "ERROR"}
<>
<pre>
slackSectionTextFieldPlain(text: string): string
</pre>
<p>Creates a plain text field for a Slack section block</p>
</>
)

export const SlackSectionTextFieldMD = () => (

Check failure on line 67 in mission-control/docs/reference/notifications/template_functions.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/reference/notifications/template_functions.mdx#L67

[Flanksource.Spelling] Is 'const' spelled correctly? Is it missing code formatting?
Raw output
{"message": "[Flanksource.Spelling] Is 'const' spelled correctly? Is it missing code formatting?", "location": {"path": "mission-control/docs/reference/notifications/template_functions.mdx", "range": {"start": {"line": 67, "column": 8}}}, "severity": "ERROR"}
<>
<pre>
slackSectionTextFieldMD(text: string): string
</pre>
<p>Creates a markdown text field for a Slack section block</p>
</>
)

export const SlackSectionTextMD = () => (

Check failure on line 76 in mission-control/docs/reference/notifications/template_functions.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/reference/notifications/template_functions.mdx#L76

[Flanksource.Spelling] Is 'const' spelled correctly? Is it missing code formatting?
Raw output
{"message": "[Flanksource.Spelling] Is 'const' spelled correctly? Is it missing code formatting?", "location": {"path": "mission-control/docs/reference/notifications/template_functions.mdx", "range": {"start": {"line": 76, "column": 8}}}, "severity": "ERROR"}
<>
<pre>
slackSectionTextMD(text: string): string
</pre>
<p>Creates a Slack section block with markdown text</p>
</>
)

export const SlackSectionTextPlain = () => (

Check failure on line 85 in mission-control/docs/reference/notifications/template_functions.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/reference/notifications/template_functions.mdx#L85

[Flanksource.Spelling] Is 'const' spelled correctly? Is it missing code formatting?
Raw output
{"message": "[Flanksource.Spelling] Is 'const' spelled correctly? Is it missing code formatting?", "location": {"path": "mission-control/docs/reference/notifications/template_functions.mdx", "range": {"start": {"line": 85, "column": 8}}}, "severity": "ERROR"}
<>
<pre>
slackSectionTextPlain(text: string): string
</pre>
<p>Creates a Slack section block with plain text</p>
</>
)

export const SlackURLAction = () => (

Check failure on line 94 in mission-control/docs/reference/notifications/template_functions.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/reference/notifications/template_functions.mdx#L94

[Flanksource.Spelling] Is 'const' spelled correctly? Is it missing code formatting?
Raw output
{"message": "[Flanksource.Spelling] Is 'const' spelled correctly? Is it missing code formatting?", "location": {"path": "mission-control/docs/reference/notifications/template_functions.mdx", "range": {"start": {"line": 94, "column": 8}}}, "severity": "ERROR"}
<>
<pre>
slackURLAction(name: string, url: string): string
</pre>
<p>Creates a Slack action block with a URL button</p>
</>
)

0 comments on commit 0346938

Please sign in to comment.