Script to fetch a doc's icon from its website
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 32/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- nodejs
調査の方向性
Start with the PR template and the existing public/icons/docs/<slug>/ layout to see the three files the script must write (16.png, [email protected], SOURCE), then find where npm scripts and the Node tests and type check are configured. The work covers HTML icon-tag discovery, PNG and ICO parsing, and alpha-aware downscaling, so read the draft PR #2781 before writing anything. Done means the script works for the three example sites and the tests pass, but the maintainer has not yet confirmed the approach.
索引モデルが issue の本文から書いたものです。
説明
Feature request
Summary
A small script that fetches a doc's icon from the documented project's website and saves it the way DevDocs expects:
npm run icon -- <doc_slug> <website>
It writes public/icons/docs/<slug>/16.png, [email protected] and SOURCE, the three files the PR template asks for.
Today, each new doc's icon is found, resized to 16 and 32 pixels and saved by hand. The script does that step for contributors and keeps the SOURCE file accurate. It also helps when updating a doc whose icon has changed.
How it works:
- It looks for the icon in the page's
<link rel="icon">and<link rel="apple-touch-icon">tags, trying the smallest one that is at least 32 pixels first. If none works, it tries/apple-touch-icon.pngand/favicon.ico. - It reads PNG files and ICO files, including ICO files that contain bitmaps rather than PNGs.
- It scales the icon by averaging pixels with premultiplied alpha, so 16-pixel icons stay crisp and transparent edges don't darken.
- It uses only Node's standard library, so there are no new dependencies. It sits beside the existing Node tests and type check.
- SVG-only icons can't be converted without a dependency, so the script says so.
--icon <image address>then uses a specific PNG or ICO instead.
Contributors should still check the result at 16 pixels, as they do today. The script only automates finding, resizing and recording the source.
I've prepared an implementation with tests in draft PR #2781. Would you be open to this? I'm happy to change the approach, for example to a thor task.
Examples
Tried on real sites:
npm run icon -- python https://www.python.orgsaves the icon from/static/apple-touch-icon-precomposed.png.npm run icon -- github https://docs.github.comsaves the icon from/assets/cb-345/images/site/favicon.png.npm run icon -- vue https://vuejs.orgexplains that the site only offerslogo.svg, and suggests--icon.
- 主要言語
- Ruby
- スター
- 39.6k
- フォーク
- 2.7k
- 平均マージ
- 21時間 1分
- マージ済み PR(30日)
- 21
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
freeCodeCamp/devdocs のほかの issue
-
docs/improvement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
freeCodeCamp/devdocs#1989 · コメント 4 件 · リアクション 4 件 ·
メンテナーはふだん 1 日以内に返信
-
sidebarオープンfeature
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
freeCodeCamp/devdocs#2776 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 8/100
freeCodeCamp/devdocs#2746 ·
メンテナーはふだん 1 日以内に返信
-
docs/update
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
freeCodeCamp/devdocs#2744 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
feature
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
freeCodeCamp/devdocs#2683 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
freeCodeCamp/devdocs の issue をすべて見る
似ている issue
-
resource: surah-info
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
TarteelAI/quranic-universal-library#996 ·
メンテナーはふだん 1 日以内に返信
-
Missing ar translation: components/common/CommunitySolution.tsx:communitySolution.authorsSolutionオープン
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
swombat/souls-house#770 ·
メンテナーはふだん 1 日以内に返信
-
some_triage_time crashes with Fbe::Error on inaccessible repository because repo_id_by_name wraps NotFound and Forbidden対応中かも @opusstudiohq-max が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
zerocracy/judges-action#3100 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
riverqueue/river#1576 ·
メンテナーはふだん 1 日以内に返信