We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Formatting Elixir Doctests with a Custom Plugin
212
clicks
Source: angelika.me
Angelika Tyborska shared her development of a plugin named Doctest Formatter after receiving a request from a fellow developer. This plugin enables users to format Elixir code blocks specifically for doctests within their documentation. The plugin, which works with Elixir version 1.13.2 or higher, can be easily installed by adding it to the dependencies in 'mix.exs' and updating the '.formatter.exs' config file. Once installed, the user simply runs 'mix format' to format both their '.ex' files and the Elixir code in doctests located within '@doc' and '@moduledoc' attributes. The formatter also adjusts 'iex>' prompts to use '...' for lines following the first. While effective for static values in doctests, the plugin acknowledges some known limitations, inviting users to report any encountered bugs via its GitHub issue tracker.
Related posts
© HashMerge 2024