From f920a563b74c211dab1e344f4f44bdddb938d673 Mon Sep 17 00:00:00 2001 From: yktsnet Date: Thu, 15 Oct 2026 13:15:31 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=83=88=E3=83=83=E3=83=97=E3=81=AE?= =?UTF-8?q?=E5=B7=A6=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC=E3=81=A7=E3=80=81?= =?UTF-8?q?=E3=82=B0=E3=83=AB=E3=83=BC=E3=83=97=E3=81=AE=E4=B8=AD=E3=81=AE?= =?UTF-8?q?=E3=83=AA=E3=83=9D=E3=82=92=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E6=95=B0=E3=81=AE=E5=A4=9A=E3=81=84=E9=A0=86=E3=81=AB=E4=B8=A6?= =?UTF-8?q?=E3=81=B9=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit グループの中はディレクトリ名の順に並んでいた。大きいリポほど開く機会が多いので、ファイル数の多い順にする。同数なら名前順。グループの順は今までどおり設定の順。 --- README.en.md | 2 +- README.md | 2 +- codeview/layout.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.en.md b/README.en.md index 2b12f28..9a33f68 100644 --- a/README.en.md +++ b/README.en.md @@ -59,7 +59,7 @@ The config is TOML, read from the `CODEVIEW_CONFIG` environment variable, or `co | Section | Meaning | |---|---| -| `[[roots]]` | Where to scan. A `group`, plus exactly one of `path` (that directory is one repository) or `children` (every git repository directly under it). The order is the order of the left menu on the top page | +| `[[roots]]` | Where to scan. A `group`, plus exactly one of `path` (that directory is one repository) or `children` (every git repository directly under it). The order is the order of the groups in the left menu on the top page. Within a group, repositories with more files come first | | `[scan]` | `skip_dirs` (directory names not to scan), `exclude_prefixes` (path prefixes not to output), `skip_exts` (extensions not to output). To add exclusions for one repository, put `skip_exts` and `exclude_prefixes` in `[scan.repos.""]` (added to the global values; the slug is the repository's path in the output) | | `[[accounts]]` | The unit issues are grouped by; 1 or 2 of them. `name`, `hosts` (hosts of the `origin` remote), `groups` (the fallback when there is no remote), `issues` (the default `github`, or the module name of an extension that returns issues), `gh_config_dir` (the gh config dir used when `issues = "github"`) | | `[publish]` | The `remote` (default `origin`) and `branch` (default `deploy`) to publish to | diff --git a/README.md b/README.md index 99811c8..492e81a 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ codeview serve # http://localhost:8787 で確認する | 節 | 意味 | |---|---| -| `[[roots]]` | 走査する置き場。`group` と、`path`(そのディレクトリが1つのリポ)か `children`(直下の git リポすべて)のどちらか一方。並び順がトップの左メニューの順になる | +| `[[roots]]` | 走査する置き場。`group` と、`path`(そのディレクトリが1つのリポ)か `children`(直下の git リポすべて)のどちらか一方。並び順がトップの左メニューのグループの順になる。グループの中は、ファイル数の多いリポから並ぶ | | `[scan]` | `skip_dirs`(走査しないディレクトリ名)・`exclude_prefixes`(出力しないパスの接頭辞)・`skip_exts`(出力しない拡張子)。リポごとに足すときは `[scan.repos.""]` に `skip_exts` と `exclude_prefixes` を書く(全体の値に足される。slug はページのパスと同じ) | | `[[accounts]]` | Issue をまとめる単位で、1〜2個。`name`・`hosts`(`origin` の remote のホスト)・`groups`(remote が無いときの決め手)・`issues`(既定の `github` か、Issue を返す拡張のモジュール名)・`gh_config_dir`(`issues = "github"` のときに使う gh の config dir) | | `[publish]` | 配信先の `remote`(既定 `origin`)と `branch`(既定 `deploy`) | diff --git a/codeview/layout.py b/codeview/layout.py index 274cdcd..d80e9f1 100644 --- a/codeview/layout.py +++ b/codeview/layout.py @@ -282,7 +282,7 @@ def index_side(counts, board, extra: str = "") -> str: f'' f'{html.escape(name)}' f'{n:,}' - for slug, name, n in items + for slug, name, n in sorted(items, key=lambda it: (-it[2], it[1].lower())) ) blocks.append(f'

{html.escape(group)}

{rows}') return side_head("") + '
' + "".join(blocks) + "
"