Skip to content

Conversation

rochacbruno
Copy link
Owner

Summary

  • Implements issue feat: Remote Theme Download #312 to allow downloading and setting themes from remote repositories
  • Adds --set-theme CLI option for theme installation from GitHub, GitLab, Codeberg, or direct zip URLs
  • Validates theme.json existence before installation to ensure theme compatibility

Implementation Details

New CLI Option

  • Added --set-theme <THEME_SOURCE> option to download and set themes
  • Supports multiple sources:
    • GitHub: https://github.com/username/themename
    • GitLab: https://gitlab.com/username/themename
    • Codeberg: https://codeberg.org/username/themename
    • Direct zip URLs: https://example.com/themes/mytheme.zip
    • Local themes: mytheme (validates existence)

Features

  • Downloads and extracts theme zip files automatically
  • Validates theme.json existence before installation
  • Updates or creates marmite.yaml with the new theme setting
  • Displays theme metadata (name, version, author, features) on successful installation
  • Cleans up temporary files and invalid downloads automatically

Dependencies

  • Added zip = "2.2.2" for zip file extraction
  • Uses existing ureq for HTTP downloads

Test Plan

  • Test downloading theme from GitHub URL
  • Test setting a local theme that exists
  • Test error handling for non-existent local theme
  • Test marmite.yaml creation when it doesn't exist
  • Test marmite.yaml update when it exists
  • Test theme metadata display

Testing

# Download from GitHub
marmite my_site --set-theme https://github.com/rochacbruno/mytheme

# Set local theme
marmite my_site --set-theme mytheme

# Build with the theme
marmite my_site --theme mytheme

🤖 Generated with Claude Code

rochacbruno and others added 3 commits July 23, 2025 16:26
- Add new CLI option --set-theme to download and set themes from remote URLs
- Support GitHub, GitLab, and Codeberg repositories
- Automatically download and extract theme zip files
- Validate theme.json existence before setting theme
- Update or create marmite.yaml with new theme configuration
- Display theme metadata on successful installation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add new documentation page for remote theme download
- Update existing themes documentation with --set-theme info
- Update CLI documentation with new --set-theme option

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Use case-insensitive file extension comparison for .zip files
- Use Path API for more robust filename handling
- Format code according to rustfmt standards

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@rochacbruno rochacbruno force-pushed the feat/remote-theme-download branch from c0a6a43 to 1c4450b Compare July 23, 2025 15:50
- Update zip crate from 2.2.2 to 4.3.0 (latest version)
- All tests pass with the new version
- Theme download functionality confirmed working

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@rochacbruno rochacbruno merged commit 90329a5 into main Jul 23, 2025
3 checks passed
@rochacbruno rochacbruno deleted the feat/remote-theme-download branch July 23, 2025 16:02
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