Skip to content

Commit 1f1a8a7

Browse files
committed
Add more code comments to modules and TODOs
1 parent e622438 commit 1f1a8a7

File tree

7 files changed

+14
-5
lines changed

7 files changed

+14
-5
lines changed

lib/ex_doc/autolink.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
defmodule ExDoc.Autolink do
2+
# Encapsulates all functionality related to autolinking.
23
@moduledoc false
34

45
# * `:apps` - the apps that the docs are being generated for. When linking modules they are

lib/ex_doc/doc_ast.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
defmodule ExDoc.DocAST do
2+
# General helpers for dealing with the documentation AST
3+
# (which is the Markdown -> HTML AST).
24
@moduledoc false
35

46
@type t :: term()

lib/ex_doc/formatter/html/templates.ex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ defmodule ExDoc.Formatter.HTML.Templates do
163163
[sections: sections]
164164
end
165165

166-
# TODO: split into sections in Formatter.HTML instead.
166+
# TODO: split into sections in Formatter.HTML instead (possibly via DocAST)
167167
@h2_regex ~r/<h2.*?>(.*?)<\/h2>/m
168168
defp extract_headers(content) do
169169
@h2_regex
@@ -193,8 +193,9 @@ defmodule ExDoc.Formatter.HTML.Templates do
193193
defp sidebar_type(:livemd), do: "extras"
194194
defp sidebar_type(:extra), do: "extras"
195195

196-
# TODO: Move link_headings and friends to html.ex or even to autolinking code,
197-
# so content is built with it upfront instead of added at the template level.
196+
# TODO: Move link_headings and friends to html.ex (possibly via DocAST)
197+
# or even to autolinking code, so content is built with it upfront instead
198+
# of added at the template level.
198199

199200
@doc """
200201
Add link headings for the given `content`.

lib/ex_doc/group_matcher.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
defmodule ExDoc.GroupMatcher do
2+
# General helpers for dealing with grouping functionality.
3+
# Extracted for organization and testability.
24
@moduledoc false
35

46
@type pattern :: Regex.t() | module() | String.t()

lib/ex_doc/language/source.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
defmodule ExDoc.Language.Source do
2+
# Shared helpers used by both Erlang and Elixir.
23
@moduledoc false
34

45
def anno_line(line) when is_integer(line), do: abs(line)

lib/ex_doc/refs.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
defmodule ExDoc.Refs do
2-
@moduledoc false
3-
42
# A read-through cache of documentation references.
53
#
64
# A given ref is always associated with a module. If we don't have a ref
75
# in the cache we fetch the module's docs chunk and fill in the cache.
86
#
97
# If the module does not have the docs chunk, we fetch it's functions,
108
# callbacks and types from other sources.
9+
@moduledoc false
1110

1211
@typep entry() :: {ref(), visibility()}
1312

lib/ex_doc/utils.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
defmodule ExDoc.Utils do
2+
# General helpers used throughout ExDoc or extracted for testing.
3+
# Avoid adding functions to this module whenever possible,
4+
# instead prefer defining modules closer to the context they are used.
25
@moduledoc false
36

47
@doc """

0 commit comments

Comments
 (0)