add manual pages

Ignore-this: f0ef7ee2bd303c71918217b9ce97f587

darcs-hash:20110802173427-c41ad-1d9a1fb885a4ca91cfbf53187d210ca7ab1eea37
This commit is contained in:
Jeremie Dimino 2011-08-02 19:34:27 +02:00
parent 5156bee455
commit d275ba65a5
4 changed files with 291 additions and 1 deletions

24
_oasis
View File

@ -41,6 +41,30 @@ Executable "utop-emacs"
BuildDepends: utop, findlib, lambda-term, lwt.syntax, threads
DataFiles: utop.el ($datadir/emacs/site-lisp)
# +-------------------------------------------------------------------+
# | Manual pages |
# +-------------------------------------------------------------------+
Document "utop-man"
Type: custom (0.2)
Title: Man page for utop
Install: true
BuildTools: gzip
XCustom: $gzip -c man/utop.1 > man/utop.1.gz
XCustomClean: $rm man/utop.1.gz
DataFiles: man/utop.1.gz
InstallDir: $mandir/man1
Document "utoprc-man"
Type: custom (0.2)
Title: Man page for utoprc
Install: true
BuildTools: gzip
XCustom: $gzip -c man/utoprc.5 > man/utoprc.5.gz
XCustomClean: $rm man/utoprc.5.gz
DataFiles: man/utoprc.5.gz
InstallDir: $mandir/man5
# +-------------------------------------------------------------------+
# | Misc |
# +-------------------------------------------------------------------+

121
man/utop.1 Normal file
View File

