2016-08-26 06:40:14 +00:00
# Specification
2016-07-07 15:24:29 +00:00
2016-08-26 06:40:14 +00:00
A compliant README must satisfy all the requirements listed below.
2016-07-07 15:24:29 +00:00
2019-02-21 14:46:56 +00:00
> Note: Standard Readme is designed for open source libraries. Although it's [historically](README.md#background) made for Node and npm projects, it also applies to libraries in other languages and package managers.
2017-11-15 00:11:31 +00:00
2016-08-26 06:40:14 +00:00
**Requirements:**
2016-07-07 15:24:29 +00:00
- Be called README.md (with capitalization).
2019-02-21 14:45:30 +00:00
- If the project supports i18n, the file must be named accordingly: `README.de.md` , where `de` is the BCP 47 Language tag. For naming, prioritize non-regional subtags for languages. If there is only one README and the language is not English, then a different language in the text is permissible without needing to to specify the BCP tag: e.g., `README.md` can be in German if there is no `README.md` in another language. Where there are multiple languages, `README.md` is reserved for English.
2016-07-07 15:24:29 +00:00
- Be a valid Markdown file.
2016-08-26 06:40:14 +00:00
- Sections must appear in order given below. Optional sections may be omitted.
2018-08-20 14:37:42 +00:00
- Sections must have the titles listed below, unless otherwise specified. If the README is in another language, the titles must be translated into that language.
2017-05-08 12:52:53 +00:00
- Must not contain broken links.
- If there are code examples, they should be linted in the same way as the code is linted in the rest of the project.
2016-07-07 15:24:29 +00:00
2016-10-19 20:38:09 +00:00
## Table of Contents
_Note: This is only a navigation guide for the specification, and does not define or mandate terms for any specification-compliant documents._
- [Sections ](#sections )
- [Title ](#title )
- [Banner ](#banner )
- [Badges ](#badges )
- [Short Description ](#short-description )
- [Long Description ](#long-description )
2016-12-22 23:05:55 +00:00
- [Table of Contents ](#table-of-contents-1 )
2016-10-19 20:38:09 +00:00
- [Security ](#security )
- [Background ](#background )
- [Install ](#install )
- [Usage ](#usage )
- [Extra Sections ](#extra-sections )
- [API ](#api )
2017-11-15 00:40:27 +00:00
- [Maintainers ](#maintainers )
2019-06-24 16:57:33 +00:00
- [Thanks ](#thanks )
2018-10-24 13:55:01 +00:00
- [Contributing ](#contributing )
2016-10-19 20:38:09 +00:00
- [License ](#license )
2017-11-14 19:47:02 +00:00
- [Definitions ](#definitions )
2016-10-19 20:38:09 +00:00
2016-08-26 06:40:14 +00:00
## Sections
2016-07-07 15:24:29 +00:00
2016-08-26 06:40:14 +00:00
### Title
**Status:** Required.
2016-08-30 02:16:42 +00:00
2016-07-07 15:24:29 +00:00
**Requirements:**
2016-10-19 20:36:49 +00:00
- Title must match repository, folder and package manager names - or it may have another, relevant title with the repository, folder, and package manager title next to it in italics and in parentheses. For instance:
```markdown
# Standard Readme Style _(standard-readme)_
```
If any of the folder, repository, or package manager names do not match, there must be a note in the [Long Description ](#long-description ) explaining why.
2016-07-07 15:24:29 +00:00
**Suggestions:**
- Should be self-evident.
2016-08-26 06:40:14 +00:00
### Banner
**Status:** Optional.
2016-08-30 02:16:42 +00:00
2016-07-07 15:24:29 +00:00
**Requirements:**
2017-11-14 20:18:55 +00:00
- Must not have its own title.
2016-07-07 15:24:29 +00:00
- Must link to local image in current repository.
- Must appear directly after the title.
2016-08-26 06:40:14 +00:00
### Badges
**Status:** Optional.
2016-08-30 02:16:42 +00:00
2016-07-07 15:24:29 +00:00
**Requirements:**
2017-11-14 20:18:55 +00:00
- Must not have its own title.
2016-07-07 15:24:29 +00:00
- Must be newline delimited.
2016-08-26 06:40:14 +00:00
**Suggestions:**
- Use http://shields.io or a similar service to create and host the images.
2019-08-07 15:58:12 +00:00
- Add the [Standard Readme badge ](https://github.com/RichardLitt/standard-readme#badge ).
2016-08-26 06:40:14 +00:00
### Short Description
**Status:** Required.
2016-08-30 02:16:42 +00:00
2016-07-07 15:24:29 +00:00
**Requirements:**
2017-11-14 20:18:55 +00:00
- Must not have its own title.
2016-07-07 15:24:29 +00:00
- Must be less than 120 characters.
2019-12-10 15:12:43 +00:00
- Must not start with `> `
2017-05-12 13:10:00 +00:00
- Must be on its own line.
2016-08-26 06:40:14 +00:00
- Must match the description in the packager manager's `description` field.
2016-07-07 15:24:29 +00:00
- Must match GitHub's description (if on GitHub).
**Suggestions:**
- Use [gh-description ](https://github.com/RichardLitt/gh-description ) to set and get GitHub description.
- Use `npm show . description` to show the description from a local [npm ](https://npmjs.com ) package.
2016-08-26 06:40:14 +00:00
### Long Description
**Status:** Optional.
2016-08-30 02:16:42 +00:00
2016-07-07 15:24:29 +00:00
**Requirements:**
2017-11-14 20:18:55 +00:00
- Must not have its own title.
2016-10-19 20:36:49 +00:00
- If any of the folder, repository, or package manager names do not match, there must be a note here as to why. See [Title section ](#title ).
2016-07-07 15:24:29 +00:00
**Suggestions:**
- If too long, consider moving to the [Background ](#background ) section.
- Cover the main reasons for building the repository.
- "This should describe your module in broad terms,
generally in just a few paragraphs; more detail of the module's
routines or methods, lengthy code examples, or other in-depth
material should be given in subsequent sections.
Ideally, someone who's slightly familiar with your module should be
able to refresh their memory without hitting "page down". As your
reader continues through the document, they should receive a
progressively greater amount of knowledge."
~ [Kirrily "Skud" Robert, perlmodstyle ](http://perldoc.perl.org/perlmodstyle.html )
2016-08-26 06:40:14 +00:00
### Table of Contents
2017-05-12 13:10:00 +00:00
**Status:** Required; optional for READMEs shorter than 100 lines.
2016-08-30 02:16:42 +00:00
2016-07-07 15:24:29 +00:00
**Requirements:**
- Must link to all Markdown sections in the file.
- Must start with the next section; do not include the title or Table of Contents headings.
- Must be at least one-depth: must capture all `##` headings.
**Suggestions:**
- May capture third and fourth depth headings. If it is a long ToC, these are optional.
2016-08-26 06:40:14 +00:00
### Security
**Status**: Optional.
2016-08-30 02:16:42 +00:00
2016-07-07 15:24:29 +00:00
**Requirements:**
2016-08-26 06:40:14 +00:00
- May go here if it is important to highlight security concerns. Otherwise, it should be in [Extra Sections ](#extra-sections ).
2016-07-07 15:24:29 +00:00
2016-08-26 06:40:14 +00:00
### Background
**Status:** Optional.
2016-08-30 02:16:42 +00:00
2016-07-07 15:24:29 +00:00
**Requirements:**
- Cover motivation.
- Cover abstract dependencies.
2016-08-30 12:54:54 +00:00
- Cover intellectual provenance: A `See Also` section is also fitting.
2016-07-07 15:24:29 +00:00
2016-08-26 06:40:14 +00:00
### Install
2017-11-14 19:47:02 +00:00
**Status:** Required by default, optional for [documentation repositories ](#definitions ).
2016-08-30 02:16:42 +00:00
2016-07-07 15:24:29 +00:00
**Requirements:**
- Code block illustrating how to install.
2016-08-26 06:40:14 +00:00
**Subsections:**
2016-08-30 02:46:32 +00:00
- `Dependencies` . Required if there are unusual dependencies or dependencies that must be manually installed.
2016-07-07 15:24:29 +00:00
**Suggestions:**
2016-08-26 06:40:14 +00:00
- Link to prerequisite sites for programming language: [npmjs ](https://npmjs.com ), [godocs ](https://godoc.org ), etc.
- Include any system-specific information needed for installation.
2017-11-14 20:13:51 +00:00
- An `Updating` section would be useful for most packages, if there are multiple versions which the user may interface with.
2016-07-07 15:24:29 +00:00
2016-08-26 06:40:14 +00:00
### Usage
2017-11-14 19:47:02 +00:00
**Status:** Required by default, optional for [documentation repositories ](#definitions ).
2016-08-30 02:16:42 +00:00
2016-07-07 15:24:29 +00:00
**Requirements:**
- Code block illustrating common usage.
- If CLI compatible, code block indicating common usage.
2016-08-26 06:40:14 +00:00
- If importable, code block indicating both import functionality and usage.
2016-07-07 15:24:29 +00:00
2016-08-26 06:40:14 +00:00
**Subsections:**
2016-07-07 15:24:29 +00:00
- `CLI` . Required if CLI functionality exists.
**Suggestions:**
- Cover basic choices that may affect usage: for instance, if JavaScript, cover promises/callbacks, ES6 here.
2016-08-26 06:40:14 +00:00
- If relevant, point to a runnable file for the usage code.
2016-07-07 15:24:29 +00:00
2016-08-26 06:40:14 +00:00
### Extra Sections
**Status**: Optional.
2016-08-30 02:16:42 +00:00
2016-07-07 15:24:29 +00:00
**Requirements:**
- None.
2016-08-26 06:40:14 +00:00
**Suggestions:**
2017-11-14 20:46:56 +00:00
- This should not be called `Extra Sections` . This is a space for 0 or more sections to be included, each of which must have their have titles.
2016-08-30 02:46:32 +00:00
- This should contain any other sections that are relevant, placed after [Usage ](#usage ) and before [API ](#api ).
2016-08-30 12:54:54 +00:00
- Specifically, the [Security ](#security ) section should be here if it wasn't important enough to be placed above.
2016-08-26 06:40:14 +00:00
### API
**Status:** Optional.
2016-08-30 02:16:42 +00:00
2016-07-07 15:24:29 +00:00
**Requirements:**
- Describe exported functions and objects.
**Suggestions:**
- Describe signatures, return types, callbacks, and events.
- Cover types covered where not obvious.
- Describe caveats.
- If using an external API generator (like go-doc, js-doc, or so on), point to an external `API.md` file. This can be the only item in the section, if present.
2016-10-19 17:53:00 +00:00
### Maintainer(s)
2017-11-15 00:41:00 +00:00
**Status**: Optional.
2016-10-19 17:53:00 +00:00
**Requirements:**
- Must be called `Maintainer` or `Maintainers` .
- List maintainer(s) for a repository, along with one way of contacting them (e.g. GitHub link or email).
**Suggestions:**
2017-05-12 13:10:00 +00:00
- This should be a small list of people in charge of the repo. This should not be everyone with access rights, such as an entire organization, but the people who should be pinged and who are in charge of the direction and maintenance of the repository.
2016-10-19 17:53:00 +00:00
- Listing past maintainers is good for attribution, and kind.
2019-06-24 16:57:33 +00:00
### Thanks
**Status**: Optional.
**Requirements:**
- Must be called `Thanks` , `Credits` or `Acknowledgements` .
**Suggestions:**
- State anyone or anything that significantly helped with the development of your project.
- State public contact hyper-links if applicable.
2018-10-24 13:55:01 +00:00
### Contributing
2016-08-26 06:40:14 +00:00
**Status**: Required.
2016-08-30 02:16:42 +00:00
2016-07-07 15:24:29 +00:00
**Requirements:**
- State where users can ask questions.
- State whether PRs are accepted.
- List any requirements for contributing; for instance, having a sign-off on commits.
**Suggestions:**
2018-10-24 13:55:01 +00:00
- Link to a CONTRIBUTING file -- if there is one.
2016-07-07 15:24:29 +00:00
- Be as friendly as possible.
- Link to the GitHub issues.
2018-10-24 13:55:01 +00:00
- Link to a Code of Conduct. A CoC is often in the Contributing section or document, or set elsewhere for an entire organization, so it may not be necessary to include the entire file in each repository. However, it is highly recommended to always link to the code, wherever it lives.
2016-10-19 17:53:00 +00:00
- A subsection for listing contributors is also welcome here.
2016-07-07 15:24:29 +00:00
2016-08-26 06:40:14 +00:00
### License
**Status:** Required.
2016-08-30 02:16:42 +00:00
2016-07-07 15:24:29 +00:00
**Requirements:**
2017-11-14 19:41:27 +00:00
- State license full name or identifier, as listed on the [SPDX ](https://spdx.org/licenses/ ) license list. For unlicensed repositories, add `UNLICENSED` . For more details, add `SEE LICENSE IN <filename>` and link to the license file. (These requirements were adapted from [npm ](https://docs.npmjs.com/files/package.json#license )).
2016-07-07 15:24:29 +00:00
- State license owner.
- Must be last section.
**Suggestions:**
- Link to longer License file in local repository.
2017-11-14 19:47:02 +00:00
## Definitions
_These definitions are provided to clarify any terms used above._
- **Documentation repositories**: Repositories without any functional code. For instance, [RichardLitt/knowledge ](https://github.com/RichardLitt/knowledge ).