Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,6 @@ jobs:

- run: mix format --check-formatted
if: ${{ matrix.lint }}

- run: mix docs --warnings-as-errors
if: ${{ matrix.lint }}
7 changes: 7 additions & 0 deletions lib/ex_doc.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@ defmodule ExDoc do
@moduledoc """
Main entry point for generating docs.
"""

@ex_doc_version Mix.Project.config()[:version]

@typedoc """
Documentation AST.
"""
# Resolves to t:ExDoc.DocAST.t/0 (a public type of a hidden module)
@type doc_ast() :: term()

@doc """
Returns the ExDoc version (used in templates).
"""
Expand Down
5 changes: 2 additions & 3 deletions lib/ex_doc/language.ex
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ defmodule ExDoc.Language do
%{
id_key: binary(),
default_group: binary(),
doc_fallback: (-> ExDoc.DocAST.t()),
doc_fallback: (-> ExDoc.doc_ast()),
extra_annotations: [String.t()],
signature: [binary()],
source_file: String.t() | nil,
Expand All @@ -91,8 +91,7 @@ defmodule ExDoc.Language do
@doc """
Autolinks docs.
"""
@callback autolink_doc(doc :: ExDoc.DocAST.t(), config :: ExDoc.Autolink.t()) ::
ExDoc.DocAST.t()
@callback autolink_doc(doc :: ExDoc.doc_ast(), config :: ExDoc.Autolink.t()) :: ExDoc.doc_ast()

@doc """
Autolinks typespecs.
Expand Down
10 changes: 5 additions & 5 deletions lib/ex_doc/nodes.ex
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ defmodule ExDoc.ModuleNode do
module: module(),
group: atom() | nil,
deprecated: String.t() | nil,
doc: ExDoc.DocAST.t() | nil,
doc: ExDoc.doc_ast() | nil,
source_doc: term() | nil,
source_format: String.t() | nil,
moduledoc_line: non_neg_integer(),
Expand Down Expand Up @@ -81,7 +81,7 @@ defmodule ExDoc.DocNode do
arity: non_neg_integer(),
defaults: [function_default()],
deprecated: String.t() | nil,
doc: ExDoc.DocAST.t() | nil,
doc: ExDoc.doc_ast() | nil,
source_doc: term() | nil,
type: atom(),
signature: String.t(),
Expand All @@ -104,7 +104,7 @@ defmodule ExDoc.DocGroupNode do
@type t :: %__MODULE__{
title: String.t() | atom(),
description: String.t() | nil,
doc: ExDoc.DocAST.t() | nil,
doc: ExDoc.doc_ast() | nil,
docs: [ExDoc.DocNode.t()]
}
end
Expand All @@ -128,10 +128,10 @@ defmodule ExDoc.ExtraNode do
@type t :: %__MODULE__{
id: String.t(),
title: String.t(),
title_doc: ExDoc.DocAST.t() | String.t(),
title_doc: ExDoc.doc_ast() | String.t(),
group: atom() | nil,
type: atom(),
doc: ExDoc.DocAST.t() | nil,
doc: ExDoc.doc_ast() | nil,
source_doc: String.t(),
source_path: String.t(),
source_url: String.t(),
Expand Down
Loading