在您的 NuGet 套件中包含自述檔,以便讓套件的細節更豐富且資訊更充實,提升用戶對此的理解!
這可能是使用者在 NuGet.org 上檢視您的套件詳細數據頁面時會看到的第一個元素之一,對於給人留下良好的印象至關重要!
這很重要
NuGet.org 僅支援 Markdown 中的自述檔,以及來自一組有限網域的影像。 請參閱我們的 允許的影像網域 和 支援的 Markdown 功能,以確保您的 README 檔案能在 NuGet.org 上正確呈現。
我的說明文件應該包含哪些內容?
請考慮在自述檔中包含下列項目:
- 您的套件是什麼和用途的簡介 - 其可解決哪些問題?
- 如何開始使用您的套件 - 是否有任何特定需求?
- 如果自述檔本身未包含的話,這是指向更完整文件的連結。
- 至少幾個代碼段/範例或範例影像。
- 何處及如何留下意見反應,例如項目問題、Twitter、Bug 追蹤器或其他平台的連結。
- 如果適用,如何參與。
例如,您可以從此套件自述檔範本開始:
# Package readme title, e.g., display name or title of the package (optional)
Start with a clear and concise description: A brief overview of what your package is and does, also what problem it solves.
## Getting started
Explain how to use your package, provide clear and concise getting started instructions, including any necessary steps.
### Prerequisites
What are specific minimum requirements to use your packages? Consider excluding this section if your package works without any additional setup beyond simple package installation.
## Usage
Examples about how to use your package by providing code snippets/example images, or samples links on GitHub if applicable.
- Provide sample code using code snippets
- Include screenshots, diagrams, or other visual help users better understand how to use your package
## Additional documentation
Provide links to more resources: List links such as detailed documentation, tutorial videos, blog posts, or any other relevant documentation to help users get the most out of your package.
## Feedback
Where and how users can leave feedback?
- Links to a GitHub repository where could open issues, Twitter, a Discord channel, bug tracker, or other platforms where a package consumer can connect with the package author.
請記住,高品質的自述文字可以採用各種不同的格式、形狀和大小! 如果您已在 NuGet.org 上提供套件,您可能已在存放庫中有 readme.md 或其他文件,這將是 NuGet.org 詳細資料頁面的絕佳附加資訊。
備註
閱讀我們的 部落格,以了解撰寫高品質自述檔的一些最佳做法 。
預覽 README 檔案
若要在 NuGet.org 上線之前預覽自述檔,請在 NuGet.org 上使用 上傳套件入口網站上傳您的套件 ,然後向下捲動至元數據預覽的「自述檔」區段。 其外觀應該如下所示:
請考慮花時間檢閱及預覽您的自述檔,以檢查影像合規性和支援的格式,以便於給潛在使用者帶來絕佳的第一印象! 若要修正套件自述檔發佈到 NuGet.org 之後的錯誤,您需要提交一個包含修正的更新版本。 提前確認一切是否正常,可以避免日後的麻煩。
圖像和徽章的允許網域
由於安全和隱私的考量,NuGet.org 會限制影像和徽章只能在信任的主機上呈現。
NuGet.org 允許轉譯來自下列受信任網域的所有影像,包括徽章:
- api.codacy.com
- api.codeclimate.com
- api.dependabot.com
- api.reuse.software
- api.travis-ci.com
- app.codacy.com
- app.deepsource.com
- avatars.githubusercontent.com
- badgen.net
- badges.gitter.im
- camo.githubusercontent.com
- caniuse.bitsofco.de
- cdn.jsdelivr.net
- cdn.syncfusion.com
- ci.appveyor.com
- circleci.com
- cloudback.it
- codecov.io
- codefactor.io
- coveralls.io
- dev.azure.com
- flat.badgen.net
- github.com/.../workflows/.../badge.svg
- gitlab.com
- i.imgur.com
- img.shields.io
- infragistics.com
- isitmaintained.com
- media.githubusercontent.com
- opencollective.com
- raw.github.com
- raw.githubusercontent.com
- snyk.io
- sonarcloud.io
- travis-ci.com
- travis-ci.org
- user-images.githubusercontent.com
如果您覺得另一個網域應該新增至允許清單,請放心 提出問題 ,且我們的工程小組將會檢閱其隱私權和安全性合規性。 不會呈現具有相對本機路徑的影像及來自不支援網域的影像,並且會在 README 檔案預覽和套件詳細資料頁面上產生警告,此警告僅對套件擁有者可見。
支援的 Markdown 功能
Markdown 是採用純文字格式語法的輕量型標記語言。 NuGet.org readmes 透過 Markdig 解析引擎支援 CommonMark 相容 Markdown。
NuGet.org 目前支援下列 Markdown 功能:
我們也支援語法醒目提示,您可以新增語言標識符,以啟用程式代碼範圍中的語法醒目提示。