Open RichardLitt opened 7 years ago
Here’s some more ideas. The checked ones are in GH-6 and GH-8.
file-stem
file-extname
require-extname
section-order
no-unknown-sections
require-sections
wooorm/remark-lint#remark-lint-no-missing-blank-lines
— This checks for blanks between anything, not sections.davidtheclark/remark-lint-no-dead-urls
qard/remark-lint-code
(todo: create a remark-lint-code-standard
plugin)remark-lint-appropriate-heading
should allow for repository / folder / package name in italics.banner
/ badges
don’t have headingsshields.io
badges are used, if available, instead of alternativespackage.json#description
(e.g., using levenshtein-edit-distance
to check for an 80% match?)contributing.md
file, it’s linked in the Contribute sectionFinally, as a start to validate the schema / heading outline, I created the following list from the spec:
Title
(required)Banner
(optional, no title, paragraph with link and image nodes to local image)Badges
(optional, no title, paragraph with newline delimited links with images)Short Description
(required, no title, block quote)Long Description
(required, no title, free form)Table of Contents
(depends: required if more than 100 lines; list of links and optional nested lists)Security
(optional)Background
(optional)Install
(depends: required if installable, code block and free form)
Dependencies
(optional)Updating
(optional)Usage
(depends: required if installable, code block and free form)
CLI
(depends: required if usable on command line, code block and free form)Extra sections
, no title, zero or more free-form sections with titles)API
(optional, free form)Maintainer|Maintainers
(optional, short list of links)Contribute
(required, free-form)License
(required, free-form)That looks right to me! Maintainer is optional, now. This should be relatively easy to check - for instance, the banner, badges, short and long description could be ignored in a heading check. Check the beginning to match, and the last two, and then note if any of the ones present are mistakenly put in the extra sections bit.
Yeah I was thinking about how to check the heading-less stuff too. I came up with the idea of a utility that transforms the AST into a schema (an object form of the above), which you can then check for validity (or use for other tools!)
The headingless-stuff should only really be in the main section before any second level headers (which would be TOC, background, security, or install). So, that should be in a separate check. That makes checking the titles easier, right?
True, yeah definitely! I was thinking more about how to do it perfectly, how it’s supposed to be, than how to do it quickly/for now!
Modified the above schema to make Maintainers optional.
Initially, you can make them as packages in this folder, and then require them in
index.js
file as needed. When they are suitably abstracted, put them into their own packages.