Skip to content
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

doc: Clean up roff source in manpage #7819

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 49 additions & 17 deletions doc/node.1
Original file line number Diff line number Diff line change
@@ -1,28 +1,54 @@
.TH NODE 1 2016 Node.js Node.js

.\ This is a man page comment.
.\ Man page syntax (actually troff syntax) is somewhat obscure, but the
.\ important part is is that .<letter> specifies <letter>'s syntax for that
.\ line, and \f<letter> specifies it for the characters that follow.
.\ See http://liw.fi/manpages/ for more info.
.\" This is a man page comment.
.
.\" Man page syntax (actually troff syntax) is somewhat obscure, but the
.\" important part is is that .<letter> specifies <letter>'s syntax for that
.\" line, and \f<letter> specifies it for the characters that follow.
.
.\" .B Bold line
.\" .I Italic line (Rendered as underlined text in terminals)
.\" .BI Alternating bold/italics without spaces between arguments.
.\" Use `\ ` to include an "unpaddable" (literal) space in the output.
.\" .RI Alternating roman/italic
.
.\" See http://liw.fi/manpages/ for an overview, or http://www.troff.org/54.pdf
.\" for detailed language reference.
.de ur
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.\" for detailed language reference.

.\" Macros

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what's being asked here... is this concerning the first or second line?

  1. I felt impelled to offer readers a link to a more authoritative resource on the language, as the former link, while helpful, is extremely limited and only covers very rudimentary aspects of the language.
  2. The macro is simply a cleaner way of formatting the links below. Ordinarily I would've used the .UR/.UE macros provided by Groff's an-ext.tmac, but I'm aware that this isn't available on all systems. I wanted to guarantee this manpage would pose no portability issues. Which is also the reason I named the macro .ur instead of .url, as classical troff didn't permit macro names longer than 2 characters.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I think we should add a comment about the macro, and probably a space above it, that is all. Sorry for the confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you want me to amend an explanation? :)

And as for the .fi request, did you want me to kill it off?

(Built-in language functions are what're known as "requests" in Roff terminology. User-defined routines constructed using requests are known as "macros". Both have identical syntax)

.nr CF \\n(.f
.ft 4
\\$1
.ft \\n(CF
..


.SH NAME

node \- Server-side JavaScript runtime


.SH SYNOPSIS

.fi
.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this do? (the .fi and then .)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.fi: That turns on filling mode, which I forgot is enabled by default. Turning it off with .nf would result in this:
figure-1

.: That's the safe way of inserting blank lines for readability in a roff document. Inserting a blank line-break without a control-character tells the interpreter that the line is to be interpreted as content, and it adds another line-break onto the output (which is moot if filling-mode is enabled anyway).

.B node
[\fIoptions\fR] [\fIv8 options\fR]
[\fIscript.js\fR | \fB\-e \fR"\fIscript\fR"]
[\fIarguments\fR]
.RI [ options ]
.RI [ v8\ options ]
.RI [ script.js \ |
.B -e
.RI \&" script \&"]
.RI [ arguments ]
.br
.
.B node debug
[\fIscript.js\fR | \fB\-e \fR"\fIscript\fR" | \fI<host>:<port>\fR] \fI...
.RI [ script.js " | "
.B \-e
.RI \&" script \&"\ |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't just be \"?

Copy link
Contributor Author

@Alhadis Alhadis Jul 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because the \" sequence initiates a comment, resulting in the rest of the line being dropped.

The \& is basically Roff's escaping mechanism for certain characters.

.IR <host>:<port> ]
.I ...
.br
.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .br is just a way of forcing a line-break. :)

.B node
[\fB\-\-v8-options\fR]
.RB [ \-\-v8-options ]

Execute without arguments to start the REPL.

Expand Down Expand Up @@ -172,14 +198,20 @@ value to an empty string ("" or " ") disables persistent REPL history.

.SH RESOURCES AND DOCUMENTATION

Website: \fBhttps://nodejs.org/\fR
Website:
.ur https://nodejs.org/

Documentation: \fBhttps://nodejs.org/api/\fR
Documentation:
.ur https://nodejs.org/api/

GitHub repository & Issue Tracker: \fBhttps://github.com/nodejs/node\fR
GitHub repository & Issue Tracker:
.ur https://github.com/nodejs/node

Mailing list: \fBhttp://groups.google.com/group/nodejs\fR
Mailing list:
.ur http://groups.google.com/group/nodejs

IRC (general questions): \fBchat.freenode.net #node.js\fR
IRC (general questions):
.ur "chat.freenode.net #node.js"

IRC (node core development): \fBchat.freenode.net #node-dev\fR
IRC (node core development):
.ur "chat.freenode.net #node-dev"