summaryrefslogtreecommitdiff
path: root/lib/edoc/include
diff options
context:
space:
mode:
authorRadek Szymczyszyn <radoslaw.szymczyszyn@erlang-solutions.com>2020-12-07 15:38:30 +0100
committerRadek Szymczyszyn <radoslaw.szymczyszyn@erlang-solutions.com>2020-12-21 10:23:02 +0100
commit07d71c6532b916600c0598758f8684c18418307d (patch)
tree9a23f4c573404afc21004ce0296a2f9e61520678 /lib/edoc/include
parent0b8d5c550dbb82ad635e54b3bf30d5b026c8ca97 (diff)
downloaderlang-07d71c6532b916600c0598758f8684c18418307d.tar.gz
Replace @spec/@type tags with corresponding attributes
This also moves types from header files to modules, so that they're namespaced. @spec/@type syntax allows to specify an application that is referrred to (e.g. `//syntax_tools/erl_syntax:forms()`), whereas the -spec/-type attribute syntax doesn't. In order to keep links generated by EDoc valid, an app name inference mechanism is introduced, which works based on the modules currently available in the code path. This allows to use specs/types which refer to types defined outside the current application and make sure EDoc will generate proper external links.
Diffstat (limited to 'lib/edoc/include')
-rw-r--r--lib/edoc/include/edoc_doclet.hrl33
1 files changed, 5 insertions, 28 deletions
diff --git a/lib/edoc/include/edoc_doclet.hrl b/lib/edoc/include/edoc_doclet.hrl
index a05a9cb2bc..c15ba13aad 100644
--- a/lib/edoc/include/edoc_doclet.hrl
+++ b/lib/edoc/include/edoc_doclet.hrl
@@ -28,36 +28,13 @@
-define(NO_APP, []).
-%% Context for doclets
-
-%% @type edoc_context() = #context{dir = string(),
-%% env = edoc_lib:edoc_env(),
-%% opts = [term()]}
-
--record(context, {dir = "",
- env,
- opts = []}).
-
-%% Doclet commands
-
-%% @type no_app().
-%% A value used to mark absence of an Erlang application
-%% context. Use the macro `NO_APP' defined in
-%% <a href="edoc_doclet.hrl">`edoc_doclet.hrl'</a>
-%% to produce this value.
-
-%% @type doclet_gen() = #doclet_gen{sources = [string()],
-%% app = no_app() | atom(),
-%% modules = [atom()]}
+-record(doclet_context, {dir = "",
+ env,
+ opts = []}).
-record(doclet_gen, {sources = [],
app = ?NO_APP,
- modules = []
- }).
-
-%% @type doclet_toc() = #doclet_gen{paths = [string()],
-%% indir = string()}
+ modules = []}).
-record(doclet_toc, {paths,
- indir
- }).
+ indir}).