-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Problem
crates.io interprets the package's README file specified in the readme field as Markdown.1 This file can accept a non-Markdown file such as README.rst (reStructuredText) or README.adoc (AsciiDoc). However, these are not Markdown file and therefore will not render as expected. This behavior can be known by looking at https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-readme-field or the crate's page after it is released. However, when we run a command such as cargo publish, no warnings or errors are printed, so we cannot know this behavior at that time.
Proposed Solution
If a the extension of the specified path does not match any of .md, .txt or no extension, print a warning when executing a command such as cargo publish.
I think printing a warning is printed indicating that the readme field is expecting a Markdown file would reduce the chance of accidentally specifying the README file in a different format.
I think in most projects the README file is a Markdown file named README.md. Also, I think many projects omit this field and use the default value. So I think this problem is unlikely to occur, but I think it would be useful if a warning was printed, since there may be cases where the README file other than README.md are stored.
Notes
There seem to be other extensions for Markdown, such as .markdown, but I'm not sure if they should be supported.
This might be better detected by the clippy.