Theming โ
Logsmith provides a powerful theming system that allows you to customize the visual appearance of your changelogs. Choose from 8 built-in themes or create your own custom themes to match your project's style.
Built-in Themes โ
Available Themes โ
List all available themes:
# View all themes with descriptions
logsmith themes
Output:
๐จ Available Themes:
default - Default: Standard emoji theme with colorful icons
minimal - Minimal: Clean theme with minimal symbols
github - GitHub: GitHub-inspired theme with familiar styling
gitmoji - Gitmoji: Complete gitmoji emoji set for commit types
unicode - Unicode: Unicode symbols instead of emojis for better compatibility
simple - Simple: Text-only theme without any symbols or emojis
colorful - Colorful: Vibrant theme with enhanced visual elements
corporate - Corporate: Professional theme suitable for business environments
Theme Comparison โ
Here's how different themes style the same content:
## ๐ Features
- Add user authentication system ([abc123](repo/commit/abc123))
- Implement dark mode toggle ([def456](repo/commit/def456))
## ๐ Bug Fixes
- Fix login token expiration issue ([ghi789](repo/commit/ghi789))
## โจ Features
- Add user authentication system ([abc123](repo/commit/abc123))
- Implement dark mode toggle ([def456](repo/commit/def456))
## ๐ Bug Fixes
- Fix login token expiration issue ([ghi789](repo/commit/ghi789))
### โจ Features
* Add user authentication system ([abc123](repo/commit/abc123))
* Implement dark mode toggle ([def456](repo/commit/def456))
### ๐ง Bug Fixes
* Fix login token expiration issue ([ghi789](repo/commit/ghi789))
## Features
- Add user authentication system ([abc123](repo/commit/abc123))
- Implement dark mode toggle ([def456](repo/commit/def456))
## Bug Fixes
- Fix login token expiration issue ([ghi789](repo/commit/ghi789))
Using Themes โ
Command Line โ
Apply themes directly via CLI:
# Use GitHub theme
logsmith --theme github --output CHANGELOG.md
# Use minimal theme
logsmith --theme minimal --output CHANGELOG.md
# Use corporate theme (no emojis)
logsmith --theme corporate --output CHANGELOG.md
Configuration File โ
Set default theme in your config:
// logsmith.config.ts
import { defineConfig } from 'logsmith'
export default defineConfig({
theme: 'github',
output: 'CHANGELOG.md',
})
Theme Details โ
Default Theme โ
Best for: General use, open source projects Features: Colorful emojis, standard formatting
const defaultTheme = {
emojis: {
feat: '๐',
fix: '๐',
docs: '๐',
style: '๐
',
refactor: 'โป๏ธ',
perf: 'โก',
test: '๐งช',
build: '๐ฆ',
ci: '๐ค',
chore: '๐งน',
revert: 'โช',
breaking: '๐ฅ',
}
}
GitHub Theme โ
Best for: GitHub repositories, familiar styling Features: GitHub-style emojis, clean appearance
const githubTheme = {
emojis: {
feat: 'โจ',
fix: '๐',
docs: '๐',
style: '๐',
refactor: 'โป๏ธ',
perf: 'โก',
test: 'โ
',
build: '๐ท',
ci: '๐',
chore: '๐ง',
revert: 'โช',
breaking: '๐ฅ',
}
}
Minimal Theme โ
Best for: Clean, understated documentation Features: Simple symbols, reduced visual noise
const minimalTheme = {
emojis: {
feat: 'โจ',
fix: '๐ง',
docs: '๐',
style: '๐จ',
refactor: '๐',
perf: 'โก',
test: 'โ
',
build: '๐ฆ',
ci: '๐',
chore: '๐ง',
revert: 'โฉ๏ธ',
breaking: 'โ ๏ธ',
}
}
Corporate Theme โ
Best for: Enterprise, professional environments Features: No emojis, business-friendly formatting
const corporateTheme = {
emojis: {
feat: '',
fix: '',
docs: '',
style: '',
refactor: '',
perf: '',
test: '',
build: '',
ci: '',
chore: '',
revert: '',
breaking: '',
}
}
Gitmoji Theme โ
Best for: Projects using gitmoji conventions Features: Complete gitmoji emoji set
const gitmojiTheme = {
emojis: {
feat: 'โจ',
fix: '๐',
docs: '๐',
style: '๐จ',
refactor: 'โป๏ธ',
perf: 'โก๏ธ',
test: 'โ
',
build: '๐ท',
ci: '๐',
chore: '๐ง',
revert: 'โช๏ธ',
breaking: '๐ฅ',
}
}
Unicode Theme โ
Best for: Better terminal compatibility, accessibility Features: Unicode symbols instead of emojis
const unicodeTheme = {
emojis: {
feat: 'โ',
fix: 'โ',
docs: 'โ',
style: 'โ',
refactor: 'โป',
perf: 'โฒ',
test: 'โ',
build: 'โ ',
ci: 'โ',
chore: 'โ',
revert: 'โ',
breaking: 'โผ',
}
}
Custom Themes โ
Creating Custom Themes โ
Define your own theme with custom emojis and styling:
// logsmith.config.ts
import { defineConfig } from 'logsmith'
export default defineConfig({
// Override individual emojis
templates: {
typeFormat: {
feat: '๐ New Features',
fix: '๐ง Bug Fixes',
docs: '๐ Documentation',
style: '๐จ Code Style',
refactor: '๐จ Refactoring',
perf: '๐ Performance',
test: '๐งช Testing',
build: '๐ฆ Build System',
ci: '๐ค CI/CD',
chore: '๐งน Maintenance',
revert: 'โช Reverts',
},
},
})
Advanced Custom Theme โ
Create a complete custom theme with styling options:
// my-theme.ts
import type { ThemeConfig } from 'logsmith'
export const myCustomTheme: ThemeConfig = {
name: 'My Custom Theme',
description: 'Custom theme for my project',
emojis: {
feat: '๐',
fix: '๐ ๏ธ',
docs: '๐',
style: '๐ญ',
refactor: '๐',
perf: 'โก',
test: '๐',
build: '๐๏ธ',
ci: '๐ค',
chore: '๐งฝ',
revert: 'โถ',
misc: '๐',
breaking: '๐ฅ',
},
styles: {
markdown: {
headerPrefix: '###',
listItemPrefix: 'โข',
emphasis: 'bold',
codeStyle: 'backticks',
},
html: {
colorScheme: 'dark',
fontSize: 'large',
fontFamily: 'JetBrains Mono, monospace',
customCss: `
.changelog {
background: #1a1a1a;
color: #ffffff;
padding: 2rem;
}
.commit-type {
color: #00d4aa;
font-weight: bold;
}
.breaking-change {
color: #ff6b6b;
background: #2a1f1f;
padding: 0.5rem;
border-left: 4px solid #ff6b6b;
}
`,
},
},
}
Using Custom Themes Programmatically โ
import { generateChangelog } from 'logsmith'
import { myCustomTheme } from './my-theme'
// Apply custom theme programmatically
await generateChangelog({
output: 'CHANGELOG.md',
templates: {
typeFormat: myCustomTheme.emojis,
},
})
Theme Customization โ
Format-Specific Themes โ
Different themes for different output formats:
export default defineConfig({
// Base theme
theme: 'github',
// Format-specific overrides
templates: {
// Markdown-specific formatting
commitFormat: '- {{scope}}{{description}} ([{{hash}}]({{repoUrl}}/commit/{{hash}}))',
groupFormat: '## {{title}}',
// Different formatting for HTML
...(process.env.FORMAT === 'html' && {
commitFormat: '<li>{{scope}}{{description}} <a href="{{repoUrl}}/commit/{{hash}}">{{hash}}</a></li>',
groupFormat: '<h2>{{title}}</h2>',
}),
},
})
Conditional Theming โ
Apply different themes based on environment:
export default defineConfig({
theme: process.env.NODE_ENV === 'production' ? 'corporate' : 'default',
templates: {
typeFormat: {
feat: process.env.CI ? 'โจ Features' : '๐ Features',
fix: process.env.CI ? '๐ Bug Fixes' : '๐ง Bug Fixes',
},
},
})
Styling Options โ
Markdown Styling โ
Customize markdown output styling:
export default defineConfig({
theme: 'github',
templates: {
// Custom header levels
groupFormat: '### {{title}}', // Use h3 instead of h2
// Custom list styling
commitFormat: '* {{scope}}{{description}}', // Use * instead of -
// Custom breaking change format
breakingChangeFormat: 'โ ๏ธ **BREAKING**: {{scope}}{{description}}',
// Custom date format
dateFormat: '**Released: {{date}}**',
},
})
HTML Styling โ
Customize HTML output with CSS:
export default defineConfig({
theme: 'colorful',
// HTML-specific styling (when using format: 'html')
templates: {
commitFormat: `
<div class="commit-entry">
<span class="commit-type">{{type}}</span>
<span class="commit-description">{{description}}</span>
<a href="{{repoUrl}}/commit/{{hash}}" class="commit-hash">{{hash}}</a>
</div>
`,
},
})
Theme Examples โ
Blog-style Theme โ
Perfect for project blogs and updates:
export default defineConfig({
theme: 'minimal',
templates: {
groupFormat: '## ๐
{{title}} - {{date}}',
commitFormat: '- **{{description}}** by @{{author}} ([view commit]({{repoUrl}}/commit/{{hash}}))',
dateFormat: '_{{date}}_',
typeFormat: {
feat: '๐ New Features',
fix: '๐ง Bug Fixes',
docs: '๐ Documentation Updates',
style: '๐
Style Improvements',
refactor: 'โป๏ธ Code Refactoring',
perf: 'โก Performance Improvements',
},
},
})
Release Notes Theme โ
Optimized for release announcements:
export default defineConfig({
theme: 'github',
templates: {
groupFormat: '## {{title}} ({{count}} changes)',
commitFormat: '- {{description}} ([{{hash}}]({{repoUrl}}/commit/{{hash}}))',
breakingChangeFormat: '- ๐จ **BREAKING CHANGE**: {{description}} ([{{hash}}]({{repoUrl}}/commit/{{hash}}))',
typeFormat: {
feat: 'โจ What\'s New',
fix: '๐ Bug Fixes',
docs: '๐ Documentation',
perf: 'โก Performance',
breaking: '๐จ Breaking Changes',
},
},
})
Developer-focused Theme โ
Technical details for developer audiences:
export default defineConfig({
theme: 'unicode',
includeCommitBody: true,
hideAuthorEmail: false,
templates: {
commitFormat: '- `{{type}}{{scope}}`: {{description}} ({{hash}}) by {{author}}',
groupFormat: '### {{title}}',
typeFormat: {
feat: 'FEAT',
fix: 'FIX',
docs: 'DOCS',
style: 'STYLE',
refactor: 'REFACTOR',
perf: 'PERF',
test: 'TEST',
build: 'BUILD',
ci: 'CI',
chore: 'CHORE',
},
},
})
Best Practices โ
Theme Selection Guidelines โ
- Open Source Projects: Use
default
orgithub
themes for familiarity - Corporate Environments: Use
corporate
orminimal
themes for professionalism - Documentation Sites: Use
minimal
or custom themes for brand consistency - Developer Tools: Use
unicode
orgitmoji
themes for technical audiences - Multi-audience Projects: Create environment-specific themes
Performance Considerations โ
- Emoji Support: Consider terminal/viewer emoji support
- File Size: Corporate themes generate smaller files
- Accessibility: Unicode themes are more accessible than emoji themes
- Parsing Speed: Simple themes process faster than complex custom themes
Customization Tips โ
- Start with a base theme and customize specific elements
- Test across different viewers (GitHub, terminals, browsers)
- Consider your audience when choosing emoji vs. text
- Use consistent formatting across all commit types
- Document your custom themes for team members
Next Steps โ
- Learn about repository analytics for detailed project insights
- Explore configuration options for advanced customization
- Check out automation setups for CI/CD integration
- Review the API reference for programmatic theming