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
2016-08-26 06:40:14 +00:00
**Requirements:**
2016-07-07 15:24:29 +00:00
- Be called README.md (with capitalization).
- 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.
- Sections must have the titles listed below, unless otherwise specified.
2016-07-07 15:24:29 +00:00
- Must be new lines between each section.
2016-09-27 03:04:18 +00:00
- Must not contain broken links
2016-07-07 15:24:29 +00:00
**Suggestions:**
- A "Back to Top" link for longer sections can be useful, but is not required by any means.
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 )
- [Table of Contents ](#table-of-contents )
- [Security ](#security )
- [Background ](#background )
- [Install ](#install )
- [Usage ](#usage )
- [Extra Sections ](#extra-sections )
- [API ](#api )
- [Contribute ](#contribute )
- [License ](#license )
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:**
2016-08-26 06:40:14 +00:00
- Does not require 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:**
2016-08-26 06:40:14 +00:00
- Does not require a title of its own.
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.
### Short Description
**Status:** Required.
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
- Does not require its own title.
2016-07-07 15:24:29 +00:00
- Must be less than 120 characters.
- Must start with `> `
- Must be on it's 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:**
2016-08-26 06:40:14 +00:00
- Does not require 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
2016-07-28 17:55:41 +00:00
**Status:** Required by default, optional for READMEs less 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
2016-07-28 17:55:41 +00:00
**Status:** Required by default, optional for doc modules.
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
- `Updating` . Optional.
**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.
2016-07-27 21:22:47 +00:00
- If there is no code in the module - for instance, a document-based module - this section is not required.
2016-07-07 15:24:29 +00:00
2016-08-26 06:40:14 +00:00
### Usage
2016-07-28 17:55:41 +00:00
**Status:** Required by default, optional for doc modules.
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-27 21:22:47 +00:00
- If there is no code in the module - for instance, a document-based module - this section is not required.
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:**
2016-08-30 02:46:32 +00:00
- Does not require its own title, however the sections included within it must have titles.
- 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-08-26 06:40:14 +00:00
### Contribute
**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:**
2016-07-27 15:26:35 +00:00
- Link to a contributing or contribute file -- if there is one.
2016-07-07 15:24:29 +00:00
- Be as friendly as possible.
- Link to the GitHub issues.
- Link to Code of Conduct. This is often in Contribute, or organization wide, so may not be necessary for each module.
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:**
- State license initials or name.
- State license owner.
- Must be last section.
**Suggestions:**
- Link to longer License file in local repository.