diff options
author | isaacs <i@izs.me> | 2011-09-09 00:18:48 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-09-09 00:18:48 +0400 |
commit | 8fdd60d9608cd56a07d46ebbe492d6c7e05e3047 (patch) | |
tree | dd0caf3699e936aa69d6d4685e4e19883f513289 | |
parent | a79d8804f1a205cdaf73bb84f7b06a0112c73085 (diff) |
Build an index of all html documentation files
-rw-r--r-- | Makefile | 14 | ||||
-rw-r--r-- | doc/index.md | 241 | ||||
-rw-r--r-- | html/doc/index.html | 280 | ||||
-rw-r--r-- | man1/index.1 | 185 | ||||
-rw-r--r-- | scripts/index-build.js | 34 |
5 files changed, 752 insertions, 2 deletions
@@ -1,12 +1,18 @@ SHELL = bash +markdowns = $(shell find doc -name '*.md' | grep -v 'index') + docs = $(shell find doc -name '*.md' \ + |grep -v 'index' \ |sed 's|.md|.1|g' \ - |sed 's|doc/|man1/|g' ) man1/README.1 + |sed 's|doc/|man1/|g' ) \ + man1/README.1 htmldocs = $(shell find doc -name '*.md' \ |sed 's|.md|.html|g' \ - |sed 's|doc/|html/doc/|g' ) html/doc/README.html + |sed 's|doc/|html/doc/|g' ) \ + html/doc/README.html \ + html/doc/index.html doc_subfolders = $(shell find doc -type d \ |sed 's|doc/|man1/|g' ) @@ -56,6 +62,10 @@ html/doc/README.html: README.md html/dochead.html html/docfoot.html html/doc/%.html: doc/%.md html/dochead.html html/docfoot.html scripts/doc-build.sh $< $@ +doc/index.md: $(markdowns) + node scripts/index-build.js > doc/index.md + + test: submodules node cli.js test diff --git a/doc/index.md b/doc/index.md new file mode 100644 index 000000000..dcd116128 --- /dev/null +++ b/doc/index.md @@ -0,0 +1,241 @@ +npm-index(1) -- Index of all npm documentation files +==================================================== + + +## npm-adduser(1) + +Create or verify a user named `<username>` in the npm registry, and +save the credentials to the `.npmrc` file. + +## npm-bin(1) + +Print the folder where npm will install executables. + +## npm-build(1) + +This is the plumbing command called by `npm link` and `npm install`. + +## npm-bundle(1) + +The `npm bundle` command has been removed in 1.0, for the simple reason +that it is no longer necessary, as the default behavior is now to +install packages into the local space. + +## npm-cache(1) + +Used to add, list, or clear the npm cache folder. + +## npm-changelog(1) + +A brief history. + +## npm-coding-style(1) + +npm's coding style is a bit unconventional. It is not different for +difference's sake, but rather a carefully crafted style that is +designed to reduce visual clutter and make bugs more apparent. + +## npm-completion(1) + +Enables tab-completion in all npm commands. + +## npm-config(1) + +npm gets its configuration values from 5 sources, in this priority: + +## npm-deprecate(1) + +This command will update the npm registry entry for a package, providing +a deprecation warning to all who attempt to install it. + +## npm-developers(1) + +So, you've decided to use npm to develop (and maybe publish/deploy) +your project. + +## npm-docs(1) + +This command tries to guess at the likely location of a package's +documentation URL, and then tries to open it using the `--browser` +config param. + +## npm-edit(1) + +Opens the package folder in the default editor (or whatever you've +configured as the npm `editor` config -- see `npm-config(1)`.) + +## npm-explore(1) + +Spawn a subshell in the directory of the installed package specified. + +## npm-faq(1) + +Questions asked frequently. + +## npm-folders(1) + +npm puts various things on your computer. That's its job. + +## npm-help-search(1) + +This command will search the npm markdown documentation files for the +terms provided, and then list the results, sorted by relevance. + +## npm-help(1) + +If supplied a topic, then show the appropriate documentation page. + +## npm-init(1) + +This will ask you a bunch of questions, and then write a package.json for you. + +## npm-install(1) + +This command installs a package, and any packages that it depends on. + +## npm-json(1) + +This document is all you need to know about what's required in your package.json +file. It must be actual JSON, not just a JavaScript object literal. + +## npm-link(1) + +Package linking is a two-step process. + +## npm-list(1) + +This command will print to stdout all the versions of packages that are +installed, as well as their dependencies, in a tree-structure. + +## npm-npm(1) + +npm is the package manager for the Node JavaScript platform. It puts +modules in place so that node can find them, and manages dependency +conflicts intelligently. + +## npm-outdated(1) + +This command will check the registry to see if any (or, specific) installed +packages are currently outdated. + +## npm-owner(1) + +Manage ownership of published packages. + +## npm-pack(1) + +For anything that's installable (that is, a package folder, tarball, +tarball url, name@tag, name@version, or name), this command will fetch +it to the cache, and then copy the tarball to the current working +directory as `<name>-<version>.tgz`, and then write the filenames out to +stdout. + +## npm-prefix(1) + +Print the prefix to standard out. + +## npm-prune(1) + +This command removes "extraneous" packages. If a package name is +provided, then only packages matching one of the supplied names are +removed. + +## npm-publish(1) + +Publishes a package to the registry so that it can be installed by name. + +## npm-rebuild(1) + +This command runs the `npm build` command on the matched folders. This is useful +when you install a new version of node, and must recompile all your C++ addons with +the new binary. + +## npm-registry(1) + +To resolve packages by name and version, npm talks to a registry website +that implements the CommonJS Package Registry specification for reading +package info. + +## npm-removing-npm(1) + +So sad to see you go. + +## npm-restart(1) + +This runs a package's "restart" script, if one was provided. +Otherwise it runs package's "stop" script, if one was provided, and then +the "start" script. + +## npm-root(1) + +Print the effective `node_modules` folder to standard out. + +## npm-run-script(1) + +This runs an arbitrary command from a package's "scripts" object. + +## npm-scripts(1) + +npm supports the "scripts" member of the package.json script, for the +following scripts: + +## npm-search(1) + +Search the registry for packages matching the search terms. + +## npm-semver(1) + +As a node module: + +## npm-start(1) + +This runs a package's "start" script, if one was provided. + +## npm-stop(1) + +This runs a package's "stop" script, if one was provided. + +## npm-submodule(1) + +If the specified package has a git repository url in its package.json +description, then this command will add it as a git submodule at +`node_modules/<pkg name>`. + +## npm-tag(1) + +Tags the specified version of the package with the specified tag, or the +`--tag` config if not specified. + +## npm-test(1) + +This runs a package's "test" script, if one was provided. + +## npm-uninstall(1) + +This uninstalls a package, completely removing everything npm installed +on its behalf. + +## npm-unpublish(1) + +This removes a package version from the registry, deleting its +entry and removing the tarball. + +## npm-update(1) + +This command will update all the packages listed to the latest version +(specified by the `tag` config). + +## npm-version(1) + +Run this in a package directory to bump the version and write the new +data back to the package.json file. + +## npm-view(1) + +This command shows data about a package and prints it to the stream +referenced by the `outfd` config, which defaults to stdout. + +## npm-whoami(1) + +Print the `username` config to standard output. + diff --git a/html/doc/index.html b/html/doc/index.html new file mode 100644 index 000000000..172b5f7c0 --- /dev/null +++ b/html/doc/index.html @@ -0,0 +1,280 @@ +<!doctype html> +<html> + <title>index</title> + <meta http-equiv="content-type" value="text/html;utf-8"> + <link rel="stylesheet" type="text/css" href="./style.css"> + + <body> + <div id="wrapper"> +<h1><a href="index.html">index</a></h1> <p>Index of all npm documentation files</p> + +<h2 id="npm-adduser-1"><a href="adduser.html">adduser</a></h2> + +<p>Create or verify a user named <code><username></code> in the npm registry, and +save the credentials to the <code>.npmrc</code> file.</p> + +<h2 id="npm-bin-1"><a href="bin.html">bin</a></h2> + +<p>Print the folder where npm will install executables.</p> + +<h2 id="npm-build-1"><a href="build.html">build</a></h2> + +<p>This is the plumbing command called by <code>npm link</code> and <code>npm install</code>.</p> + +<h2 id="npm-bundle-1"><a href="bundle.html">bundle</a></h2> + +<p>The <code>npm bundle</code> command has been removed in 1.0, for the simple reason +that it is no longer necessary, as the default behavior is now to +install packages into the local space.</p> + +<h2 id="npm-cache-1"><a href="cache.html">cache</a></h2> + +<p>Used to add, list, or clear the npm cache folder.</p> + +<h2 id="npm-changelog-1"><a href="changelog.html">changelog</a></h2> + +<p>A brief history.</p> + +<h2 id="npm-coding-style-1"><a href="coding-style.html">coding-style</a></h2> + +<p>npm's coding style is a bit unconventional. It is not different for +difference's sake, but rather a carefully crafted style that is +designed to reduce visual clutter and make bugs more apparent.</p> + +<h2 id="npm-completion-1"><a href="completion.html">completion</a></h2> + +<p>Enables tab-completion in all npm commands.</p> + +<h2 id="npm-config-1"><a href="config.html">config</a></h2> + +<p>npm gets its configuration values from 5 sources, in this priority:</p> + +<h2 id="npm-deprecate-1"><a href="deprecate.html">deprecate</a></h2> + +<p>This command will update the npm registry entry for a package, providing +a deprecation warning to all who attempt to install it.</p> + +<h2 id="npm-developers-1"><a href="developers.html">developers</a></h2> + +<p>So, you've decided to use npm to develop (and maybe publish/deploy) +your project.</p> + +<h2 id="npm-docs-1"><a href="docs.html">docs</a></h2> + +<p>This command tries to guess at the likely location of a package's +documentation URL, and then tries to open it using the <code>--browser</code> +config param.</p> + +<h2 id="npm-edit-1"><a href="edit.html">edit</a></h2> + +<p>Opens the package folder in the default editor (or whatever you've +configured as the npm <code>editor</code> config -- see <code><a href="config.html">config</a></code>.)</p> + +<h2 id="npm-explore-1"><a href="explore.html">explore</a></h2> + +<p>Spawn a subshell in the directory of the installed package specified.</p> + +<h2 id="npm-faq-1"><a href="faq.html">faq</a></h2> + +<p>Questions asked frequently.</p> + +<h2 id="npm-folders-1"><a href="folders.html">folders</a></h2> + +<p>npm puts various things on your computer. That's its job.</p> + +<h2 id="npm-help-search-1"><a href="help-search.html">help-search</a></h2> + +<p>This command will search the npm markdown documentation files for the +terms provided, and then list the results, sorted by relevance.</p> + +<h2 id="npm-help-1"><a href="help.html">help</a></h2> + +<p>If supplied a topic, then show the appropriate documentation page.</p> + +<h2 id="npm-init-1"><a href="init.html">init</a></h2> + +<p>This will ask you a bunch of questions, and then write a package.json for you.</p> + +<h2 id="npm-install-1"><a href="install.html">install</a></h2> + +<p>This command installs a package, and any packages that it depends on.</p> + +<h2 id="npm-json-1"><a href="json.html">json</a></h2> + +<p>This document is all you need to know about what's required in your package.json +file. It must be actual JSON, not just a JavaScript object literal.</p> + +<h2 id="npm-link-1"><a href="link.html">link</a></h2> + +<p>Package linking is a two-step process.</p> + +<h2 id="npm-list-1"><a href="list.html">list</a></h2> + +<p>This command will print to stdout all the versions of packages that are +installed, as well as their dependencies, in a tree-structure.</p> + +<h2 id="npm-1"><a href="npm.html">npm</a></h2> + +<p>npm is the package manager for the Node JavaScript platform. It puts +modules in place so that node can find them, and manages dependency +conflicts intelligently.</p> + +<h2 id="npm-outdated-1"><a href="outdated.html">outdated</a></h2> + +<p>This command will check the registry to see if any (or, specific) installed +packages are currently outdated.</p> + +<h2 id="npm-owner-1"><a href="owner.html">owner</a></h2> + +<p>Manage ownership of published packages.</p> + +<h2 id="npm-pack-1"><a href="pack.html">pack</a></h2> + +<p>For anything that's installable (that is, a package folder, tarball, +tarball url, name@tag, name@version, or name), this command will fetch +it to the cache, and then copy the tarball to the current working +directory as <code><name>-<version>.tgz</code>, and then write the filenames out to +stdout.</p> + +<h2 id="npm-prefix-1"><a href="prefix.html">prefix</a></h2> + +<p>Print the prefix to standard out.</p> + +<h2 id="npm-prune-1"><a href="prune.html">prune</a></h2> + +<p>This command removes "extraneous" packages. If a package name is +provided, then only packages matching one of the supplied names are +removed.</p> + +<h2 id="npm-publish-1"><a href="publish.html">publish</a></h2> + +<p>Publishes a package to the registry so that it can be installed by name.</p> + +<h2 id="npm-rebuild-1"><a href="rebuild.html">rebuild</a></h2> + +<p>This command runs the <code>npm build</code> command on the matched folders. This is useful +when you install a new version of node, and must recompile all your C++ addons with +the new binary.</p> + +<h2 id="npm-registry-1"><a href="registry.html">registry</a></h2> + +<p>To resolve packages by name and version, npm talks to a registry website +that implements the CommonJS Package Registry specification for reading +package info.</p> + +<h2 id="npm-removing-npm-1"><a href="removing-npm.html">removing-npm</a></h2> + +<p>So sad to see you go.</p> + +<h2 id="npm-restart-1"><a href="restart.html">restart</a></h2> + +<p>This runs a package's "restart" script, if one was provided. +Otherwise it runs package's "stop" script, if one was provided, and then +the "start" script.</p> + +<h2 id="npm-root-1"><a href="root.html">root</a></h2> + +<p>Print the effective <code>node_modules</code> folder to standard out.</p> + +<h2 id="npm-run-script-1"><a href="run-script.html">run-script</a></h2> + +<p>This runs an arbitrary command from a package's "scripts" object.</p> + +<h2 id="npm-scripts-1"><a href="scripts.html">scripts</a></h2> + +<p>npm supports the "scripts" member of the package.json script, for the +following scripts:</p> + +<h2 id="npm-search-1"><a href="search.html">search</a></h2> + +<p>Search the registry for packages matching the search terms.</p> + +<h2 id="npm-semver-1"><a href="semver.html">semver</a></h2> + +<p>As a node module:</p> + +<h2 id="npm-start-1"><a href="start.html">start</a></h2> + +<p>This runs a package's "start" script, if one was provided.</p> + +<h2 id="npm-stop-1"><a href="stop.html">stop</a></h2> + +<p>This runs a package's "stop" script, if one was provided.</p> + +<h2 id="npm-submodule-1"><a href="submodule.html">submodule</a></h2> + +<p>If the specified package has a git repository url in its package.json +description, then this command will add it as a git submodule at +<code>node_modules/<pkg name></code>.</p> + +<h2 id="npm-tag-1"><a href="tag.html">tag</a></h2> + +<p>Tags the specified version of the package with the specified tag, or the +<code>--tag</code> config if not specified.</p> + +<h2 id="npm-test-1"><a href="test.html">test</a></h2> + +<p>This runs a package's "test" script, if one was provided.</p> + +<h2 id="npm-uninstall-1"><a href="uninstall.html">uninstall</a></h2> + +<p>This uninstalls a package, completely removing everything npm installed +on its behalf.</p> + +<h2 id="npm-unpublish-1"><a href="unpublish.html">unpublish</a></h2> + +<p>This removes a package version from the registry, deleting its +entry and removing the tarball.</p> + +<h2 id="npm-update-1"><a href="update.html">update</a></h2> + +<p>This command will update all the packages listed to the latest version +(specified by the <code>tag</code> config).</p> + +<h2 id="npm-version-1"><a href="version.html">version</a></h2> + +<p>Run this in a package directory to bump the version and write the new +data back to the package.json file.</p> + +<h2 id="npm-view-1"><a href="view.html">view</a></h2> + +<p>This command shows data about a package and prints it to the stream +referenced by the <code>outfd</code> config, which defaults to stdout.</p> + +<h2 id="npm-whoami-1"><a href="whoami.html">whoami</a></h2> + +<p>Print the <code>username</code> config to standard output.</p> +</div> +<p id="footer">index — npm@1.0.28-pre-DEV-UNSTABLE</p> +<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.innerText || el.text || el.innerHTML) + + "</a>" + return out +}).join("\n") +toc.id = "toc" +document.body.appendChild(toc) +})() +</script> +</body></html> diff --git a/man1/index.1 b/man1/index.1 new file mode 100644 index 000000000..d38df1525 --- /dev/null +++ b/man1/index.1 @@ -0,0 +1,185 @@ +.\" Generated with Ronnjs/v0.1 +.\" http://github.com/kapouer/ronnjs/ +. +.IP "\(bu" 4 +\|\./adduser\.html +. +.IP "\(bu" 4 +\|\./author\.html +. +.IP "\(bu" 4 +\|\./bin\.html +. +.IP "\(bu" 4 +\|\./build\.html +. +.IP "\(bu" 4 +\|\./bundle\.html +. +.IP "\(bu" 4 +\|\./cache\.html +. +.IP "\(bu" 4 +\|\./changelog\.html +. +.IP "\(bu" 4 +\|\./coding\-style\.html +. +.IP "\(bu" 4 +\|\./completion\.html +. +.IP "\(bu" 4 +\|\./config\.html +. +.IP "\(bu" 4 +\|\./deprecate\.html +. +.IP "\(bu" 4 +\|\./developers\.html +. +.IP "\(bu" 4 +\|\./docs\.html +. +.IP "\(bu" 4 +\|\./edit\.html +. +.IP "\(bu" 4 +\|\./explore\.html +. +.IP "\(bu" 4 +\|\./faq\.html +. +.IP "\(bu" 4 +\|\./folders\.html +. +.IP "\(bu" 4 +\|\./get\.html +. +.IP "\(bu" 4 +\|\./global\.html +. +.IP "\(bu" 4 +\|\./help\-search\.html +. +.IP "\(bu" 4 +\|\./help\.html +. +.IP "\(bu" 4 +\|\./home\.html +. +.IP "\(bu" 4 +\|\./init\.html +. +.IP "\(bu" 4 +\|\./install\.html +. +.IP "\(bu" 4 +\|\./json\.html +. +.IP "\(bu" 4 +\|\./link\.html +. +.IP "\(bu" 4 +\|\./list\.html +. +.IP "\(bu" 4 +\|\./ln\.html +. +.IP "\(bu" 4 +\|\./ls\.html +. +.IP "\(bu" 4 +\|\./npm\.html +. +.IP "\(bu" 4 +\|\./outdated\.html +. +.IP "\(bu" 4 +\|\./owner\.html +. +.IP "\(bu" 4 +\|\./pack\.html +. +.IP "\(bu" 4 +\|\./prefix\.html +. +.IP "\(bu" 4 +\|\./prune\.html +. +.IP "\(bu" 4 +\|\./publish\.html +. +.IP "\(bu" 4 +\|\./rebuild\.html +. +.IP "\(bu" 4 +\|\./registry\.html +. +.IP "\(bu" 4 +\|\./removing\-npm\.html +. +.IP "\(bu" 4 +\|\./restart\.html +. +.IP "\(bu" 4 +\|\./rm\.html +. +.IP "\(bu" 4 +\|\./root\.html +. +.IP "\(bu" 4 +\|\./run\-script\.html +. +.IP "\(bu" 4 +\|\./scripts\.html +. +.IP "\(bu" 4 +\|\./search\.html +. +.IP "\(bu" 4 +\|\./semver\.html +. +.IP "\(bu" 4 +\|\./set\.html +. +.IP "\(bu" 4 +\|\./start\.html +. +.IP "\(bu" 4 +\|\./stop\.html +. +.IP "\(bu" 4 +\|\./submodule\.html +. +.IP "\(bu" 4 +\|\./tag\.html +. +.IP "\(bu" 4 +\|\./test\.html +. +.IP "\(bu" 4 +\|\./uninstall\.html +. +.IP "\(bu" 4 +\|\./unpublish\.html +. +.IP "\(bu" 4 +\|\./update\.html +. +.IP "\(bu" 4 +\|\./version\.html +. +.IP "\(bu" 4 +\|\./view\.html +. +.IP "\(bu" 4 +\|\./whoami\.html +. +.IP "\(bu" 4 +\|\./README\.html +. +.IP "\(bu" 4 +\|\./index\.html +. +.IP "" 0 + diff --git a/scripts/index-build.js b/scripts/index-build.js new file mode 100644 index 000000000..7d60a1775 --- /dev/null +++ b/scripts/index-build.js @@ -0,0 +1,34 @@ +#!/usr/bin/env node +var fs = require("fs") + , path = require("path") + , docdir = path.resolve(__dirname, "..", "doc") + +console.log( + "npm-index(1) -- Index of all npm documentation files\n" + + "====================================================\n\n") +fs.readdir(docdir, function (er, docs) { + if (er) throw er + docs.filter(function (d) { + return d !== "index.md" + && d.charAt(0) !== "." + && d.match(/\.md$/) + }).forEach(function (d) { + var doc = path.resolve(docdir, d) + , s = fs.lstatSync(doc) + , content = fs.readFileSync(doc, "utf8").split("\n\n") + , syn + , desc + + if (s.isSymbolicLink()) return + + content.forEach(function (c, i) { + c = c.trim() + //console.log([c, i]) + if (c === "## SYNOPSIS") syn = content[i + 1] + if (c === "## DESCRIPTION") syn = content[i + 1] + }) + console.log(d.replace(/^(.*)\.md$/, "## npm-$1(1)") + "\n") + if (desc) console.log(desc + "\n") + else if (syn) console.log(syn + "\n") + }) +}) |