Permalink
Browse files

doc: Generate edoc in doc/_build/edoc; fix some edoc tags.

  • Loading branch information...
1 parent cbf2fee commit 7b372ac509ca99544e4e8d3e3677fa62d0ef882a @arjan arjan committed Oct 29, 2012
@@ -32,28 +32,14 @@
%% @doc Convert an Erlang list or tuple to JSON
%% This function assumes that all strings of the input term are made of utf-8-encoded characters.
-%% @spec to_json(ErlangTerm, Context) -> Json
-%% Where:
-%% * ErlangTerm = list() | tuple()
-%% * Context = Zotonic context record
-%% * Json = the JSON content
+%% @spec to_json(list() | tuple(), #context{}) -> iodata()
to_json(Value, Context) ->
to_json(Value, "utf-8", Context).
%% @doc Convert an Erlang list or tuple to JSON
%% This function assumes that the all strings of the input term have the same
%% character encoding. This encoding may be UTF-8 or ISO 8859-1 (also called Latin-1).
-%% @spec to_json(ErlangTerm, Encoding, Context) -> Json
-%% Where:
-%% * ErlangTerm = list() | tuple()
-%% * Encoding = the character encoding of the strings in the input term.
-%% Following values are accepted:
-%% * "utf-8": ErlangTerm contains strings of UTF-8-encoded characters
-%% * "latin-1": ErlangTerm contains strings of ISO 8859-1 characters
-%% Note that this parameter concerns the strings in the input term only.
-%% The JSON output will always contain utf-8-encoded strings.
-%% * Context = Zotonic context record
-%% * Json = the JSON content
+%% @spec to_json(list() | tuple(), string(), #context{}) -> iodata()
to_json(Value, "latin-1", _Context) ->
mochijson:encode(z_convert:to_json(Value));
@@ -1,3 +1,22 @@
+%% @author Marc Worrell <marc@worrell.nl>
+%% @copyright 2012 Marc Worrell
+%% @doc Geomap tile support functions
+%% See http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#lon.2Flat_to_tile_numbers
+
+%% Copyright 2012 Marc Worrell
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+
-module(geomap_tiles).
-export([
@@ -17,9 +36,7 @@
-include("zotonic.hrl").
-%% From http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#lon.2Flat_to_tile_numbers
-
-%% @doc Default zoom factor for displaying the tiles
+%% Default zoom factor for displaying the tiles
-define(ZOOM, 14).
%% @doc Return the default zoom factor
@@ -35,8 +35,6 @@ main(_) ->
generate("modules/" ++ M, "modules/" ++ M) || M <- Modules
],
-
-%% generate("priv", "priv"),
io:format("Generated modules edoc files in ~p~n", [outpath("modules")]).
generate(InputDir, OutputDir) ->
@@ -45,6 +43,6 @@ generate(InputDir, OutputDir) ->
edoc:files(Files, [{dir, outpath(OutputDir)}]).
outpath(Component) ->
- Path = filename:join([os:getenv("ZOTONIC"), "doc", Component]),
+ Path = filename:join([os:getenv("ZOTONIC"), "doc", "_build", "edoc", Component]),
filelib:ensure_dir(filename:join([Path, ".empty"])),
Path.
@@ -195,7 +195,7 @@ unique1([_|T], Acc) ->
unique1(T, Acc).
-%% @spec generate_id(int()) -> string()
+%% @spec generate_id(boolean(), int()) -> string()
%% @doc Generate a random key
generate_id(IsUnique, Len) ->
[ case N of
@@ -206,7 +206,7 @@ generate_id(IsUnique, Len) ->
|| N <- random_list(IsUnique, 62, Len)
].
-%% @spec generate_identifier(int()) -> string()
+%% @spec generate_identifier(boolean(), int()) -> string()
%% @doc Generate a random identifier, case insensitive, only letters
generate_identifier(IsUnique, Len) ->
[ N + $a || N <- random_list(IsUnique, 26, Len) ].

0 comments on commit 7b372ac

Please sign in to comment.