diff options
-rw-r--r-- | doc/help.md | 36 | ||||
-rw-r--r-- | html/doc/help.html | 399 | ||||
-rw-r--r-- | lib/help.js | 3 | ||||
-rw-r--r-- | man1/help.1 | 65 |
4 files changed, 500 insertions, 3 deletions
diff --git a/doc/help.md b/doc/help.md new file mode 100644 index 000000000..c146215e9 --- /dev/null +++ b/doc/help.md @@ -0,0 +1,36 @@ +npm-help(1) -- Get help on npm +============================== + +## SYNOPSIS + + npm help <topic> + npm help some search terms + +## DESCRIPTION + +If supplied a topic, then show the appropriate documentation page. + +If the topic does not exist, or if multiple terms are provided, then run +the `help-search` command to find a match. Note that, if `help-search` +finds a single subject, then it will run `help` on that topic, so unique +matches are equivalent to specifying a topic name. + +## CONFIGURATION + +### viewer + +* Default: "man" on Posix, "browser" on Windows +* Type: path + +The program to use to view help content. + +Set to `"browser"` to view html help content in the default web browser. + +## SEE ALSO + +* npm(1) +* README +* npm-faq(1) +* npm-folders(1) +* npm-config(1) +* npm-json(1) diff --git a/html/doc/help.html b/html/doc/help.html new file mode 100644 index 000000000..0e4b18c2e --- /dev/null +++ b/html/doc/help.html @@ -0,0 +1,399 @@ +<!doctype html> +<html> + <title>help</title> + <meta http-equiv="content-type" value="text/html;utf-8"> +<style type="text/css"> + +/* reset */ +* { + margin:0; + padding:0; + border:none; + font-family:inherit; + font-size:inherit; + font-weight:inherit; +} +:target::before { + content:" >>> "; + position:absolute; + display:block; + opacity:0.5; + color:#f00; + margin:0 0 0 -2em; +} +abbr, acronym { + border-bottom:1px dotted #aaa; +} +kbd, code, pre { + font-family:monospace; + margin:0; + font-size:18px; + line-height:24px; + background:#eee; + outline:1px solid #ccc; +} +kbd code, kbd pre, kbd kbd, +pre code, pre pre, pre kbd, +code code, code pre, code kbd { outline: none } +.dollar::before { + content:"$ "; + display:inline; +} +p, ul, ol, dl, pre { + margin:30px 0; + line-height:30px; +} +hr { + margin:30px auto 29px; + width:66%; + height:1px; + background:#aaa; +} +pre { + display:block; +} +dd :first-child { + margin-top:0; +} + +body { + quotes:"“" "”" "‘" "’"; + width:666px; + margin:30px auto 120px; + font-family:Times New Roman, serif; + font-size:20px; + background:#fff; + line-height:30px; + color:#111; +} + +blockquote { + position:relative; + font-size:16px; + line-height:30px; + font-weight:bold; + width:85%; + margin:0 auto; +} +blockquote::before { + font-size:90px; + display:block; + position:absolute; + top:20px; + right:100%; + content:"“"; + padding-right:10px; + color:#ccc; +} +.source cite::before { + content:"— "; +} +.source { + padding-left:20%; + margin-top:30px; +} +.source cite span { + font-style:normal; +} +blockquote p { + margin-bottom:0; +} +.quote blockquote { + font-weight:normal; +} + +h1, h2, h3, h4, h5, h6, dt, #header { + font-family:serif; + font-size:20px; + font-weight:bold; +} +h2 { + background:#eee; +} +h1, h2 { + line-height:40px; +} + +i, em, cite { + font-style:italic; +} +b, strong { + font-weight:bold; +} +i, em, cite, b, strong, small { + line-height:28px; +} +small, .small, .small *, aside { + font-style:italic; + color:#669; + font-size:18px; +} +spall a, .small a { + text-decoration:underline; +} +del { + text-decoration:line-through; +} +ins { + text-decoration:underline; +} +.alignright { display:block; float:right; margin-left:1em; } +.alignleft { display:block; float:left; margin-right:1em; } + +q:before, q q q:before, q q q q q:before, q q q q q q q:before { content:"“"; } +q q:before, q q q q:before, q q q q q q:before, q q q q q q q q:before { content:"‘"; } +q:after, q q q:after, q q q q q:after, q q q q q q q:after { content:"”"; } +q q:after, q q q q:after, q q q q q q:after, q q q q q q q q:after { content:"’"; } + +a { color:#00f; text-decoration:none; } +a:visited { color:#636; } +a:hover, a:active { color:#900!important; text-decoration:underline; } + +h1 { + font-weight:bold; + background:#fff; +} +h1 a, h1 a:visited { + font-family:GubbleBum, gubblefont, monospace; + font-size:60px; + color:#900; + display:block; +} + +.navigation { + display:table; + width:100%; + margin:0 0 30px 0; + position:relative; +} +#nav-above { + margin-bottom:0; +} +.navigation .nav-previous { + display:table-cell; + text-align:left; + width:50%; +} +/* hang the » and « off into the margins */ +.navigation .nav-previous a:before, .navigation .nav-next a:after { + content: "«"; + display:block; + height:30px; + margin-bottom:-30px; + text-decoration:none; + margin-left:-15px; +} +.navigation .nav-next a:after { + content: "»"; + text-align:right; + margin-left:0; + margin-top:-30px; + margin-right:-15px; +} + + +.navigation .nav-next { + display:table-cell; + text-align:right; + width:50%; +} +.navigation a { + display:block; + width:100%; + height:100%; +} + +input, button, textarea { + border:0; + line-height:30px; +} +textarea { + height:300px; +} +input { + height:30px; + line-height:30px; +} +input.submit, input#submit, input.button, button, input[type=submit] { + cursor:hand; cursor:pointer; + outline:1px solid #ccc; +} + +#wrapper { + margin-bottom:90px; + position:relative; + z-index:1; + *zoom:1; + background:#fff; +} +#wrapper:after { + display:block; + content:"."; + visibility:hidden; + width:0; + height:0; + clear:both; +} + +.sidebar .xoxo > li { + float:left; + width:50%; +} +.sidebar li { + list-style:none; +} +.sidebar #elsewhere { + margin-left:-10%; + margin-right:-10%; +} +.sidebar #rss-links, .sidebar #twitter-feeds { + float:right; + clear:right; + width:20%; +} +.sidebar #comment { + clear:both; + float:none; + width:100%; +} +.sidebar #search { + clear:both; + float:none; + width:100%; +} +.sidebar #search h2 { + margin-left:40%; +} +.sidebar #search #s { + width:90%; + float:left; +} +.sidebar #search #searchsubmit { + width:10%; + float:right; +} +.sidebar * { + font-size:15px; + line-height:30px; +} + +#footer, #footer * { + margin:300px 0 0; + text-align:right; + font-size:14px; + line-height:90px; +} + +#toc { + position:absolute; + top:0; + right:0; + padding:40px 0 40px 20px; + margin:0; + width:200px; + opacity:0.2; + z-index:-1; +} +#toc:hover { + opacity:1; + background:#fff; + z-index:999; +} +#toc ul { + padding:0; + margin:0; +} +#toc, #toc li { + list-style-type:none; + font-size:15px; + line-height:15px; +} +#toc li { + padding:0 0 0 10px; +} +#toc li a { + position:relative; + display:block; +} + +@font-face { + font-family:gubblefont; + src: url(http://static.izs.me/fonts/GubbleBum-Blocky.ttf) format("truetype"); +} + +@media print { + a[href] { + color:inherit; + } + a[href]:after { + white-space:nowrap; + content:" " attr(href); + } + a[href^=\#], .navigation { + display:none; + } +} +</style> + + <body> + <div id="wrapper"> +<h1><a href="help.html">npm help</a></h1> <p>Get help on npm</p> + +<h2 id="SYNOPSIS">SYNOPSIS</h2> + +<pre><code>npm help <topic> +npm help some search terms</code></pre> + +<h2 id="DESCRIPTION">DESCRIPTION</h2> + +<p>If supplied a topic, then show the appropriate documentation page.</p> + +<p>If the topic does not exist, or if multiple terms are provided, then run +the <code>help-search</code> command to find a match. Note that, if <code>help-search</code> +finds a single subject, then it will run <code>help</code> on that topic, so unique +matches are equivalent to specifying a topic name.</p> + +<h2 id="CONFIGURATION">CONFIGURATION</h2> + +<h3 id="viewer">viewer</h3> + +<ul><li>Default: "man" on Posix, "browser" on Windows</li><li>Type: path</li></ul> + +<p>The program to use to view help content.</p> + +<p>Set to <code>"browser"</code> to view html help content in the default web browser.</p> + +<h2 id="SEE-ALSO">SEE ALSO</h2> + +<ul><li><a href="npm.html">npm</a></li><li><a href="README.html">README</a></li><li><a href="faq.html">npm faq</a></li><li><a href="folders.html">npm folders</a></li><li><a href="config.html">npm config</a></li><li><a href="json.html">npm json</a></li></ul> +</div> +<script> +;(function () { +var wrapper = document.getElementById("wrapper") +var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) + .filter(function (el) { + return el.parentNode === wrapper + && el.tagName.match(/H[1-6]/) + && el.id + }) +var l = 2 + , toc = document.createElement("ul") +toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + , out = "" + while (i > l) { + out += "<ul>" + l ++ + } + while (i < l) { + out += "</ul>" + l -- + } + out += "<li><a href='#" + el.id + "'>" + el.innerHTML + "</a>" + return out +}).join("\n") +toc.id = "toc" +document.body.appendChild(toc) +})() +</script> +</body></html> diff --git a/lib/help.js b/lib/help.js index 42633d58e..ba92a98cb 100644 --- a/lib/help.js +++ b/lib/help.js @@ -15,9 +15,6 @@ var fs = require("graceful-fs") function help (args, cb) { if (args.length > 1 && args[0]) return npm.commands["help-search"](args, cb) var section = args[0] - if (section === "help") { - section = !npm.config.get("usage") && "npm" - } if (section) { if ( npm.config.get("usage") && npm.commands[section] diff --git a/man1/help.1 b/man1/help.1 new file mode 100644 index 000000000..5f6cd9f96 --- /dev/null +++ b/man1/help.1 @@ -0,0 +1,65 @@ +.\" Generated with Ronnjs/v0.1 +.\" http://github.com/kapouer/ronnjs/ +. +.TH "NPM\-HELP" "1" "September 2011" "" "" +. +.SH "NAME" +\fBnpm-help\fR \-\- Get help on npm +. +.SH "SYNOPSIS" +. +.nf +npm help <topic> +npm help some search terms +. +.fi +. +.SH "DESCRIPTION" +If supplied a topic, then show the appropriate documentation page\. +. +.P +If the topic does not exist, or if multiple terms are provided, then run +the \fBhelp\-search\fR command to find a match\. Note that, if \fBhelp\-search\fR +finds a single subject, then it will run \fBhelp\fR on that topic, so unique +matches are equivalent to specifying a topic name\. +. +.SH "CONFIGURATION" +. +.SS "viewer" +. +.IP "\(bu" 4 +Default: "man" on Posix, "browser" on Windows +. +.IP "\(bu" 4 +Type: path +. +.IP "" 0 +. +.P +The program to use to view help content\. +. +.P +Set to \fB"browser"\fR to view html help content in the default web browser\. +. +.SH "SEE ALSO" +. +.IP "\(bu" 4 +npm help npm +. +.IP "\(bu" 4 +README +. +.IP "\(bu" 4 +npm help faq +. +.IP "\(bu" 4 +npm help folders +. +.IP "\(bu" 4 +npm help config +. +.IP "\(bu" 4 +npm help json +. +.IP "" 0 + |