Class: Nutils::Filters::Beautify

Inherits:
Nanoc3::Filter
  • Object
show all
Defined in:
lib/nutils/filters/beautify.rb

Overview

TODO:

Pass parameters to the HtmlBeautifer engine.

Note:

Requires htmlbeautifer

Author:

  • Arnau Siches

  • Choan Gálvez

Version:

  • 0.5.0

Instance Method Summary collapse

Instance Method Details

#run(content, params = {}) ⇒ String

Runs the content through [htmlbeautifier](github.com/threedaymonk/htmlbeautifier/). This method takes no options.

Parameters:

  • content (String)

    The content to filter.

Returns:

  • (String)

    The retabed HTML.



23
24
25
26
27
28
# File 'lib/nutils/filters/beautify.rb', line 23

def run(content, params = {})
  require "htmlbeautifier/beautifier"
  buffer = ""
  ::HtmlBeautifier::Beautifier.new(buffer).scan(content)
  buffer
end