expressive-code-language-badge
v1.1.0
Published
Add language badge to Expressive Code codeblocks in your Astro site.
Downloads
162
Maintainers
Readme
Features
- Automatic language detection: Shows programming language for each code block
- Custom language labels: Remap identifiers (e.g.,
cpp→C++) - 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-badgeQuick 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.
