Skip to content

DEVREL-2731: Use display names for examples#60

Open
tim-webflow wants to merge 2 commits intoDEVREL-2862-categoriesfrom
DEVREL-2731-display-names
Open

DEVREL-2731: Use display names for examples#60
tim-webflow wants to merge 2 commits intoDEVREL-2862-categoriesfrom
DEVREL-2731-display-names

Conversation

@tim-webflow
Copy link
Copy Markdown
Collaborator

@tim-webflow tim-webflow commented Apr 22, 2026

Builds on #59.

Separates each example into display name and code so we can put in a clear display name and filter out the wrapper function.

This requires changes to how we put examples in there. Now they are formatted like this; each example has a displayName and code element:

export const Elements = {
  // Element Management
  elementManagement: {
    getSelectedElement: {
      displayName: 'Get selected element',
      code: async () => {
        // Get Selected Element
        const element = await webflow.getSelectedElement()

        // Print element info
        if (element) {
          console.log(element)
          console.log(`Element type: ${element.type}`)
        } else {
          console.log('No element is currently selected.')
        }
      },
    },

Before:
Screenshot 2026-04-22 at 1 15 14 PM

After:
Screenshot 2026-04-22 at 1 15 44 PM

Also fixes the bugs where the function wrapper is shown and the indents are off:

Before:
Screenshot 2026-04-22 at 1 16 44 PM

After:
Screenshot 2026-04-22 at 1 17 00 PM

@tim-webflow tim-webflow self-assigned this Apr 22, 2026
@tim-webflow tim-webflow changed the base branch from main to DEVREL-2862-categories April 22, 2026 17:14
@tim-webflow tim-webflow marked this pull request as ready for review April 22, 2026 17:17
@tim-webflow tim-webflow force-pushed the DEVREL-2862-categories branch from a772838 to ef29b95 Compare April 22, 2026 17:33
@tim-webflow tim-webflow force-pushed the DEVREL-2731-display-names branch from 50449b0 to e69e727 Compare April 22, 2026 17:45
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

Successfully merging this pull request may close these issues.

1 participant