Skip to content

frostybee/expressive-code-language-badge

Repository files navigation

Expressive Code Language Badge

A plugin for Expressive Code that adds language badges to code blocks with customizable styling.

npm version License: MIT

Features

  • Automatic language detection: Shows programming language for each code block
  • Custom language labels: Remap identifiers (e.g., cppC++)
  • Exclude languages: Hide badges for specific languages
  • Text transform: Choose uppercase or lowercase display
  • Hover interaction: Badges fade out on hover
  • Fully customizable: Extensive styling options for colors, fonts, and borders

Installation

npm install expressive-code-language-badge

Quick Start

import { pluginLanguageBadge } from 'expressive-code-language-badge';

// Add to your Expressive Code configuration
plugins: [
  pluginLanguageBadge({
    textTransform: 'lowercase',
    excludeLanguages: ['json', 'css'],
    languageMap: {
      cpp: 'C++',
      csharp: 'C#',
    },
  })
]

Documentation

For comprehensive documentation, installation guides, configuration options, and examples, visit the plugin documentation.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

License

Licensed under the MIT License, Copyright © frostybee.

See LICENSE for more information.

Links

About

An Expressive Code plugin that adds a language badge to code blocks on your Astro website.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors