Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate BlockKit Builder URL for an array of blocks #37

Open
jimmyhlee94 opened this issue Feb 17, 2020 · 1 comment
Open

Generate BlockKit Builder URL for an array of blocks #37

jimmyhlee94 opened this issue Feb 17, 2020 · 1 comment

Comments

@jimmyhlee94
Copy link

Is your feature request related to a problem? Please describe.
having to go back and forth between blockkit builder and code is a bit tedious because of formatting differences between json (which is what blockkit builder accepts) and anything else you might use.

It seems like the entirety of the blockkit you design via the builder is URL-encoded, so we could build a pretty quick helper to generate the link for an array of blockkit blocks.

Describe the solution you'd like
A TS/JS utility that will return the blockkit builder URL provided an array of blockkit blocks:

// if it's a utility function
console.log(toBlockKitBuilderURL([/*array of KnownBlocks*/])
// https://api.slack.com/tools/block-kit-builder?mode=message&blocks=<blahblahblah>

// or using some imaginary class-based blockkit builder tool **nudge nudge**
console.log(Builder.section().section().section().toBlockKitBuilderURL());

Describe alternatives you've considered
copy-pasting almost-json into vscode and using the Fix JSON extension to format the contents

@raycharius
Copy link

Hi Jimmy, you should check out slack-block-builder. It's got the chainable interfaces you're referred to, as well as a printPreviewUrl() method for every surface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants