Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upidea: standard-readme #141
Comments
This comment has been minimized.
This comment has been minimized.
|
I like the idea. I would also add a check for |
This comment has been minimized.
This comment has been minimized.
|
+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. |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
sergiolepore
commented
May 19, 2015
|
+1 |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
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.: |
This comment has been minimized.
This comment has been minimized.
|
@maxogden Just so I'm clear, you're suggesting a new module for |
This comment has been minimized.
This comment has been minimized.
|
@jprichardson yes this thread is a discussion on a completely separate cli tool |
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
|
@maxogden (: alright then |
This comment has been minimized.
This comment has been minimized.
tunnckoCore
commented
May 20, 2015
|
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 npm@v2.10+) 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 | coverallsIt is like that to speedup the local developing process with just verifying that everything is Regards, |
This comment has been minimized.
This comment has been minimized.
shama
commented
May 20, 2015
|
mdast is a great tool if you wanted to write your own linter. |
This comment has been minimized.
This comment has been minimized.
mattdesl
commented
May 20, 2015
|
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. |
This comment has been minimized.
This comment has been minimized.
|
@mattdesl I actually very strongly disagree with |
This comment has been minimized.
This comment has been minimized.
chrisdickinson
commented
May 20, 2015
|
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. |
This comment has been minimized.
This comment has been minimized.
tunnckoCore
commented
May 20, 2015
This comment has been minimized.
This comment has been minimized.
mattdesl
commented
May 20, 2015
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: |
This comment has been minimized.
This comment has been minimized.
|
@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 :) |
This comment has been minimized.
This comment has been minimized.
|
sorry meant the latter, hahaha |
This comment has been minimized.
This comment has been minimized.
morganherlocker
commented
May 20, 2015
|
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. |
This comment has been minimized.
This comment has been minimized.
mattdesl
commented
May 20, 2015
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. |
This comment has been minimized.
This comment has been minimized.
tunnckoCore
commented
May 20, 2015
|
@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) |
This comment has been minimized.
This comment has been minimized.
I have a lot of personal evidence to support this, but no citation :) |
This comment has been minimized.
This comment has been minimized.
tunnckoCore
commented
May 20, 2015
|
|
This comment has been minimized.
This comment has been minimized.
wooorm
commented
May 21, 2015
|
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? |
This comment has been minimized.
This comment has been minimized.
tunnckoCore
commented
May 21, 2015
it would be |
This comment has been minimized.
This comment has been minimized.
wooorm
commented
May 21, 2015
|
Ah didn't get that, yeah that would be cool! |
This comment has been minimized.
This comment has been minimized.
wooorm
commented
May 21, 2015
|
Alright, I just created a tiny example of how mdast could help with linting markdown. git clone git@github.com:wooorm/mdast-standard-example.git
cd mdast-standard-example
npm install
node_modules/.bin/mdast . --use ./index.jswill show lint warnings: |
feross
added
the
question
label
May 30, 2015
This comment has been minimized.
This comment has been minimized.
|
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 newRootNodeOnce 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
|
This comment has been minimized.
This comment has been minimized.
pbrinkmeier
commented
Jun 1, 2015
|
@yoshuawuyts |
This comment has been minimized.
This comment has been minimized.
|
@yoshuawuyts dope idea, +1 from me |
This comment has been minimized.
This comment has been minimized.
junosuarez
commented
Jun 1, 2015
|
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 |
This comment has been minimized.
This comment has been minimized.
zcei
commented
Jun 3, 2015
|
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) |
This comment has been minimized.
This comment has been minimized.
wooorm
commented
Jun 4, 2015
|
Should we close this issue here as we have a place to follow-up on this? |
This comment has been minimized.
This comment has been minimized.
junosuarez
commented
Jun 4, 2015
|
Yes, there is active discussion happening on the standard-readme repo and this issue should be closed. |
This comment has been minimized.
This comment has been minimized.
|
Hey everyone: I've written a spec for standard-readme and a generator. Would love feedback and adoption: |
This comment has been minimized.
This comment has been minimized.
tunnckoCore
commented
May 26, 2016
•
|
@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 |
This comment has been minimized.
This comment has been minimized.
jonschlinkert
commented
May 26, 2016
|
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! |
This comment has been minimized.
This comment has been minimized.
|
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 <
|
This comment has been minimized.
This comment has been minimized.
junosuarez
commented
May 26, 2016
|
@RichardLitt nice work! Everyone: maybe we could continue feedback as issues on https://github.com/RichardLitt/standard-readme instead of in this thread |
This comment has been minimized.
This comment has been minimized.
tunnckoCore
commented
May 26, 2016
•
|
@rstacruz consistency maybe, and easy navigation. |
This comment has been minimized.
This comment has been minimized.
|
Thanks, @jden. Move discussion there - I just wanted to drop this here to notify participants. Table of Contents discussion: RichardLitt/standard-readme#15 |
This comment has been minimized.
This comment has been minimized.
|
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? |
This comment has been minimized.
This comment has been minimized.
tunnckoCore
commented
May 27, 2016
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 |
This comment has been minimized.
This comment has been minimized.
balupton
commented
Jun 17, 2016
•
|
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. |
This comment has been minimized.
This comment has been minimized.
cdaringe
commented
Sep 29, 2016
|
no shortage of solutions, I suppose, but I will also have a solution to this problem shortly via: https://github.com/cdaringe/counsel |
This comment has been minimized.
This comment has been minimized.
|
BTW, this is probably relevant to folks in this thread. @zeke released the excellent |





maxogden commentedMay 18, 2015
I use
standardto check my code,dependency-checkto 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
standarddid for JS style. There is a pretty cool markdown linter calledmarkdownlintthat could be used for basic style checking.Going beyond style, though, what about failing if these cases are not met:
installationexampleorusageapiapisection must have a sub section for each public method in the modules main entrylicenseso, does this seem like a good idea? what are other base requirements that should be added (or removed) from the above list?