API Reference SurfaceFormatter v0.7.5

Modules

Functions for formatting Surface code snippets.

A phase implementing a single "rule" for formatting code. These work as middleware between Surface.Compiler.Parser.parse and Surface.Formatter.Render.node/2 to modify node lists before they are rendered.

Handle exceptional case for blocks.

Add a newline after all of the nodes if one was present on the original input

Adds indentation nodes (:indent and :indent_one_less) where appropriate.

Standardizes usage of newlines.

Render the formatted Surface code after it has run through the other transforming phases.

In a variety of scenarios, converts :space nodes to :newline nodes.

Inspects all text nodes and "tags" leading and trailing whitespace by converting it into a :space atom or a list of :newline atoms.

Mix Tasks

To format Surface code using Elixir 1.13 or later, use Surface.Formatter.Plugin.