Code Monkey home page Code Monkey logo

Comments (10)

sgoudham avatar sgoudham commented on June 10, 2024 1

Hey πŸ‘‹, thanks for porting the code over to whiskers @uncenter, and @sxyazi for originally implementing the theme!

Thanks! Could we have a separate directory for each theme and add the tmTheme files to them? Like this:

Separate directories aren't inherently a bad idea, however, it doesn't follow our project layout conventions which we follow across >250 repositories (and duplicating the LICENSE file doesn't make much sense to me here)

I think the duplication of files isn't ideal. I'm guessing most users will want the correct, matching syntax highlighting as you said but even more people could possibly already be using catppuccin/bat and it might be confusing if they don't realize the tmTheme files are identical to what they already have. I'm curious what you think, @sgoudham?

Yeah, taking into consideration the scale of Catppuccin, I'd really like to avoid duplication. For the README, I think it's okay to link out to another repository and tell users to download file(s) from there. In this specific case, I'd move out the instructions from the FAQ into the Usage section so that its the next step. For example:

## Usage

1. Copy the theme file of your choice from `themes/` to your [Yazi configuration directory](https://yazi-rs.github.io/docs/configuration/overview) with the filename `theme.toml`.
2. Download the `.tmTheme` file of your choice from [catppuccin/bat](https://github.com/catppuccin/bat).
	- Replace path of `syntect_theme` (line 27) to the path of your downloaded `.tmTheme` file.

It's worth mentioning that catppuccin/bat's .tmTheme files are in need of a rework to better align with the syntax highlighting guidelines introduced over the last year, and an update to those files should be expected soon ℒ️

I'd appreciate if you could move the FAQ into the Usage section as outlined above πŸ‘ @uncenter

from catppuccin.

uncenter avatar uncenter commented on June 10, 2024 1

I'm happy to maintain it, yep!

from catppuccin.

sxyazi avatar sxyazi commented on June 10, 2024

Thanks! Could we have a separate directory for each theme and add the tmTheme files to them? Like this:

.
β”œβ”€β”€ frappe
β”‚Β Β  β”œβ”€β”€ Catppuccin-frappe.tmTheme
β”‚Β Β  β”œβ”€β”€ LICENSE
β”‚Β Β  β”œβ”€β”€ screenshot.png
β”‚Β Β  └── theme.toml
β”œβ”€β”€ latte
β”‚Β Β  β”œβ”€β”€ Catppuccin-latte.tmTheme
β”‚Β Β  β”œβ”€β”€ LICENSE
β”‚Β Β  β”œβ”€β”€ screenshot.png
β”‚Β Β  └── theme.toml
β”œβ”€β”€ macchiato
β”‚Β Β  β”œβ”€β”€ Catppuccin-macchiato.tmTheme
β”‚Β Β  β”œβ”€β”€ LICENSE
β”‚Β Β  β”œβ”€β”€ screenshot.png
β”‚Β Β  └── theme.toml
└── mocha
    β”œβ”€β”€ Catppuccin-mocha.tmTheme
    β”œβ”€β”€ LICENSE
    β”œβ”€β”€ screenshot.png
    └── theme.toml

5 directories, 16 files

from catppuccin.

uncenter avatar uncenter commented on June 10, 2024

Thanks! Could we have a separate directory for each theme and add the tmTheme files to them? Like this:

.
β”œβ”€β”€ frappe
β”‚Β Β  β”œβ”€β”€ Catppuccin-frappe.tmTheme
β”‚Β Β  β”œβ”€β”€ LICENSE
β”‚Β Β  β”œβ”€β”€ screenshot.png
β”‚Β Β  └── theme.toml
β”œβ”€β”€ latte
β”‚Β Β  β”œβ”€β”€ Catppuccin-latte.tmTheme
β”‚Β Β  β”œβ”€β”€ LICENSE
β”‚Β Β  β”œβ”€β”€ screenshot.png
β”‚Β Β  └── theme.toml
β”œβ”€β”€ macchiato
β”‚Β Β  β”œβ”€β”€ Catppuccin-macchiato.tmTheme
β”‚Β Β  β”œβ”€β”€ LICENSE
β”‚Β Β  β”œβ”€β”€ screenshot.png
β”‚Β Β  └── theme.toml
└── mocha
    β”œβ”€β”€ Catppuccin-mocha.tmTheme
    β”œβ”€β”€ LICENSE
    β”œβ”€β”€ screenshot.png
    └── theme.toml

5 directories, 16 files

I think the duplication of files isn't ideal. I'm guessing most users will want the correct, matching syntax highlighting as you said but even more people could possibly already be using catppuccin/bat and it might be confusing if they don't realize the tmTheme files are identical to what they already have. I'm curious what you think, @sgoudham?

from catppuccin.

sxyazi avatar sxyazi commented on June 10, 2024

but even more people could possibly already be using catppuccin/bat and it might be confusing if they don't realize the tmTheme files are identical to what they already have

Yazi and bat are two independent programs, and bat is not a dependency of Yazi. They both just happen to use the same Rust highlighter, syntect.

I don't think it makes sense to not add them to Yazi just because users already have bat installed and have bat's syntect theme files.

from catppuccin.

uncenter avatar uncenter commented on June 10, 2024

I'd appreciate if you could move the FAQ into the Usage section as outlined above πŸ‘ @uncenter

Done! I added a short explanation of why the .tmTheme file is necessary, I think it works fine but let me know if it needs further adjustment.

from catppuccin.

sgoudham avatar sgoudham commented on June 10, 2024

Yeah I think it's fine, my nitpick review would be to format it a little nicer, e.g.

2. For Catppuccin-themed syntax highlighting in the preview pane: 
	- Download the `.tmTheme` file of your choice from [catppuccin/bat](https://github.com/catppuccin/bat)
	- Replace the path of `syntect_theme` (line 27) with the path of your downloaded `.tmTheme` file.

But it's not something I care too much about, and as you said, it's fine.

Nice work on this, I'm happy for it to be transferred over to the organisation! (Can I quickly confirm that you are okay to be listed as the maintainer of this port? Or will it be @sxyazi ?)

Please read, "Transferring a repository owned by your personal account", if you are unsure about the process of transferring the repository to Catppuccin.

We'll close this issue once the port has been added to our ports.yml. You can find an example of this in #2164

Outstanding Actions After Transfer

from catppuccin.

sxyazi avatar sxyazi commented on June 10, 2024

@sgoudham OK, thanks for explaining.
Any chance I can convince you to add these tmTheme files and change the directory layout?

I will provide a more explicit definition in the theme-making documentation/template for Yazi in the next few days - A Yazi theme that does not include a tmTheme file is considered an invalid theme, and each theme must be a directory.

This not only eliminates the need for users to separately download and configure additional files/options - when a user uses a theme, they definitely want the colors of the entire Yazi to match the terminal colors, not just the parts outside of code highlighting.

But also enables future theme managers to automate the process - all that will be required is to move the entire directory to ~/.config/yazi/themes, without the need to analyze various README files to see if they contain another repository link pointing to a tmTheme file, and then download it, and the directory structure could be quite diverse.


Edit: If this is still unacceptable, I'm sorry.

The reason for making such a request is because I really love catppuccin and can't go a day without it. You might find it hard to believe that in earlier versions of Yazi, the color of catppuccin was hardcoded directly into the code, and it has appeared as the official theme until now. Therefore, I will be more stringent in my requirements for it.

from catppuccin.

uncenter avatar uncenter commented on June 10, 2024

A Yazi theme that does not include a tmTheme file is considered an invalid theme, and each theme must be a directory.

Hmm. At that point I question the merits of having two theme files if one is invalid without the other? Seems like they should be joined in some way?

all that will be required is to move the entire directory to ~/.config/yazi/themes

I'm confused since doesn't Yazi not support this kind of behavior? It looks for ~/.config/yazi/theme.toml, not anything in the themes directory right? And this brings up the idea we discussed in Discord earlier regarding remote themes and caching them and all that...

from catppuccin.

sxyazi avatar sxyazi commented on June 10, 2024

Hmm. At that point I question the merits of having two theme files if one is invalid without the other? Seems like they should be joined in some way?

I'm not quite sure I understand your meaning. Are the "two theme files" referring to the theme Yazi itself and the "tmTheme" file? See sxyazi/yazi#584, this is why I want to treat them (theme.toml + tmTheme) as a "Yazi theme (directory)," because users often confuse the Yazi theme itself (theme.toml) with the Syntect theme (tmTheme file).

What I mean is that frappe, latte, macchiato, and mocha should be 4 different Yazi themes. Ideally, they should each be in their own repository (with files stored in the repository root, so you can think of it as a directory, similar to the structure of Yazi plugins, like https://github.com/dedukun/bookmarks.yazi).

However, it is acceptable for them to be in the same repository, but they should be in at least 4 different directories.

I'm confused since doesn't Yazi not support this kind of behavior? It looks for ~/.config/yazi/theme.toml, not anything in the themes directory right? And this brings up the idea we discussed in Discord earlier regarding remote themes and caching them and all that...

β€œBut also enables future theme managers to automate the process”

I've already mentioned, this is to prepare for the future and retain this flexibility for later expansion - I need to establish and push a theme structure, because changing the directory structure is a breaking change for the entire existing theme ecosystem, but fortunately, there are not many themes for Yazi at the moment.

As for the proposals you mentioned on Discord:

  1. Adding a themes directory, the purpose is to allow Yazi to support multiple local themes and allow users to switch between them in the configuration.
  2. Allowing loading network themes via URL, the purpose is to make theme updates more convenient, and by URL-izing tmTheme files, to address catppuccin's refusal to include them in Yazi themes.

These are two proposals with completely different purposes. I only rejected the second proposal, but added the first one to the roadmap for Yazi v0.3, and currently, this work is being prepared for it.

from catppuccin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.