View Source ExDoc.Formatter.JSON (ExDocJSON v0.2.1)

Generates JSON documentation for Elixir projects

The ExDoc JSON formatter starts with some information at the top:

Top-level information

  • about - Indicates the version of the JSON structure format.
  • name - Project name
  • version - Project version
  • description - Project summary description
  • homepage_url - Specifies the project's home page
  • language - Identifies the primary language of the documents.
  • icon - Identifies the URL of the project's logo
  • items - This JSON object contains modules, exceptions, protocols, Mix tasks, and extras details.

Modules, Exceptions, Protocols, Behaviours, and Mix tasks

Each component is an array that includes:

  • module - Module name
  • title - Module title
  • source_doc - Module documentation summary
  • doc_line - Line number where the module documentation starts
  • source_path - Path to the source code file in the project
  • source_url - URL to the source code
  • type - Specifies if the component is a module, exception, etc.

Function, callback, and type details

  • arity- Function arity
  • defaults - Default argument values
  • source_doc - Function documentation
  • doc_line - Line number where the module documentation starts
  • source_path - Path to the source code file in the project
  • source_url - URL to the source code
  • signature - Indicates the function signature
  • annotations - Show annotations

Extras

This JSON object include the following fields:

  • id - Identifier
  • title - Document title
  • group - Specifies the group
  • source - The document content in the source format
  • source_path - Path of the original document
  • source_url - URL of the original document

Summary

Functions

Link to this function

run(project_nodes, config)

View Source
@spec run(
  [ExDoc.ModuleNode.t()] | {[ExDoc.ModuleNode.t()], [ExDoc.ModuleNode.t()]},
  ExDoc.Config.t()
) :: String.t()