SnakeBridge.Docs.MarkdownConverter (SnakeBridge v0.11.0)
View SourceConverts parsed Python docstrings to Elixir ExDoc Markdown format.
This module transforms structured docstring data into Markdown that is compatible with ExDoc and follows Elixir documentation conventions.
Summary
Functions
Converts a parsed docstring structure to ExDoc Markdown format.
Converts a Python doctest example to Elixir iex format.
Converts a Python exception type to an Elixir exception module.
Converts a Python type annotation to an Elixir typespec format.
Functions
Converts a parsed docstring structure to ExDoc Markdown format.
Parameters
parsed- A map with keys::short_description,:long_description,:params,:returns,:raises,:examples
Returns
A Markdown string suitable for use in @doc or @moduledoc.
Converts a Python doctest example to Elixir iex format.
Examples
iex> MarkdownConverter.convert_example(">>> func(1, 2)\n3")
" iex> func(1, 2)\n 3"
Converts a Python exception type to an Elixir exception module.
Examples
iex> MarkdownConverter.convert_exception("ValueError")
"ArgumentError"
Converts a Python type annotation to an Elixir typespec format.
Examples
iex> MarkdownConverter.convert_type("int")
"integer()"
iex> MarkdownConverter.convert_type("list[str]")
"list(String.t())"