@ -0,0 +1,121 @@
\" utop.1
\" ------
\" Copyright : (c) 2011, Jeremie Dimino <jeremie@dimino.org>
\" Licence : BSD3
\"
\" This file is a part of utop.
.TH UTOP 1 "August 2011"
.SH NAME
utop \- Universal toplevel for OCaml
.SH SYNOPSIS
.B utop
[
.I options
]
[
.I object-files
]
[
.I script-file
]
.SH DESCRIPTION
.B utop
is a enhanced toplevel for OCaml with many features, including context
sensitive completion.
When you start
.B utop
what you see is the prompt followed by a bar containing words. This is
the completion bar, it contains the possible completion and is updated
as you type. The highlighted word in the completion bar is the
selected word. You can navigate using the keys Alt+Left and Alt+Right
and you can complete using the currently selected word by pressing
Alt+Tab (you can configure these bindings in the file
.I ~/.lambda-term-inputrc
, see
.BR lambda-term-inputrc (5)
for details).
utop support completion on:
* directives and directive arguments
* identifiers
* record fields
* variants
* function labels
* object methods
Colors are by default configured for terminals with dark colors, such
as white on black, so the prompt may looks too bright on light colors
terminals. You can change that by setting the color profile of
utop. For that type:
UTop.set_profile UTop.Light;;
You can then add this line to your
.I ~/.ocamlinit
file.
You can enable basic syntax highlighting in utop by writing a
.I ~/.utoprc
file. See
.BR utoprc (5)
for that.
Finally utop can run in emacs. For that you have to add the following line to your
.I ~/.emacs
file:
(autoload 'utop "utop" "Toplevel for OCaml" t)
then you can run utop by pressing M-x and typing "utop". utop support
completion in emacs mode. Just press Tab to complete a word. You can
also integrate it with the tuareg mode. For that add the following
lines to your
.I ~/.emacs
file:
(autoload 'utop-eval-region "utop" "Toplevel for OCaml" t)
(autoload 'utop-eval-phrase "utop" "Toplevel for OCaml" t)
(autoload 'utop-eval-buffer "utop" "Toplevel for OCaml" t)
(defun tuareg-utop-hook ()
(local-set-key "\\M-\\C-x" 'utop-eval-phrase)
(local-set-key "\\C-x\\C-e" 'utop-eval-phrase)
(local-set-key "\\C-c\\C-e" 'utop-eval-phrase)
(local-set-key "\\C-c\\C-r" 'utop-eval-region)
(local-set-key "\\C-c\\C-b" 'utop-eval-buffer))
(add-hook 'tuareg-mode-hook 'tuareg-utop-hook)
.SH OPTIONS
Same as
.BR ocaml (1).
.SH FILES
.I ~/.ocamlinit
.RS
The initialization file of the toplevel.
.RE
.I ~/.utoprc
.RS
The configuration file for utop. See
.BR utoprc (5).
.RE
.I ~/.lambda-term-inputrc
.RS
The file containing key bindings. See
.BR lambda-term-inputrc (5).
.SH AUTHOR
Jérémie Dimino <jeremie@dimino.org>
.SH "SEE ALSO"
.BR utoprc (5),
.BR lambda-term-inputrc (5),
.BR ocaml (1).

144
man/utoprc.5 Normal file
View File

@ -0,0 +1,144 @@
\" utoprc.5
\" --------
\" Copyright : (c) 2011, Jeremie Dimino <jeremie@dimino.org>
\" Licence : BSD3
\"
\" This file is a part of utop.
.TH UTOPRC 5 "August 2011"
.SH NAME
utoprc \- Configuration file of utop
.SH SYNOPSIS
.B ~/.utoprc
.SH DESCRIPTION
This manual page describes the format of the
.I ~/.utoprc
file. This is a text file which contains the configuration of
utop. Comments start with a '!' and empty lines are
ignored. Configuration lines are of the form:
<wildcard>: <value>
.I <wildcard>
may contains the '*' star character. In that case any key which match
the pattern is given the value after the colon.
The key
.I profile
may have the value
.I dark
or
.I light.
This is the same as calling
.I UTop.set_profile
in
.I ~/.ocamlinit.
The following style keys are used by utop:
* identifier
* comment
* doc
* constant
* keyword
* symbol
* string
* char
* quotation
* error
* parenthesis
For each of these keys, the following sub-keys are used:
* key.foreground
* key.background
* key.bold
* key.underline
* key.reverse
* key.blink
.I key.foreground
and
.I key.background
are colors, and the others are booleans. Colors may be one of the
standard terminal colors:
* black
* red
* green
* yellow
* blue
* magenta
* cyan
* white
* light-black
* light-red
* light-green
* light-yellow
* light-blue
* light-magenta
* light-cyan
* light-white
or X11 colors, prefixed with "x-". For example:
identifier.foreground: x-goldenrod
Colors can also be given by their RGB components, written #RRGGBB. For
example:
identifier.foreground: #5fbf7f
utop will choose the nearest color of the terminal when specifying a
X11 color or a color given by its RGB components. If you are using
gnome-terminal, you can enable 256 colors by setting the environment
variable TERM to "xterm-256color".
.SH FILES
.I ~/.utoprc
.SH EXAMPLE
profile: dark
.RS
.RE
identifier.foreground: none
.RS
.RE
comment.foreground: x-chocolate1
.RS
.RE
doc.foreground: x-light-salmon
.RS
.RE
constant.foreground: x-aquamarine
.RS
.RE
keyword.foreground: x-cyan1
.RS
.RE
symbol.foreground: x-cyan1
.RS
.RE
string.foreground: x-light-salmon
.RS
.RE
char.foreground: x-light-salmon
.RS
.RE
quotation.foreground: x-purple
.RS
.RE
error.foreground: x-red
.RS
.RE
parenthesis.background: blue
.SH AUTHOR
Jérémie Dimino <jeremie@dimino.org>
.SH "SEE ALSO"
.BR utop (1).

View File

@ -126,7 +126,8 @@ You can use the following commands to get more help:
#utop_bindings : list all the current key bindings
#utop_macro : display the currently recorded macro
"));
For a complete description of utop, look at the utop(1) manual page."));
Hashtbl.add Toploop.directive_table "utop_bindings"
(Toploop.Directive_none