Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
folder structure change
Browse files Browse the repository at this point in the history
doc/{cli,api}
man/{man1,man3}
  • Loading branch information
isaacs committed Aug 23, 2011
1 parent 001b6d0 commit 5021c4d
Show file tree
Hide file tree
Showing 208 changed files with 48 additions and 31 deletions.
30 changes: 12 additions & 18 deletions Makefile
@@ -1,12 +1,12 @@
SHELL = bash

cli_docs = $(shell find doc -name '*.md' \
cli_docs = $(shell find doc/cli -name '*.md' \
|sed 's|.md|.1|g' \
|sed 's|doc/|man1/|g' )
|sed 's|doc/cli/|man/man1/|g' )

api_docs = $(shell find api-doc -name '*.md' \
api_docs = $(shell find doc/api -name '*.md' \
|sed 's|.md|.3|g' \
|sed 's|api-doc/|man3/|g' )
|sed 's|doc/api/|man/man3/|g' )

cli_doc_subfolders = $(shell find doc -type d \
|sed 's|doc/|man1/|g' )
Expand Down Expand Up @@ -41,31 +41,25 @@ clean: uninstall
uninstall: submodules
node cli.js rm npm -g -f

man: man1 man3
doc: man

man1: $(cli_doc_subfolders)
[ -d man1 ] || mkdir -p man1
man: man/man1 man/man3

man3: $(api_doc_subfolders)
[ -d man3 ] || mkdir -p man3
man/man1: $(cli_docs)
[ -d man/man1 ] || mkdir -p man/man1

doc: man1 $(cli_docs) man3 $(api_docs)
man/man3: $(api_docs)
[ -d man/man3 ] || mkdir -p man/man3

# use `npm install ronn` for this to work.
man1/%.1: doc/%.md
man/man1/%.1: doc/cli/%.md
@[ -x ./node_modules/.bin/ronn ] || node cli.js install ronn
./node_modules/.bin/ronn --roff $< > $@

man1/%/: doc/%/
@[ -d $@ ] || mkdir -p $@

man3/%.3: api-doc/%.md
man/man3/%.3: doc/api/%.md
@[ -x ./node_modules/.bin/ronn ] || node cli.js install ronn
./node_modules/.bin/ronn --roff $< > $@

man3/%/: api-doc/%/
@[ -d $@ ] || mkdir -p $@

test: submodules
node cli.js test

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/help-search.js
Expand Up @@ -5,7 +5,7 @@ var fs = require("graceful-fs")
, output = require("./utils/output.js")
, path = require("path")
, asyncMap = require("slide").asyncMap
, docsPath = path.join(__dirname, "..", "doc")
, docsPath = path.join(__dirname, "..", "doc", "cli")
, log = require("./utils/log.js")
, npm = require("../npm.js")

Expand Down
6 changes: 3 additions & 3 deletions lib/help.js
Expand Up @@ -26,13 +26,13 @@ function help (args, cb) {
npm.config.set("loglevel", "silent")
return output.write(npm.commands[section].usage, cb)
}
var section_path = path.join(__dirname, "../man1/"+section+".1")
var section_path = path.join(__dirname, "../man/man1/"+section+".1")
return fs.stat
( section_path
, function (e, o) {
if (e) return npm.commands["help-search"](args, cb)

var manpath = path.join(__dirname, "..")
var manpath = path.join(__dirname, "..", "man")
, env = {}
Object.keys(process.env).forEach(function (i) { env[i] = process.env[i] })
env.MANPATH = manpath
Expand Down Expand Up @@ -85,7 +85,7 @@ function wrap (arr) {
}

function getSections(cb) {
fs.readdir(path.join(__dirname, "../man1/"), function (er, files) {
fs.readdir(path.join(__dirname, "../man/man1/"), function (er, files) {
if (er) return cb(er)
var sectionList = files.concat("help.1")
.filter(function (s) { return s.match(/\.1$/) })
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 24 additions & 7 deletions man1/faq.1 → man/man1/faq.1
Expand Up @@ -156,6 +156,9 @@ e) a \fB<name>@<tag>\fR that points to (d)
.IP "\(bu" 4
f) a \fB<name>\fR that has a "latest" tag satisfying (e)
.
.IP "\(bu" 4
g) a \fBgit\fR url that, when cloned, results in (a)\.
.
.IP "" 0
.
.P
Expand All @@ -164,6 +167,25 @@ benefits of using npm if you just want to write a node program (a), and
perhaps if you also want to be able to easily install it elsewhere
after packing it up into a tarball (b)\.
.
.P
Git urls can be of the form:
.
.IP "" 4
.
.nf
git://github\.com/user/project\.git#commit\-ish
git+ssh://user@hostname:project\.git#commit\-ish
git+http://user@hostname/project/blah\.git#commit\-ish
git+https://user@hostname/project/blah\.git#commit\-ish
.
.fi
.
.IP "" 0
.
.P
The \fBcommit\-ish\fR can be any tag, sha, or branch which can be supplied as
an argument to \fBgit checkout\fR\|\. The default is \fBmaster\fR\|\.
.
.SH "How do I install node with npm?"
You don\'t\. Try one of these:
.
Expand All @@ -190,13 +212,8 @@ To set up your own private registry, check out \fBnpm help registry\fR\|\.
.
.SH "Can I list a url as a dependency?"
Yes\. It should be a url to a gzipped tarball containing a single folder
that has a package\.json in its root\. (See "what is a package?" above\.)
.
.SH "OK, but can I list a git repo as a dependency?"
No\.
.
.P
However, you can list a url as a dependency\.
that has a package\.json in its root, or a git url\.
(See "what is a package?" above\.)
.
.SH "How do I symlink to a dev folder so I don\'t have to keep re\-installing?"
See \fBnpm help link\fR
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 7 additions & 1 deletion man1/scripts.1 → man/man1/scripts.1
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
.TH "NPM\-SCRIPTS" "1" "July 2011" "" ""
.TH "NPM\-SCRIPTS" "1" "August 2011" "" ""
.
.SH "NAME"
\fBnpm-scripts\fR \-\- How npm handles the "scripts" field
Expand Down Expand Up @@ -83,6 +83,12 @@ default the \fBpreinstall\fR command to compile using node\-waf\.
.
.IP "" 0
.
.SH "USER"
If npm was invoked with root privileges, then it will change the uid to
the user account or uid specified by the \fBuser\fR config, which defaults
to \fBnobody\fR\|\. Set the \fBunsafe\-perm\fR flag to run scripts with root
privileges\.
.
.SH "ENVIRONMENT"
Package scripts run in an environment where many pieces of information are
made available regarding the setup of npm and the current state of the
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -15,7 +15,7 @@
, "web" : "http://github.com/isaacs/npm/issues"
}
, "directories" : { "doc" : "./doc"
, "man" : "./man1"
, "man" : "./man"
, "lib" : "./lib"
, "bin" : "./bin"
}
Expand Down

0 comments on commit 5021c4d

Please sign in to comment.