From 7317d35fd578231a5dc183f9a425053077dfb902 Mon Sep 17 00:00:00 2001 From: Luke Russell Date: Thu, 1 Aug 2024 14:00:24 -0700 Subject: [PATCH] docs: remove superfluous pages --- docs/README.md | 7 ++-- docs/i18n/ja-jp/README.md | 11 +++--- .../creating-custom-functions.md | 16 -------- .../defining-custom-functions.md | 39 ------------------- .../listening-to-custom-functions.md | 25 ------------ .../responding-to-interactivity.md | 19 --------- .../current/index.md | 21 ---------- 7 files changed, 8 insertions(+), 130 deletions(-) delete mode 100644 docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/creating-custom-functions.md delete mode 100644 docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/defining-custom-functions.md delete mode 100644 docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/listening-to-custom-functions.md delete mode 100644 docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/responding-to-interactivity.md delete mode 100644 docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/index.md diff --git a/docs/README.md b/docs/README.md index 081d8fb10..caa095871 100644 --- a/docs/README.md +++ b/docs/README.md @@ -13,7 +13,7 @@ docs/ ├── i18n/ja-jp/ (the japanese translations) │ ├── docusaurus-theme-classic/ (footer/navbar translations) │ └── docusaurus-plugin-content-docs/ -│ └── current/ (this folder's file names need to exactly match **/content/, but japanese content) +│ └── current/ (this folder's file names need to match **/content/) │ ├── getting-started.md │ └── concepts │ └── sending-message.md @@ -43,9 +43,8 @@ A cheat-sheet: 1. Make a markdown file. Add a `# Title` or use [front matter](https://docusaurus.io/docs/next/create-doc) with `title:`. 2. Save it in `content/folder/title.md` or `content/title.md`, depending on if it's in a sidebar category. The nuance is just for internal organization. -3. There needs to be 1:1 docs content for the sidebar. Copy the folder/file and put it in the Japanese docs: `i18n/ja/docusaurus-plugin-content-docs/current/*`. Just leave it in English if you don't speak Japanese. -4. Add the doc's path to the sidebar within `docusaurus.config.js`. Where ever makes most sense for you. -5. Test the changes ↓ +3. Add the doc's path to the sidebar within `docusaurus.config.js`. Where ever makes most sense for you. +4. Test the changes ↓ --- diff --git a/docs/i18n/ja-jp/README.md b/docs/i18n/ja-jp/README.md index 2c7f9421a..125a7e65f 100644 --- a/docs/i18n/ja-jp/README.md +++ b/docs/i18n/ja-jp/README.md @@ -2,11 +2,9 @@ This README describes how the Japanese documentation is created. Please read the [/docs README](./docs/README) for information on _all_ the documentation. -[Docusaurus](https://docusaurus.io) supports using different languages. Each language is a different version of the same site. Therefore, the Japanese documentation and English documentation must have the exact same pages. +[Docusaurus](https://docusaurus.io) supports using different languages. Each language is a different version of the same site. The English site is the default. The English page will be viewable if the page is not translated into Japanese. -If you add a page to the English documentation, then you must add the page to the Japanese documentation too. If you don't speak Japanese, copy the English documentation to the Japanese page. - -There will be English pages on the Japanese site if the pages are not translated yet. Japanese readers will not miss any content, but they may be confused seeing English and Japanese mixed together. Please give us your thoughts on this setup. +There will be English pages on the Japanese site of the pages are not translated yet. Japanese readers will not miss any content, but they may be confused seeing English and Japanese mixed together. Please give us your thoughts on this setup. Because of this, the sidebar does not need to be updated for the Japanese documentation. It's always the same as the English documentation! @@ -47,6 +45,7 @@ The Japanese documentation is in `i18n/ja-jp/`. The folder contains `docusaurus- ``` docs/ ├── content/ (English pages) +│ ├── example-page.md │ ├── getting-started.md │ └── concepts │ └── sending-message.md @@ -58,9 +57,9 @@ docs/ │ └── sending-message.md ``` -The Japanese page files in `i18n/ja-jp/docusaurus-plugin-content-docs/current/` must be the same as the English page files in `docs/content/`. Please keep the file names in English (example: `sending-message.md`) +If the file is not in `i18n/ja-jp/docusaurus-plugin-content-docs/current/`, then the English file will be used. In the example above, `example-page.md` is not in `i18n/ja-jp/docusaurus-plugin-content-docs/current/`. Therefore, the English version of `example-page.md` will appear on the Japanese site. -Each page is a markdown file. If the page is not translated, it will be in English. Simply remove the English words and write Japanese to replace the page. +The Japanese page file formats in `i18n/ja-jp/docusaurus-plugin-content-docs/current/` must be the same as the English page files in `docs/content/`. Please keep the file names in English (example: `sending-message.md`). Please provide a title in Japanese. It will show up in the sidebar. There are two options: diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/creating-custom-functions.md b/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/creating-custom-functions.md deleted file mode 100644 index b3b6ec553..000000000 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/creating-custom-functions.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Creating custom functions -lang: en -slug: /concepts/creating-custom-functions ---- - -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. - -A custom function requires two components: - -* [A function definition in the app’s manifest](/concepts/defining-custom-functions) -* [A listener to handle the function execution event](/concepts/listening-to-custom-functions) - -Read more about custom functions in the [Slack API documentation](https://api.slack.com/automation/functions/custom-bolt). \ No newline at end of file diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/defining-custom-functions.md b/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/defining-custom-functions.md deleted file mode 100644 index cb23aee97..000000000 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/defining-custom-functions.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: Defining custom functions -lang: en -slug: /concepts/defining-custom-functions ---- - -To make a custom function available for use in Workflow Builder, the app’s manifest must contain a function definition. - -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). - -```json -"functions": { - "sample_function": { - "title": "Sample function", - "description": "Runs sample function", - "input_parameters": { - "user_id": { - "type": "slack#/types/user_id", - "title": "User", - "description": "Message recipient", - "is_required": true, - "hint": "Select a user in the workspace", - "name": "user_id" - } - }, - "output_parameters": { - "user_id": { - "type": "slack#/types/user_id", - "title": "User", - "description": "User that completed the function", - "is_required": true, - "name": "user_id" - } - } - } -} -``` \ No newline at end of file diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/listening-to-custom-functions.md b/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/listening-to-custom-functions.md deleted file mode 100644 index 21274fcb9..000000000 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/listening-to-custom-functions.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: Listening to custom function executions -lang: en -slug: /concepts/listening-to-custom-functions ---- - -When your custom function is executed as a step in a workflow, your app will receive a `function_executed` event. The callback provided to the `function()` method will be run when this event is received. - -The callback is where you can access `inputs`, make third-party API calls, or set the output values that will be available to subsequent workflow steps by mapping values to the `outputs` object. - -Your app can 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). - -```js -app.function('sample_function', async ({ client, inputs, fail }) => { - try { - const { user_id } = inputs; - await complete({ outputs: { user_id } }); - } catch (error) { - console.error(error); - fail({ error: `Failed to handle a function request: ${error}` }); - } -}); -``` \ No newline at end of file diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/responding-to-interactivity.md b/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/responding-to-interactivity.md deleted file mode 100644 index 422f41929..000000000 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/custom-functions/responding-to-interactivity.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: Responding to interactivity -lang: en -slug: /concepts/responding-to-interactivity ---- - -Interactive elements provided to the user from within the `function()` method’s callback are associated with that unique `function_executed` event. This association allows for the completion of functions at a later time, like once the user has clicked a button. - -Incoming actions that are associated with a function have the same `inputs`, `complete`, and `fail` utilities as offered by the `function()` method. - -To learn more about responding to interactivity, see the [Slack API documentation](https://api.slack.com/automation/functions/custom-bolt#interactivity). - -```js -// 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 👍' } }); -}); -``` \ No newline at end of file diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/index.md b/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/index.md deleted file mode 100644 index 96bb11835..000000000 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/index.md +++ /dev/null @@ -1,21 +0,0 @@ -# Bolt for JavaScript - -Bolt for JavaScript is a JavaScript framework to build Slack apps with the latest Slack platform features. Read the [Getting Started Guide](/getting-started) to set up and run your first Bolt app. - -Then, head over to the Concepts guides. They'll help you build a Bolt app for whatever use case you may have. - -## Getting help - -These docs have lots of information on Bolt for JavaScript. There's also an in-depth Reference section. Please explore! - -If you otherwise get stuck, we're here to help. The following are the best ways to get assistance working through your issue: - -* [Issue Tracker](http://github.com/slackapi/bolt-js/issues) for questions, bug reports, feature requests, and general discussion related to Bolt for JavaScript. Try searching for an existing issue before creating a new one. -* [Email](mailto:support@slack.com) our developer support team: `support@slack.com`. - -## Contributing - -These docs live within the [Bolt-JS](https://github.com/slackapi/bolt-js/) repository and are open source. - -We welcome contributions from everyone! Please check out our -[Contributor's Guide](https://github.com/slackapi/bolt-js/blob/main/.github/contributing.md) for how to contribute in a helpful and collaborative way. \ No newline at end of file