Skip to content

feat(containers-plugin): Being able to add custom containers #3591

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

Open
4 tasks done
brenoepics opened this issue Feb 21, 2024 · 2 comments · May be fixed by #3603
Open
4 tasks done

feat(containers-plugin): Being able to add custom containers #3591

brenoepics opened this issue Feb 21, 2024 · 2 comments · May be fixed by #3603
Labels

Comments

@brenoepics
Copy link

Is your feature request related to a problem? Please describe.

Currently, you can change the label but you cannot add new containers for new colors and/or icons.
Containers Plugin

Describe the solution you'd like

Adding custom containers to ContainerOptions, then users could add it in DefineConfig / DefineConfigWithTheme

//containers.ts
export interface ContainerOptions {
  infoLabel?: string
  noteLabel?: string
  tipLabel?: string
  warningLabel?: string
  dangerLabel?: string
  detailsLabel?: string
  importantLabel?: string
  cautionLabel?: string
  customContainers?: ...
}

// config.ts
export default defineConfig({
  // ...
  markdown: {
    container: {
      tipLabel: '...',
      warningLabel: '...',
      dangerLabel: '...',
      infoLabel: '...',
      detailsLabel: '...',
      customContainers: [ ... ]
    }
  }
  // ...
})

Describe alternatives you've considered

Disabling GitHub Flavored Markdown-It plugin and registering again with custom alerts.

Additional context

No response

Validations

@brenoepics brenoepics linked a pull request Feb 25, 2024 that will close this issue
@github-actions github-actions bot added the stale label Apr 12, 2024
@dragomano
Copy link
Collaborator

I'd also like to be able to translate all these containers on sites with multiple languages.

@github-actions github-actions bot removed the stale label May 23, 2024
@github-actions github-actions bot added the stale label Jun 23, 2024
@github-actions github-actions bot removed the stale label Jan 20, 2025
@github-actions github-actions bot added the stale label Mar 2, 2025
@comfuture
Copy link

I strongly agree with this opinion.
It would be very flexible if a container plugin were provided or allowed users to create one, reusing features like displaying items already implemented in the Home layout.

For example:

::: flex-container{cols=3}
...
:::

Although the goal is somewhat different, being able to extend components in a form similar to https://nuxt.com/modules/mdc would be extremely convenient.

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

Successfully merging a pull request may close this issue.

4 participants