Skip to content

Generate BlockKit Builder URL for an array of blocks #37

@jimmyhlee94

Description

@jimmyhlee94

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions