-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
idea: standard-readme #141
Comments
I like the idea. I would also add a check for |
+1 on the idea; the list of headings seems about right to me. I also like to include a The only point I'd argue for a possible alternative is the use of Somewhat relevant: there's a chrome extension for nodei badges on every repo. |
I like the idea of this.
This will definitely limit the ability for large projects to use standard, since they typically don't have all their documentation in the README.
And what if the entire API is outlined in a the |
+1 😁 |
Coming back on my previous comment, I don't think the
It can be as little as a line per api method. Having an api section makes it a lot easier to just look up something no matter how small the project (and know what types it takes, etc.) Take a look at
What are the alternatives? I'd argue that dedicated documentation sites / wikis are less clear than a single file with all the methods described. Take a look at browserify to see an example. |
I guess the spectrum is:
Obviously we want some checking here. But we also want it to be as simple as possible, with a focus on only testing things that are essential. I also don't want to require people to use a special JSDoc style inline code documentation tool. You can use one of these if you want, but you should also be able to simply hand write the docs in the readme. The Generally my motivations here come from that I maintain ~300 node modules and want to ensure a base level of quality across them all. also @yoshuawuyts the utf8 in your name is super annoying to me btw :), e.g.: |
@maxogden Just so I'm clear, you're suggesting a new module for |
@jprichardson yes this thread is a discussion on a completely separate cli tool |
I completely agree with you, if the documentation is too much to fit in the README, its probably not modular enough IMHO; but that is separate to the discussion of whether we should bar projects from being able to use it just because they aren't modular enough. |
@maxogden (: alright then |
I can argue with some of the points. And they are
it is weird to force this, @yoshuawuyts shared cool extension for it, thanks. nothing that it isn't exactly as in the preview from the chrome store, lol.
maybe if it allow
I'm not against to have some brief short api documentation in readme, but sometimes I have just Some refs tunnckoCore/npm-related, hybridables/hybridify-all and hybridables/hybridify. It is short and pretty cool, cuz
Not needed, really. It is better to just have on top some badge which contain license identifier (because the SPDX, applied from [email protected]+) and to be link to the license file containing full license text and copyright holder(s). It will look more standard, instead to have "MIT" / "License" / "MIT LiCeNSe" or whatever section at the bottom. I also will start updating my package.json to be more compact. e.g. {
"name": "foobar",
"version": "0.1.0",
"description": "brief info about foobar",
"main": "index.js",
"license": "MIT",
"author": "Charlike Mike Reagent <@tunnckoCore> (http://www.tunnckocore.tk)",
"repository": "tunnckoCore/foobar",
"scripts": {
"test": "standard && node test.js"
},
"dependencies": {},
"devDependencies": {
"assertit": "^0.1.0"
},
"keywords": []
} which also is so clean and cool it hurts.
sudo: false
language: "node_js"
node_js:
- "0.10"
- "0.12"
- "iojs"
before_script:
- npm install standard
- standard
script:
- npm install istanbul
- istanbul cover test.js --report lcovonly
after_script:
- npm install coveralls
- cat ./coverage/lcov.info | coveralls It is like that to speedup the local developing process with just verifying that everything is Regards, |
mdast is a great tool if you wanted to write your own linter. |
My 2c...
This seems like a bit of vendor lock-in.
To me this seems like cruft. The majority of people already know how to
The header makes it easier for the linter, but it's also cruft IMHO since it's pretty clean and obvious when the example code is listed after the description. Example.
I've called this "Usage" since some modules are API-only, others are CLI-only, and others contain both. Example. |
@mattdesl I actually very strongly disagree with |
I usually structure my readmes as
I'd definitely consider adding installation, but I would probably put it between "api" and "long description" – the first 3 points are there to let folks determine whether or not they even want this thing, and worrying about how to get it is a secondary concern to whether the thing does what they want. |
If somebody doesn't know how to install a module, a one/two-liner probably won't make them magically understand the process of setting up node/npm/etc, much less actually using the code in an server/browser application. It gets pretty complicated. And once you do know how to install a module, you will never need to read that section again, so it just becomes fluff that you always need to scroll by. Some places where the installation instructions should be highlighted to stand out: modules that are mainly intended for global installation, or modules that peer-depend on something else. Anyways... Hope this doesn't come off negatively. I am not against installation instructions, it's just frustrating that I have to scroll through all sorts of cruft just to see a code example, which is usually what I came to see. Sorry to single your module out but here's a quick example of what I mean: |
@mattdesl if I had to choose between making my readme have less content in it and be more opaque to newbies vs having more content in it and being more newbie friendly but making experienced people use a table of contents or their mouse scroll wheel I would choose the former every time :) |
sorry meant the latter, hahaha |
FWIW, the Turf project uses JSDoc (and some other metadata sources like the package.json) + dox + doxme, which works well for getting the metadata into various formats (including markdown). JSDocs like this turns into a readme & HTML from the same, easily validated source. We switched to this after updating and synchronizing nearly 100 readme files for the project was becoming untenable. I would definitely recommend a validation mechanism that is decoupled from format or style if possible. |
Sure, but does a one or two line "npm install -g" really help newbies? The only people who know what this means have probably already installed and used modules on a project. A real installation guide should cover installing Node/npm, updating to the latest versions, handling permissions for global installs, etc. |
@mattdesl you have some right, i can agree. But it is like a standard in the community. You can see that in 99% of the repos/libs, so it would be expected to be part of the
yea, no problem. the pic show something strange in npmjs.com's parsing. I guess it checks if h1 is same as the module name. no matter, express/koa-better-body and ratelimit isn't for comparing, im working on next releases and forcing readme style like in npm.im/hybridify (see it looks better) |
I have a lot of personal evidence to support this, but no citation :) |
|
Thanks @shama for the shout-out. I certainly think mdast could help, for an example with eslint, check out eslint-md, which could easily be ported to standard. However, that lints the JavaScript in markdown, not the markdown itself. TBH, is a project named “JavaScript Standard Style” the right place to validate markdown/readme style? |
it would be |
Ah didn't get that, yeah that would be cool! |
Alright, I just created a tiny example of how mdast could help with linting markdown. git clone [email protected]:wooorm/mdast-standard-example.git
cd mdast-standard-example
npm install
node_modules/.bin/mdast . --use ./index.js will show lint warnings: |
Something that this module could additionally do is lint the way interfaces are defined in the API section. Everyone seems to do it differently, and having some consistency would be great. Just to display some of the flavors: browserifyb.plugin(plugin, opts)Register a
For more information, consult the plugins section below. virtual-domPatch operationspatch(rootNode:DOMNode, patches:PatchObject) -> DOMNode newRootNode Once we have computed the set of patches required to apply to the DOM, we need a function that can apply those patches. This is provided by the from2
|
Just a suggestion: this thread has a ton of great ideas; clearly there's interest in this, but none of it is directly related to |
Followed @jden's suggestion after no one else did ;) Just dropped my thoughts about it into the @yoshuawuyts I'm also for a unified API write style. Will investigate the most common styles and an approach to melt it into smth sane. You are all more than welcome to further contribute to it, I'll do my very best to keep the project structured & aligned with the intentions of you all! (@tunnckoCore: I liked many parts of your proposed readmes and thus copied a bit over for the example one) |
Should we close this issue here as we have a place to follow-up on this? |
Yes, there is active discussion happening on the standard-readme repo and this issue should be closed. |
Hey everyone: I've written a spec for standard-readme and a generator. Would love feedback and adoption: |
@RichardLitt yea, looks great to me. Except one requirement in "Table of contents":
In my repos i my name and badges/links to me as last h2 heading - first. And second I also don't have License section, because it 1) can be accessed directly by opening the LICENSE file from file browser, or 2) by clicking the badge which is next to the name of the repo (h1). I think it is more faster than scrolling to the end of big/small readmes. Look at mukla's or hybridify's current/latest readme using If you are lawyer or such, or just you come to see the license, isn't it more natural to look is there a license file first and open it directly, instead of scrolling and etc? That's why I don't have license section. Also in the package's npm page have link to license based on license field in package.json. Can suggest you to add link to markdown-toc in the @jonschlinkert, we can make verb-readme-generator spec compliant? And then if it is spec compliant @RichardLitt can add it and verb >=0.9 to the suggestion for generating the spec-compliant readmes. Also maybe create the |
hey thanks for the mention. I'd prefer to wait until we release a stable version of verb before it enters any discussions, since it's 100% on dev brach atm. but I do appreciate it! |
Curious: Would it be prudent to require a ToC even for the shortest of On Fri, May 27, 2016, 3:36 AM Charlike Mike Reagent <
|
@RichardLitt nice work! Everyone: maybe we could continue feedback as issues on https://github.com/RichardLitt/standard-readme instead of in this thread |
@rstacruz consistency maybe, and easy navigation. |
Thanks, @jden. Move discussion there - I just wanted to drop this here to notify participants. Table of Contents discussion: RichardLitt/standard-readme#15 |
Lateral discussion: I'm actually more interested in standardizing changelogs. It has way too many variations. (I happen to love the format I use, though, haha.) Anyone else care to have these standardized? |
yea, working on it locally from time to time. Also last year I created @standards org to get them all in one place, but don't have time, currently. @rstacruz there's already have keep-a-changelog convention, try to follow it. :D |
https://github.com/bevry/projectz has been around for a few years now and seems to already accomplish what this issue aims to do. It is used on all bevry and docpad repos. Plan is to extend it with a plugin system in the coming months. Happy to improve it as necessary. |
no shortage of solutions, I suppose, but I will also have a solution to this problem shortly via: https://github.com/cdaringe/counsel |
BTW, this is probably relevant to folks in this thread. @zeke released the excellent |
I use
standard
to check my code,dependency-check
to check my package.json deps are sane, but I don't have anything to check my readme.I wonder if it would practical to do for node module readmes what
standard
did for JS style. There is a pretty cool markdown linter calledmarkdownlint
that could be used for basic style checking.Going beyond style, though, what about failing if these cases are not met:
installation
example
orusage
api
api
section must have a sub section for each public method in the modules main entrylicense
so, does this seem like a good idea? what are other base requirements that should be added (or removed) from the above list?
The text was updated successfully, but these errors were encountered: