View Source Uniform.Modifiers (Uniform v0.5.0)

Utilities for building code transformations with Uniform.Blueprint.modify/2.

Link to this section Summary

Functions

Apply Eject Fences to extra languages with this function.

Link to this section Functions

Link to this function

eject_fences(file_contents, app, comment_prefix)

View Source
@spec eject_fences(String.t(), Uniform.App.t(), String.t()) :: String.t()

Apply Eject Fences to extra languages with this function.

Uniform already applies Eject Fences to Elixir (.ex/.exs) and JavaScript (.js/.jsx/.ts/.tsx) files automatically.

use Uniform.Blueprint imports eject_fences.

examples

Examples

# code fences for SQL files
modify ~r/.sql$/, &eject_fences(&1, &2, "--")

# code fences for Rust files
modify ~r/.rs$/, fn file, app ->
  eject_fences(file, app, "//")
end