About bdocs
wrapper
bdocs
is a wrapper script located in the root of the Braze Docs repository that helps you replace links, generate redirect URLs, create deployment descriptions, and more.
Prerequisites
If you haven’t already, complete the steps for Contributing to Braze Docs.
Using bdocs
To run a command, use the following syntax. Replace COMMAND
with one of the available commands.
1
./bdocs COMMAND
To see the list of commands in your terminal, use the help
command:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ ./bdocs help
bdocs is a CLI tool for executing Braze Docs scripts.
USAGE:
./bdocs [option]
OPTIONS:
deploy Create the deploy body text for weekly deployments
release Create the release body text for monthly releases
tlinks Transform reference links to inline links on 1 or more pages
rlinks Remove reference links that are not being used on 1 or more pages
redirects List the old URLs for all new redirects in this branch
help Display this help message and exit
Copying to your clipboard
If you’re on MacOS, you can copy the output of bdocs
directly to your clipboard by using the following command. The |
means to “pipe” (or send) the output of the first command to the next command. pbcopy
means to write the output to your clipboard instead of the terminal. By combining these commands, you’re sending the output from bdocs
to pbcopy
using a pipe.
1
./bdocs COMMAND | pbcopy
List of commands
deploy
This command creates the pull request description for weekly deployments by comparing which pull requests have been merged into develop
but not master
and then listing them in the proper Markdown format.
1
2
3
4
5
$ ./bdocs deploy
- [#6980](https://github.com/braze-inc/braze-docs/pull/6980) - Update index.md
- [#6981](https://github.com/braze-inc/braze-docs/pull/6981) - Update ab_test_projection.md
- [#6983](https://github.com/braze-inc/braze-docs/pull/6983) - Add Show archived content
release
This command creates the pull request description for monthly releases by comparing which pull requests have been merged into master
since the last release and then listing them in the proper Markdown format.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ ./bdocs release
## Deploy - September 17, 2024
- https://github.com/braze-inc/braze-docs/pull/8104 - Deploy - September 17, 2024
- https://github.com/braze-inc/braze-docs/pull/8039 - Add Trending item recommendations
- https://github.com/braze-inc/braze-docs/pull/8073 - Add dynamic images to WhatsApp
- https://github.com/braze-inc/braze-docs/pull/8069 - Response messages GA
## Leftover deploy - September 12, 2024
- https://github.com/braze-inc/braze-docs/pull/8045 - Add list of security events that are reported
- https://github.com/braze-inc/braze-docs/pull/8047 - -2 Add sentence to security event report download
- https://github.com/braze-inc/braze-docs/pull/8048 - SessionM Partnership Doc
- https://github.com/braze-inc/braze-docs/pull/8051 - File file_storage_integrations.md committed.
tlinks
Reference-style links are not supported within Liquid {% tab %}
tags. tlinks
(short for “transform links”) transforms all the reference-style links on a file into in-line links—whether it be a normal URL, a {{site.baseurl}}
, an image, or other link. This command takes a single file or an entire directory as an argument.
After you run tlinks
, you’ll be asked if you’d like to run rlinks
next.
Example command
1
./bdocs tlinks _docs/_user_guide/onboarding_faq.md
Example page: before
1
2
3
4
Before continuing, [create your SSH token][2]. When you're finished, see [Step 2: Uploading your token][5].
[2]: {{site.baseurl}}/developer_guide/platform_wide/sdk_authentication/
[5]: https://www.apple.com/swift#step-2-uploading-your-token
Example page: after
1
2
3
4
Before continuing, [create your SSH token]({{site.baseurl}}/developer_guide/platform_wide/sdk_authentication/). When you're finished, see [Step 2: Uploading your token](https://www.apple.com/swift#step-2-uploading-your-token).
[2]: {{site.baseurl}}/developer_guide/platform_wide/sdk_authentication/
[5]: https://www.apple.com/swift#step-2-uploading-your-token
rlinks
rlinks
(short for “remove links”) removes any unused reference links from the bottom of a Markdown file. This command takes a single file or an entire directory as an argument.
After you run tlinks
, you’ll be asked if you’d like to run rlinks
next.
Example command
1
./bdocs rlinks _docs/_user_guide/onboarding_faq.md
Example page: before
1
2
3
4
Before continuing, [create your SSH token]({{site.baseurl}}/developer_guide/platform_wide/sdk_authentication/). When you're finished, see [Step 2: Uploading your token](https://www.apple.com/swift#step-2-uploading-your-token).
[2]: {{site.baseurl}}/developer_guide/platform_wide/sdk_authentication/
[5]: https://www.apple.com/swift#step-2-uploading-your-token
Example Page: After
1
2
Before continuing, [create your SSH token]({{site.baseurl}}/developer_guide/platform_wide/sdk_authentication/). When you're finished, see [Step 2: Uploading your token](https://www.apple.com/swift#step-2-uploading-your-token).
redirects
This command checks if any new redirects have been added to broken_redirect_list.js
, then lists all of the old URLs using a base URL of your choice. For more general information, see Redirecting URLs.
If you’re using VS Code, hold CMD while right-clicking a link to open it in your default browser. Because these are the old links, they should all redirect to the new URL specified in the redirect file. If it doesn’t, there’s an issue with the redirect.
The following example uses the Sage AI rebrand PR.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ git checkout bd-3442
$ ./bdocs redirects https://braze-docs-gtcavota9-braze.vercel.app/
https://braze-docs-gtcavota9-braze.vercel.app/docs/user_guide/sage_ai/
https://braze-docs-gtcavota9-braze.vercel.app/docs/user_guide/sage_ai/predictive_suite/
https://braze-docs-gtcavota9-braze.vercel.app/docs/user_guide/sage_ai/predictive_suite/predictive_churn
https://braze-docs-gtcavota9-braze.vercel.app/docs/user_guide/sage_ai/predictive_suite/predictive_churn/creating_a_churn_prediction/
https://braze-docs-gtcavota9-braze.vercel.app/docs/user_guide/sage_ai/predictive_suite/predictive_churn/prediction_analytics/
https://braze-docs-gtcavota9-braze.vercel.app/docs/user_guide/sage_ai/predictive_suite/predictive_churn/prediction_analytics/prediction_quality/
https://braze-docs-gtcavota9-braze.vercel.app/docs/user_guide/sage_ai/predictive_suite/predictive_churn/messaging_users/
https://braze-docs-gtcavota9-braze.vercel.app/docs/user_guide/sage_ai/predictive_suite/predictive_churn/prediction_faq/
https://braze-docs-gtcavota9-braze.vercel.app/docs/user_guide/sage_ai/predictive_suite/predictive_events/
https://braze-docs-gtcavota9-braze.vercel.app/docs/user_guide/sage_ai/predictive_suite/predictive_events/creating_an_event_prediction/
https://braze-docs-gtcavota9-braze.vercel.app/docs/user_guide/sage_ai/predictive_suite/predictive_events/prediction_analytics/