Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: improve docs, clean up repo files & metadata #57

Merged
merged 5 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .zed/tasks.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
[
{
"label": "build (mauve accent only)",
"command": "whiskers zed.tera -o json --overrides '{\"accent\": [\"mauve\"]}'"
"label": "Build (all)",
"command": "whiskers zed.tera"
},
{
"label": "publish (all accents)",
"command": "whiskers zed.tera -o json"
"label": "Build (mauve only)",
"command": "whiskers zed.tera --overrides '{\"accent\": [\"mauve\"]}'"
},
{
"label": "clean",
"label": "Clean",
"command": "rm themes/*.json"
},
{
"label": "test",
"command": "whiskers zed.tera -o json --overrides '{\"accent\": \"mauve\"}' --check themes/catppuccin-mauve.json"
}
]
114 changes: 19 additions & 95 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,130 +12,54 @@
</p>

<p align="center">
<img src="./assets/previews/preview.webp"/>
<img src="assets/preview.webp"/>
</p>

## Previews

<details>
<summary>🌻 Latte</summary>
<img src="./assets/previews/latte.webp"/>
<img src="assets/latte.webp"/>
</details>
<details>
<summary>🪴 Frappé</summary>
<img src="./assets/previews/frappe.webp"/>
<img src="assets/frappe.webp"/>
</details>
<details>
<summary>🌺 Macchiato</summary>
<img src="./assets/previews/macchiato.webp"/>
<img src="assets/macchiato.webp"/>
</details>
<details>
<summary>🌿 Mocha</summary>
<img src="./assets/previews/mocha.webp"/>
<img src="assets/mocha.webp"/>
</details>

## Usage

### Install via Zed Extensions

1. Open Zed.
2. `cmd+shift+p` and select _zed: extensions_
3. Select _Catppuccin Themes_ and Install
4. Select your Catppuccin theme in the dropdown shown after hitting `cmd+k`, `cmd+t`

### 🎨 Installing Different Catppuccin Flavor Accents
2. Open the command palette (<kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>) and enter _zed: extensions_.
3. Search for the _Catppuccin_ extension and install.
4. Enter _theme selector: toggle_ in the command palette and select the Catppuccin theme in your preferred flavor in the dropdown.

<details>
### Accents

<img src="./assets/accents.webp"/>

1. Download accent`.json` from [GH Releases](https://github.com/catppuccin/zed/releases/latest)
2. `mkdir -p ~/.config/zed/themes/`
3. Move the accent`.json` file to `~/.config/zed/themes/`
4. Restart Zed
5. Select the chosen theme in the dropdown shown after hitting `cmd+k`, `cmd+t`

</details>
1. Download the JSON file of your preferred accent from the [latest GitHub release](https://github.com/catppuccin/zed/releases/latest).
2. Create the `themes/` subfolder inside the directory of your [Zed configuration file](https://zed.dev/docs/configuring-zed#settings-files) (typically `~/.config/zed/`).
3. Move the downloaded file from Step 1 to the `themes/` subfolder created in Step 2.
4. Restart Zed.
5. Enter _theme selector: toggle_ in the command palette and select your new flavor and accent combination theme in the dropdown.

## Development

### Use `whiskers` to Render Theme from `zed.tera` Template

<details>

1. Install [Rust](https://www.rust-lang.org/tools/install)
2. Install [`whiskers`](https://crates.io/crates/catppuccin-whiskers)
Install [Whiskers](https://github.com/catppuccin/whiskers), Catppuccin's in-house theme generator, to build and test themes locally.

```bash
# brew install catppuccin/tap/whiskers
cargo install catppuccin-whiskers@2.5.1
```
Once installed, run `whiskers zed.tera` to generate all themes in the `themes/` directory.

3. Test and check changes against current `mauve` accent theme
You can then test the themes in Zed by opening the command palette and entering _zed: install dev extension_, selecting this repository, and then refreshing the theme extension using _zed: reload extensions_. _workspace: reload_ may be needed if changes are not reflected immediately. See the [Zed documentation](https://zed.dev/docs/extensions/developing-extensions) for more information.

```bash
# returns nothing if OK
whiskers zed.tera -o json --overrides '{"accent": "mauve"}' --check themes/catppuccin-mauve.json
```
### Publishing to the Marketplace

4. Build the `.json` theme file

```bash
whiskers zed.tera -o json --overrides '{"accent": ["mauve"]}'
# whiskers zed.tera -o json --overrides '{"accent": ["mauve","lavender"]}'
...
```

5. (Optional) 🎨 Generate **all** accents per Flavor

```bash
whiskers zed.tera -o json
```

6. Refresh Zed to load changes after ensuring local extension install

</details>

### Test Zed Extension Theme Locally

<details>

From [Zed Extensions docs](https://github.com/zed-industries/extensions/blob/c891c83f2fed6e388184ac87e7966b150680a3d1/AUTHORING_EXTENSIONS.md#testing-your-extension-locally):

1. Install project as "Zed Dev Extension"

```
cmd+shift+p > zed: install dev extension > (select current directory)
```

2. Refresh theme extension using: `cmd+shift+p` > `zed: reload extensions`
3. (Optional) `workspace: reload` may be needed if changes are not reflected immediately

</details>

### Publishing to Zed Extensions Marketplace

<details>

Zed organizes all extensions using `git submodules` in the [zed/extensions](https://github.com/zed-industries/extensions) repo.

1. [Fork the repo](https://github.com/zed-industries/extensions/fork)
2. Pull the currently published `extensions/catppuccin/` submodule

```
git submodule update --init --force extensions/catppuccin
```

3. Bump catppuccin submodule

```
cd extensions/catppuccin/ && git pull origin main
```

4. Modify the extensions/`extensions.toml` version to match value in [catppuccin/zed/extension.toml](./extension.toml#L3)
5. Submit a PR to merge back to `zed/extensions`

</details>
See the [Zed documentation](https://zed.dev/docs/extensions/developing-extensions#updating-an-extension) for more information.

## 💝 Thanks to

Expand Down
Empty file removed assets/.gitkeep
Empty file.
Binary file removed assets/accents.webp
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions extension.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id = "catppuccin"
name = "Catppuccin Themes"
name = "Catppuccin"
schema_version = 1
version = "0.2.16"
authors = ["Andrew Tec <andrewtec@enjoi.dev>"]
authors = ["Catppuccin <releases@catppuccin.dev>"]
description = "🦀 Soothing pastel theme for Zed"
repository = "https://github.com/catppuccin/zed"
2 changes: 1 addition & 1 deletion zed.tera
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ whiskers:
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"name": "Catppuccin",
"author": "Andrew Tec <andrewtec@enjoi.dev>",
"author": "Catppuccin <releases@catppuccin.dev>",
"themes": [
{%- for _, flavor in flavors -%}
{%- set c = flavor.colors -%}
Expand Down