diff --git a/lib/routes/bbc/index.ts b/lib/routes/bbc/index.ts index 49d55e4e5..7bc8f90b5 100644 --- a/lib/routes/bbc/index.ts +++ b/lib/routes/bbc/index.ts @@ -17,11 +17,9 @@ export const route: Route = { categories: ['traditional-media'], description: `Provides a better reading experience (full text articles) over the official ones. -\`\`\` Support major channels, refer to [BBC RSS feeds](https://www.bbc.co.uk/news/10628494). Eg, \`business\` for \`https://feeds.bbci.co.uk/news/business/rss.xml\`. -- Channel contains sub-directories, such as \`https://feeds.bbci.co.uk/news/world/asia/rss.xml\`, replace \`/\` with \`-\`, \`/bbc/world-asia\`. -\`\`\``, +- Channel contains sub-directories, such as \`https://feeds.bbci.co.uk/news/world/asia/rss.xml\`, replace \`/\` with \`-\`, \`/bbc/world-asia\`.`, }; async function handler(ctx) { diff --git a/lib/routes/castbox/channel.ts b/lib/routes/castbox/channel.ts index cad4df503..cfda05902 100644 --- a/lib/routes/castbox/channel.ts +++ b/lib/routes/castbox/channel.ts @@ -46,9 +46,7 @@ export const route: Route = { name: 'Channels', description: `Get the channel from the Castbox channel URL. For example, the URL of the channel "Lemonade Stand" is \`https://castbox.fm/channel/Lemonade-Stand-id6776228\`, where \`Lemonade-Stand-id6776228\` is the \`channel\` parameter. -\`\`\` -You can use the RSSHub global \`limit\` query parameter to specify the maximum number of episodes to fetch from the Castbox API (defaults to 50). For example: \`/castbox/channel/Lemonade-Stand-id6776228?limit=100\`. -\`\`\``, +You can use the RSSHub global \`limit\` query parameter to specify the maximum number of episodes to fetch from the Castbox API (defaults to 50). For example: \`/castbox/channel/Lemonade-Stand-id6776228?limit=100\`.`, maintainers: ['ananyatimalsina'], handler: async (ctx) => { const { channel } = ctx.req.param(); diff --git a/lib/routes/chinamoney/notice.ts b/lib/routes/chinamoney/notice.ts index 161ea24a8..df8c23369 100644 --- a/lib/routes/chinamoney/notice.ts +++ b/lib/routes/chinamoney/notice.ts @@ -27,25 +27,19 @@ export const route: Route = { description: `
市场公告 -\`\`\` 外汇市场公告 -\`\`\` | 最新 | 市场公告通知 | 中心会员公告 | 会员信息公告 | | ---- | ------------ | ------------ | ------------ | | 2834 | 2835 | 2836 | 2837 | -\`\`\` 本币市场公告 -\`\`\` | 最新 | 市场公告通知 | 中心会员公告 | 会员信息公告 | | -------------- | ------------ | ------------ | ------------ | | 2839,2840,2841 | 2839 | 2840 | 2841 | -\`\`\` 央行业务公告 -\`\`\` | 最新 | 公开市场操作 | 中央国库现金管理 | | --------- | ------------ | ---------------- | @@ -56,9 +50,7 @@ export const route: Route = {
本币市场 -\`\`\` 贷款市场报价利率 -\`\`\` | LPR 市场公告 | | ------------ | diff --git a/lib/routes/deadbydaylight/namespace.ts b/lib/routes/deadbydaylight/namespace.ts index 717616252..8e89112b7 100644 --- a/lib/routes/deadbydaylight/namespace.ts +++ b/lib/routes/deadbydaylight/namespace.ts @@ -3,9 +3,7 @@ import type { Namespace } from '@/types'; export const namespace: Namespace = { name: 'DeadbyDaylight', url: 'deadbydaylight.com', - description: `\`\`\` - DeadbyDaylight Official -\`\`\``, + description: 'DeadbyDaylight Official', zh: { name: '黎明杀机', }, diff --git a/lib/routes/indienova/column.ts b/lib/routes/indienova/column.ts index b1121480e..1468be0fb 100644 --- a/lib/routes/indienova/column.ts +++ b/lib/routes/indienova/column.ts @@ -30,49 +30,37 @@ export const route: Route = { description: `
专题 ID -\`\`\` 游戏推荐 -\`\`\` | itch 一周游戏汇 | 一周值得关注的发售作品 | 诺娃速递 | 周末游戏视频集锦 | 每月媒体评分 | 年度最佳游戏 | Indie Focus 近期新游 | indienova Picks 精选 | | --------------- | ---------------------- | -------- | ---------------- | ------------ | ------------ | -------------------- | -------------------- | | 52 | 29 | 41 | 43 | 45 | 39 | 1 | 8 | -\`\`\` 游戏评论 -\`\`\` | 游必有方 Podcast | 独立游戏潮(RED) | | ---------------- | ----------------- | | 6 | 3 | -\`\`\` 游戏开发 -\`\`\` | 游戏设计模式 | Roguelike 开发 | GMS 中文教程 | | ------------ | -------------- | ------------ | | 15 | 14 | 7 | -\`\`\` 游戏设计 -\`\`\` | 游戏与所有 | 让人眼前一亮的游戏设计 | 游戏音乐分析 | 游戏情感设计 | 游戏相关书籍 | 游戏设计课程笔记 | 游戏设计工具 | 游戏设计灵感 | 设计师谈设计 | 游戏研究方法 | 功能游戏 | 游戏设计专业院校 | 像素课堂 | | ---------- | ---------------------- | ------------ | ------------ | ------------ | ---------------- | ------------ | ------------ | ------------ | ------------ | -------- | ---------------- | -------- | | 10 | 33 | 17 | 4 | 22 | 11 | 24 | 26 | 27 | 28 | 38 | 9 | 19 | -\`\`\` 游戏文化 -\`\`\` | NOVA 海外独立游戏见闻 | 工作室访谈 | indie Figure 游戏人 | 游戏艺术家 | 独立游戏音乐欣赏 | 游戏瑰宝 | 电脑 RPG 游戏史 | ALT. CTRL. GAMING | | --------------------- | ---------- | ------------------- | ---------- | ---------------- | -------- | --------------- | ----------------- | | 53 | 23 | 5 | 44 | 18 | 21 | 16 | 2 | -\`\`\` Game Jam -\`\`\` | Ludum Dare | Global Game Jam | | ---------- | --------------- | diff --git a/lib/routes/zcool/user.ts b/lib/routes/zcool/user.ts index 9ee2bbf6b..e96e6f7d4 100644 --- a/lib/routes/zcool/user.ts +++ b/lib/routes/zcool/user.ts @@ -33,11 +33,9 @@ export const route: Route = { name: '用户作品', description: `例如: -\`\`\` 站酷的个人主页 \`https://baiyong.zcool.com.cn\` 对应 rss 路径 \`/zcool/user/baiyong\` -站酷的个人主页 \`https://www.zcool.com.cn/u/568339\` 对应 rss 路径 \`/zcool/user/568339\` -\`\`\``, +站酷的个人主页 \`https://www.zcool.com.cn/u/568339\` 对应 rss 路径 \`/zcool/user/568339\``, maintainers: ['junbaor'], handler, }; diff --git a/package.json b/package.json index 2e01b9f5a..588ea52f1 100644 --- a/package.json +++ b/package.json @@ -213,6 +213,7 @@ "oxfmt --no-error-on-unmatched-pattern" ], "*.{ts,tsx,js,cjs,mjs}": [ + "tsx scripts/workflow/format-description.ts", "oxlint --type-aware --fix", "eslint --cache --fix --concurrency auto", "oxfmt --no-error-on-unmatched-pattern" diff --git a/scripts/workflow/format-description.ts b/scripts/workflow/format-description.ts index d1634ddd9..a382aa186 100644 --- a/scripts/workflow/format-description.ts +++ b/scripts/workflow/format-description.ts @@ -267,10 +267,23 @@ async function processFile(filePath: string): Promise { } } +function isRouteFile(filePath: string): boolean { + const abs = path.resolve(filePath); + if (!abs.startsWith(routesDir + path.sep)) { + return false; + } + const base = path.basename(abs); + return /\.tsx?$/.test(base) && !base.endsWith('.d.ts'); +} + async function main() { const started = performance.now(); - // @ts-ignore ts(2550) - const files: string[] = await Array.fromAsync(walk(routesDir)); + const args = process.argv.slice(2); + const files: string[] = + args.length > 0 + ? args.map((f) => path.resolve(f)).filter((f) => isRouteFile(f)) + : // @ts-ignore ts(2550) + await Array.fromAsync(walk(routesDir)); await Promise.all(files.map((f) => processFile(f)));