Skip to content

feat: add --theme CLI option to override configuration theme#308

Merged
rochacbruno merged 5 commits intomainfrom
feat/themes
Jul 22, 2025
Merged

feat: add --theme CLI option to override configuration theme#308
rochacbruno merged 5 commits intomainfrom
feat/themes

Conversation

@rochacbruno
Copy link
Copy Markdown
Owner

Summary

This PR adds a new --theme CLI option that allows users to override the theme specified in their configuration file. This enables testing different themes and building with different themes for different environments without modifying the config file.

Changes

Core Implementation

  • Added --theme <THEME> option to CLI configuration in src/cli.rs
  • Updated override_from_cli_args in src/config.rs to handle theme CLI override
  • CLI theme option takes precedence over marmite.yaml theme setting

Documentation Updates

  • Updated CLI documentation with comprehensive --theme usage examples
  • Enhanced themes documentation with CLI override information
  • Added theme configuration section to configuration reference
  • Updated getting started guide with modern theme structure examples

Dependencies

  • Disabled syntect feature in comrak to resolve onig_sys compilation issues
  • Maintains all markdown functionality while removing syntax highlighting dependency

Usage Examples

# Override theme from command line
marmite /site /output --theme mytheme

# Disable theme via CLI (ignores config setting)  
marmite /site /output --theme ""

# Test different themes without changing config
marmite /site /output-clean --theme clean
marmite /site /output-dark --theme darkmode

Benefits

  • Testing: Test themes without modifying configuration files
  • Flexibility: Build with different themes for different environments
  • Automation: Enable automated builds with theme selection
  • Override: CLI takes precedence over configuration file setting

Breaking Changes

⚠️ Syntax highlighting removed: Disabled syntect dependency to resolve compilation issues. Code blocks will render without syntax highlighting but all other markdown features remain functional.

Test Plan

  • All existing tests pass
  • CLI help includes new --theme option
  • Theme override works correctly via CLI
  • Theme loading precedence: CLI > config file > embedded templates
  • Documentation updated comprehensively
  • Backward compatibility maintained

- Add --theme option to Configuration struct in cli.rs
- Update override_from_cli_args to handle theme CLI argument
- CLI theme option takes precedence over config file setting
- Update CLI documentation with --theme usage examples
- Update themes documentation with CLI override information
- Update configuration reference with theme CLI option
- Update getting started guide with modern theme structure
- Remove syntect dependency to resolve onig_sys compilation issues

The --theme CLI option enables:
- Testing themes without modifying configuration
- Building with different themes for different environments
- Overriding theme specified in marmite.yaml
- Automated builds with theme selection

Example usage:
  marmite /site /output --theme mytheme
  marmite /site /output --theme ""  # disable theme

Breaking: Removed syntect feature from comrak to eliminate onig_sys
dependency and resolve compilation issues on some systems. This removes
syntax highlighting in code blocks but maintains all other markdown
functionality.
@rochacbruno rochacbruno merged commit ab75c16 into main Jul 22, 2025
3 checks passed
@rochacbruno rochacbruno deleted the feat/themes branch July 22, 2025 19:31
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