Skip to content

Commit

Permalink
feat: update docs (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
linrongbin16 committed Nov 21, 2023
1 parent 9a6660b commit 0e7a564
Show file tree
Hide file tree
Showing 7 changed files with 375 additions and 84 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/collect.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Color Collector
on:
pull_request:
branches:
- main
schedule:
- cron: "53 14 * * *"
concurrency:
Expand Down
24 changes: 24 additions & 0 deletions COLORSCHEMES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

ColorSchemes List
=================

- [folke/tokyonight.nvim](https://github.com/folke/tokyonight.nvim)
- [catppuccin/nvim](https://github.com/catppuccin/nvim)
- [rebelot/kanagawa.nvim](https://github.com/rebelot/kanagawa.nvim)
- [nlknguyen/papercolor-theme](https://github.com/nlknguyen/papercolor-theme)
- [nordtheme/vim](https://github.com/nordtheme/vim)
- [sainnhe/everforest](https://github.com/sainnhe/everforest)
- [cocopon/iceberg.vim](https://github.com/cocopon/iceberg.vim)
- [rakr/vim-one](https://github.com/rakr/vim-one)
- [junegunn/seoul256.vim](https://github.com/junegunn/seoul256.vim)
- [sainnhe/gruvbox-material](https://github.com/sainnhe/gruvbox-material)
- [rose-pine/neovim](https://github.com/rose-pine/neovim)
- [ku1ik/vim-monokai](https://github.com/ku1ik/vim-monokai)
- [sainnhe/sonokai](https://github.com/sainnhe/sonokai)
- [dracula/vim](https://github.com/dracula/vim)
- [navarasu/onedark.nvim](https://github.com/navarasu/onedark.nvim)
- [jacoborus/tender.vim](https://github.com/jacoborus/tender.vim)
- [lifepillar/vim-solarized8](https://github.com/lifepillar/vim-solarized8)
- [mhartington/oceanic-next](https://github.com/mhartington/oceanic-next)
- [projekt0n/github-nvim-theme](https://github.com/projekt0n/github-nvim-theme)
- [ellisonleao/gruvbox.nvim](https://github.com/ellisonleao/gruvbox.nvim)
52 changes: 46 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# colorbox.nvim

**WIP: Don't use this tool for now, it's still not done yet.**

I'm greedy that I want all the **most popular** Neovim colorschemes than only one, I'm playful that I want to change colorscheme from time to time. Are you like me?

This is it!
Expand All @@ -26,13 +24,55 @@ It install color plugins via git submodules instead of copy-paste source code, s

It allow you do any switches with:

- Multiple policies: suffle playback, play in order(todo), single cycle(todo).
- Multiple timing: on startup, fixed interval(todo), by filetype(todo), etc.
- Multiple policies:
- Suffle playback.
- Play in order(todo).
- Single cycle(todo).
- Multiple timing:
- On startup.
- Fixed interval(todo).
- By filetype(todo).

Please check [COLORSCHEMES.md](https://github.com/linrongbin16/colorbox.nvim/blob/main/COLORSCHEMES.md) for full colorschemes list.

## Requirement

Neovim ≥ 0.8.
- neovim ≥ 0.8.
- [git](https://git-scm.com/).

## Install

TODO
### [lazy.nvim](https://github.com/folke/lazy.nvim)

```lua
require('lazy').setup({
{
'linrongbin16/colorbox.nvim',
build = function() require('colorbox').update() end,
}
})
```

## Configuratoin

```lua
require('colorbox').setup({
--- @type "shuffle"|"inorder"|"single"
policy = "shuffle",

--- @type "startup"|"interval"|"filetype"
timing = "startup",

--- @type "dark"|"light"|nil
background = nil,

-- enable debug
debug = false,

-- print log to console (command line)
console_log = true,

-- print log to file.
file_log = false,
})
```
31 changes: 24 additions & 7 deletions collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from dataclasses import dataclass

import click
from mdutils.mdutils import MdUtils
from selenium.webdriver import Chrome, ChromeOptions
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webelement import WebElement
Expand Down Expand Up @@ -147,6 +148,7 @@ class RepoMeta:
LAST_UPDATE = "last_update"
PRIORITY = "priority"
SOURCE = "source"
OBJ_NAME = "obj_name"

def __init__(
self,
Expand All @@ -155,6 +157,7 @@ def __init__(
last_update: typing.Optional[datetime.datetime] = None,
priority: int = 0,
source: typing.Optional[str] = None,
obj_name: typing.Optional[str] = None,
) -> None:
assert isinstance(url, str)
assert isinstance(stars, int) and stars >= 0
Expand All @@ -166,6 +169,7 @@ def __init__(
self.last_update = last_update
self.priority = priority
self.source = source
self.obj_name = self.url.replace("/", "-")
self.config = self._init_config(url)

def _init_url(self, url: str) -> str:
Expand Down Expand Up @@ -209,6 +213,7 @@ def save(self) -> None:
RepoMeta.LAST_UPDATE: datetime_tostring(self.last_update),
RepoMeta.PRIORITY: self.priority,
RepoMeta.SOURCE: self.source,
RepoMeta.OBJ_NAME: self.obj_name,
}
if len(count) <= 0:
RepoMeta.DB.insert(obj)
Expand Down Expand Up @@ -247,6 +252,7 @@ def all() -> list:
last_update=datetime_fromstring(j[RepoMeta.LAST_UPDATE]),
priority=j[RepoMeta.PRIORITY],
source=j[RepoMeta.SOURCE],
obj_name=j[RepoMeta.OBJ_NAME],
)
for j in records
]
Expand All @@ -271,15 +277,19 @@ def clone(self) -> None:
)
else None
)
clone_cmd = (
f"git clone --depth=1 --single-branch --branch {specific_branch} {self.repo.github_url()} {self.path}"
if specific_branch
else f"git clone --depth=1 {self.repo.github_url()} {self.path}"
logging.debug(
f"{self.path} exist: {self.path.exists()}, isdir: {self.path.is_dir()}"
)
logging.debug(clone_cmd)
if self.path.exists() and self.path.is_dir():
shutil.rmtree(self.path)
os.system(clone_cmd)
logging.info(f"{self.path} already exist, skip...")
else:
clone_cmd = (
f"git clone --depth=1 --single-branch --branch {specific_branch} {self.repo.github_url()} {self.path}"
if specific_branch
else f"git clone --depth=1 {self.repo.github_url()} {self.path}"
)
logging.debug(clone_cmd)
os.system(clone_cmd)
except Exception as e:
logging.exception(
f"failed to git clone candidate:{self.repo.github_url()}", e
Expand Down Expand Up @@ -520,6 +530,13 @@ def build(self) -> None:
if not repo in deduped_repos:
repo.remove()

md = MdUtils(file_name="COLORSCHEMES", title="ColorSchemes List")
for repo in RepoMeta.all():
md.new_line(
"- " + md.new_inline_link(link=repo.github_url(), text=repo.url)
)
md.create_md_file()


@click.command()
@click.option(
Expand Down
166 changes: 165 additions & 1 deletion db.json
Original file line number Diff line number Diff line change
@@ -1 +1,165 @@
{"_default": {"3": {"url": "folke/tokyonight.nvim", "stars": 4300, "last_update": "2023-10-25T10:20:36", "priority": 100, "source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme"}, "5": {"url": "catppuccin/nvim", "stars": 3600, "last_update": "2023-11-17T01:01:25", "priority": 100, "source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme"}, "7": {"url": "rebelot/kanagawa.nvim", "stars": 2900, "last_update": "2023-10-02T11:02:49", "priority": 100, "source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme"}, "8": {"url": "nlknguyen/papercolor-theme", "stars": 2562, "last_update": "2022-06-08T19:55:49", "priority": 0, "source": "https://vimcolorschemes.com/top"}, "9": {"url": "nordtheme/vim", "stars": 2448, "last_update": "2023-05-03T20:43:25", "priority": 0, "source": "https://vimcolorschemes.com/top"}, "11": {"url": "sainnhe/everforest", "stars": 2200, "last_update": "2023-10-24T16:55:03", "priority": 100, "source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme"}, "12": {"url": "cocopon/iceberg.vim", "stars": 2072, "last_update": "2022-11-23T01:48:02", "priority": 0, "source": "https://vimcolorschemes.com/top"}, "13": {"url": "rakr/vim-one", "stars": 1969, "last_update": "2020-12-14T23:40:35", "priority": 0, "source": "https://vimcolorschemes.com/top"}, "15": {"url": "junegunn/seoul256.vim", "stars": 1605, "last_update": "2023-05-03T00:09:09", "priority": 0, "source": "https://vimcolorschemes.com/top"}, "17": {"url": "sainnhe/gruvbox-material", "stars": 1500, "last_update": "2023-10-24T15:47:32", "priority": 100, "source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme"}, "19": {"url": "rose-pine/neovim", "stars": 1400, "last_update": "2023-10-25T19:43:34", "priority": 100, "source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme"}, "20": {"url": "ku1ik/vim-monokai", "stars": 1422, "last_update": "2022-02-09T08:03:39", "priority": 0, "source": "https://vimcolorschemes.com/top"}, "21": {"url": "sainnhe/sonokai", "stars": 1300, "last_update": "2023-10-24T16:16:35", "priority": 100, "source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme"}, "22": {"url": "dracula/vim", "stars": 1300, "last_update": "2023-10-29T13:48:54", "priority": 100, "source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme"}, "24": {"url": "navarasu/onedark.nvim", "stars": 1200, "last_update": "2023-10-19T15:48:36", "priority": 100, "source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme"}, "25": {"url": "jacoborus/tender.vim", "stars": 1071, "last_update": "2021-05-24T15:38:00", "priority": 0, "source": "https://vimcolorschemes.com/top"}, "26": {"url": "lifepillar/vim-solarized8", "stars": 948, "last_update": "2023-08-13T09:40:20", "priority": 0, "source": "https://vimcolorschemes.com/top"}, "27": {"url": "mhartington/oceanic-next", "stars": 1100, "last_update": "2023-05-01T13:43:29", "priority": 100, "source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme"}, "37": {"url": "projekt0n/github-nvim-theme", "stars": 1800, "last_update": "2023-09-23T10:25:41", "priority": 100, "source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme"}, "48": {"url": "ellisonleao/gruvbox.nvim", "stars": 1300, "last_update": "2023-11-11T18:05:45", "priority": 100, "source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme"}}}
{
"_default": {
"3": {
"url": "folke/tokyonight.nvim",
"stars": 4300,
"last_update": "2023-10-25T18:20:36",
"priority": 100,
"source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme",
"obj_name": "folke-tokyonight.nvim"
},
"5": {
"url": "catppuccin/nvim",
"stars": 3600,
"last_update": "2023-11-17T09:01:25",
"priority": 100,
"source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme",
"obj_name": "catppuccin-nvim"
},
"7": {
"url": "rebelot/kanagawa.nvim",
"stars": 2900,
"last_update": "2023-10-02T19:02:49",
"priority": 100,
"source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme",
"obj_name": "rebelot-kanagawa.nvim"
},
"8": {
"url": "nlknguyen/papercolor-theme",
"stars": 2562,
"last_update": "2022-06-09T03:55:49",
"priority": 0,
"source": "https://vimcolorschemes.com/top",
"obj_name": "nlknguyen-papercolor-theme"
},
"9": {
"url": "nordtheme/vim",
"stars": 2449,
"last_update": "2023-05-04T04:43:25",
"priority": 0,
"source": "https://vimcolorschemes.com/top",
"obj_name": "nordtheme-vim"
},
"11": {
"url": "sainnhe/everforest",
"stars": 2200,
"last_update": "2023-10-25T00:55:03",
"priority": 100,
"source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme",
"obj_name": "sainnhe-everforest"
},
"12": {
"url": "cocopon/iceberg.vim",
"stars": 2075,
"last_update": "2022-11-23T09:48:02",
"priority": 0,
"source": "https://vimcolorschemes.com/top",
"obj_name": "cocopon-iceberg.vim"
},
"13": {
"url": "rakr/vim-one",
"stars": 1969,
"last_update": "2020-12-15T07:40:35",
"priority": 0,
"source": "https://vimcolorschemes.com/top",
"obj_name": "rakr-vim-one"
},
"15": {
"url": "junegunn/seoul256.vim",
"stars": 1604,
"last_update": "2023-05-03T08:09:09",
"priority": 0,
"source": "https://vimcolorschemes.com/top",
"obj_name": "junegunn-seoul256.vim"
},
"17": {
"url": "sainnhe/gruvbox-material",
"stars": 1500,
"last_update": "2023-10-24T23:47:32",
"priority": 100,
"source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme",
"obj_name": "sainnhe-gruvbox-material"
},
"19": {
"url": "rose-pine/neovim",
"stars": 1400,
"last_update": "2023-10-26T03:43:34",
"priority": 100,
"source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme",
"obj_name": "rose-pine-neovim"
},
"20": {
"url": "ku1ik/vim-monokai",
"stars": 1422,
"last_update": "2022-02-09T16:03:39",
"priority": 0,
"source": "https://vimcolorschemes.com/top",
"obj_name": "ku1ik-vim-monokai"
},
"21": {
"url": "sainnhe/sonokai",
"stars": 1300,
"last_update": "2023-10-25T00:16:35",
"priority": 100,
"source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme",
"obj_name": "sainnhe-sonokai"
},
"22": {
"url": "dracula/vim",
"stars": 1300,
"last_update": "2023-10-29T21:48:54",
"priority": 100,
"source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme",
"obj_name": "dracula-vim"
},
"24": {
"url": "navarasu/onedark.nvim",
"stars": 1200,
"last_update": "2023-10-19T23:48:36",
"priority": 100,
"source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme",
"obj_name": "navarasu-onedark.nvim"
},
"25": {
"url": "jacoborus/tender.vim",
"stars": 1071,
"last_update": "2021-05-24T23:38:00",
"priority": 0,
"source": "https://vimcolorschemes.com/top",
"obj_name": "jacoborus-tender.vim"
},
"26": {
"url": "lifepillar/vim-solarized8",
"stars": 948,
"last_update": "2023-08-13T17:40:20",
"priority": 0,
"source": "https://vimcolorschemes.com/top",
"obj_name": "lifepillar-vim-solarized8"
},
"27": {
"url": "mhartington/oceanic-next",
"stars": 1100,
"last_update": "2023-05-01T21:43:29",
"priority": 100,
"source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme",
"obj_name": "mhartington-oceanic-next"
},
"37": {
"url": "projekt0n/github-nvim-theme",
"stars": 1800,
"last_update": "2023-09-23T18:25:41",
"priority": 100,
"source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme",
"obj_name": "projekt0n-github-nvim-theme"
},
"48": {
"url": "ellisonleao/gruvbox.nvim",
"stars": 1300,
"last_update": "2023-11-12T02:05:45",
"priority": 100,
"source": "https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme",
"obj_name": "ellisonleao-gruvbox.nvim"
}
}
}

Loading

0 comments on commit 0e7a564

Please sign in to comment.