Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds htmlbeautifier formatter - for eruby files #101

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions lua/null-ls/builtins/formatting/htmlbeautifier.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local h = require("null-ls.helpers")
local methods = require("null-ls.methods")

local FORMATTING = methods.internal.FORMATTING

return h.make_builtin({
name = "htmlbeautifier",
meta = {
url = "https://github.com/threedaymonk/htmlbeautifier",
description = "A normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails templates.",
},
method = FORMATTING,
filetypes = { "eruby" },
generator_opts = {
command = "htmlbeautifier",
args = {
"$FILENAME",
},
to_stdin = false,
to_temp_file = true,
},
factory = h.formatter_factory,
})