# Module edoc_lib

Utility functions for EDoc.

Copyright © 2001-2003 Richard Carlsson

- Description
- Data Types
- Function Index
- Function Details

Authors: Richard Carlsson (`richardc@csd.uu.se`).

See also: edoc.

## Description

Utility functions for EDoc.

## Data Types

### edoc_env()

abstract datatype: `edoc_env()`

Environment information needed by EDoc for generating references. The data representation is not documented.

### info()

`info() = #info{name = string(), mail = string(), uri = string()}`

## Function Index

copy_dir/2 |
copy_file/2 |
count/2 |
escape_uri/1 |
filename/1 |
find_doc_dirs/0 |
find_file/3 |
find_sources/2 |
find_sources/3 | See `edoc:run/3` for a description of the options `subpackages`, `source_suffix` and `exclude_packages`.
get_doc_env/1 | Equivalent to `get_doc_env([], [], [], Opts)`.
get_doc_env/4 | Creates an environment data structure used by parts of EDoc for generating references, etc.
get_first_sentence/1 |
is_name/1 |
is_relative_uri/1 |
is_space/1 |
join_uri/2 |
lines/1 |
parse_contact/2 | EDoc "contact information" parsing.
parse_expr/2 | EDoc Erlang expression parsing.
read_info_file/1 |
run_doclet/2 | See `edoc:run/3` for a description of the `doclet` option.
run_layout/2 | See `edoc:layout/2` for a description of the `layout` option.
segment/2 |
simplify_path/1 |
split_at/2 |
split_at_stop/1 |
strip_space/1 |
to_label/1 |
transpose/1 |
try_subdir/2 |
unique/1 |
uri_get/1 |
write_file/3 | Write the given `Text` to the file named by `Name` in directory `Dir`.
write_file/4 | Like `write_file/3`, but adds path components to the target directory corresponding to the specified package.
write_info_file/4 |

## Function Details

### copy_dir/2

`copy_dir(From, To) -> term()`

### copy_file/2

`copy_file(From, To) -> term()`

### count/2

`count(X, Xs) -> term()`

### escape_uri/1

`escape_uri(Cs) -> term()`

### filename/1

`filename(T) -> term()`

### find_doc_dirs/0

`find_doc_dirs() -> term()`

### find_file/3

`find_file(Ps, Pkg, Name) -> term()`

### find_sources/2

`find_sources(Path, Opts) -> term()`

### find_sources/3

`find_sources(Path, Pkg, Opts) -> term()`

See `edoc:run/3` for a description of the options `subpackages`, `source_suffix` and `exclude_packages`.

### get_doc_env/1

`get_doc_env(Options::edoc:option_list()) -> edoc_env()`

Equivalent to `get_doc_env([], [], [], Opts)`.

### get_doc_env/4

`get_doc_env(App, Packages, Modules, Options::edoc:option_list()) -> edoc_env()`

- `App = [] | atom()`
- `Packages = [atom()]`
- `Modules = [atom()]`

Creates an environment data structure used by parts of EDoc for generating references, etc. See `edoc:run/3` for a description of the options `file_suffix`, `app_default` and `doc_path`.

See also: edoc:get_doc/3, edoc_extract:source/4.

### get_first_sentence/1

`get_first_sentence(Es) -> term()`

### is_name/1

`is_name(Cs) -> term()`

### is_relative_uri/1

`is_relative_uri(Cs) -> term()`

### is_space/1

`is_space(Cs) -> term()`

### join_uri/2

`join_uri(Base, Path) -> term()`

### lines/1

`lines(Cs) -> term()`

### parse_contact/2

`parse_contact(S, L) -> term()`

EDoc "contact information" parsing. This is the type of the content in e.g. `@author` tags.

### parse_expr/2

`parse_expr(S, L) -> term()`

EDoc Erlang expression parsing. For parsing things like the content of `@equiv` tags, and strings denoting file names, e.g. in @headerfile. Also used by `edoc_run`.

### read_info_file/1

`read_info_file(Dir) -> term()`

### run_doclet/2

`run_doclet(Fun, Opts) -> term()`

See `edoc:run/3` for a description of the `doclet` option.

### run_layout/2

`run_layout(Fun, Opts) -> term()`

See `edoc:layout/2` for a description of the `layout` option.

### segment/2

`segment(Es, N) -> term()`

### simplify_path/1

`simplify_path(P) -> term()`

### split_at/2

`split_at(Cs, K) -> term()`

### split_at_stop/1

`split_at_stop(Cs) -> term()`

### strip_space/1

`strip_space(Cs) -> term()`

### to_label/1

`to_label(Cs) -> term()`

### transpose/1

`transpose(Xss) -> term()`

### try_subdir/2

`try_subdir(Dir, Subdir) -> term()`

### unique/1

`unique(Xs) -> term()`

### uri_get/1

`uri_get(Path) -> term()`

### write_file/3

`write_file(Text::deep_string(), Dir::edoc:filename(), Name::edoc:filename()) -> ok`

Write the given `Text` to the file named by `Name` in directory `Dir`. If the target directory does not exist, it will be created.

### write_file/4

`write_file(Text::deep_string(), Dir::edoc:filename(), Name::edoc:filename(), Package::atom() | string()) -> ok`

Like `write_file/3`, but adds path components to the target directory corresponding to the specified package.

### write_info_file/4

`write_info_file(App, Packages, Modules, Dir) -> term()`