View Source Uniform.Modifiers (Uniform v0.1.0)

Utilities for building code transformations with modify in your Uniform.Blueprint module.

Link to this section Summary

Functions

Build code transformations to apply Code Fences with this function.

Link to this section Functions

Link to this function

code_fences(file_contents, app, comment_prefix)

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

Build code transformations to apply Code Fences with this function.

Note that code fences are already applied automatically to .ex/.exs files as well as .js/.jsx/.ts/.tsx files.

examples

Examples

# code fences for SQL files
modify ~r/.sql$/, fn file, app ->
  Uniform.Modifiers.code_fences(file, app, "--")
end

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