aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edoc/src/edoc_refs.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-01-10 07:27:20 +0100
committerBjörn Gustavsson <[email protected]>2013-01-10 07:27:20 +0100
commit34d865a7dfdb33ee1e69fc28885f68baeeadfd98 (patch)
treeed59257e66ac052cbf6757f2219b3d1e71dcefac /lib/edoc/src/edoc_refs.erl
parenta409316b490b5d61a8d6a1d6acd764b61412ed4c (diff)
parent66846d0dbcb6e21c9d22a6e9096ff5e17850d346 (diff)
downloadotp-34d865a7dfdb33ee1e69fc28885f68baeeadfd98.tar.gz
otp-34d865a7dfdb33ee1e69fc28885f68baeeadfd98.tar.bz2
otp-34d865a7dfdb33ee1e69fc28885f68baeeadfd98.zip
Merge branch 'bjorn/remove-packages/OTP-10348'
* bjorn/remove-packages/OTP-10348: (22 commits) kernel: Remove the packages module kernel: Eliminate use of packages in code and code_server edoc: Remove support for packages syntax_tools: Remove support for packages reltool: Remove support for packages test_server: Remove support for packages sasl: Remove support for packages debugger: Remove support for packages c: Remove support for packages filename: Remove support for packages erl_pp_SUITE: Remove test of packages shell: Remove support for packages erl_parse: Remove support for packages qlc: Remove support for packages erl_eval: Remove support for packages erl_expand_records: Remove support for packages erl_lint: Remove support for packages compiler: Remove support for packages erts: Remove the packages aliases for BIFs erl_expand_records_SUITE: Eliminate use of packages ...
Diffstat (limited to 'lib/edoc/src/edoc_refs.erl')
-rw-r--r--lib/edoc/src/edoc_refs.erl19
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/edoc/src/edoc_refs.erl b/lib/edoc/src/edoc_refs.erl
index 1f578a3b83..ea439490ed 100644
--- a/lib/edoc/src/edoc_refs.erl
+++ b/lib/edoc/src/edoc_refs.erl
@@ -126,7 +126,7 @@ abs_uri({package, P}, Env) ->
module_ref(M, Env) ->
case (Env#env.modules)(M) of
"" ->
- File = packages:last(M) ++ Env#env.file_suffix,
+ File = atom_to_list(M) ++ Env#env.file_suffix,
Path = relative_module_path(M, Env#env.package),
join_uri(Path, escape_uri(File));
Base ->
@@ -134,8 +134,7 @@ module_ref(M, Env) ->
end.
module_absref(M, Env) ->
- join_segments(packages:split(M))
- ++ escape_uri(Env#env.file_suffix).
+ escape_uri(atom_to_list(M)) ++ escape_uri(Env#env.file_suffix).
package_ref(P, Env) ->
case (Env#env.packages)(P) of
@@ -147,7 +146,7 @@ package_ref(P, Env) ->
end.
package_absref(P, Env) ->
- join_uri(join_segments(packages:split(P)),
+ join_uri(escape_uri(atom_to_list(P)),
escape_uri(Env#env.package_summary)).
app_ref(A, Env) ->
@@ -179,14 +178,11 @@ join_segments([S | Ss]) ->
%% The empty string is returned if the To module has only one segment,
%% implying a local reference.
-relative_module_path(To, From) ->
- case first(packages:split(To)) of
- [] -> "";
- P -> relative_path(P, packages:split(From))
- end.
+relative_module_path(_To, _From) ->
+ "".
relative_package_path(To, From) ->
- relative_path(packages:split(To), packages:split(From)).
+ relative_path([atom_to_list(To)], [atom_to_list(From)]).
%% This takes two lists of path segments (From, To). Note that an empty
%% string will be returned if the paths are the same. Empty leading
@@ -210,6 +206,3 @@ relative_path_2([], []) ->
"";
relative_path_2([], Ts) ->
join_segments(Ts).
-
-first([H | T]) when T /= [] -> [H | first(T)];
-first(_) -> [].