Skip to content

feat: Remote Theme Download #312

@rochacbruno

Description

@rochacbruno

Marmite now supports setting a separate theme by passing --theme to the CLI or setting theme: name on marmite.yaml

The new feature must be:

Allow setting a remote theme url

How will it work

marmite input_folder --set-theme https://github.com/rochacbruno/mytheme

This command will do the following:

  1. Using HTTP it will download the theme e.g: https://github.com/rochacbruno/mytheme/archive/refs/heads/main.zip for github https://gitlab.com/rochacbruno/mytheme/-/archive/main/mytheme-main.zip for gitlab or wget https://codeberg.org/rochacbruno/mytheme/archive/main.zip for forgejo/codeberg repos. (if the URL itself ends in .zip then download directly, otherwise apply some logic to decide the url to use.
  2. The theme must be downloaded to input_folder and extracted, so there will be mytheme there.
  3. Validate that the theme includes the theme.json file, if not, then remove the mytheme folder and exit with error
  4. If the argument to --set-theme is not a URL, e.g --set-theme foo then don't download anything, just ensure the foo folder exists in input_folder, and proceed to next step.
  5. When succeeded, edit the marmite.yaml setting theme: mytheme edit if existing or add if key is missing, if marmite.yaml does not exist create one using marmite --generate-config --theme mytheme
  6. Finish with success showing a success message + metadata extracted from mytheme/theme.json
  7. Use https://github.com/rochacbruno/mytheme as example for testing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions