added sassify and scssify filters fot converting sass and scss strings to css
This commit is contained in:
parent
2b81e5ed19
commit
566d3718b0
|
@ -25,6 +25,28 @@ module Jekyll
|
||||||
converter.convert(input)
|
converter.convert(input)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Convert a Sass string into CSS output.
|
||||||
|
#
|
||||||
|
# input - The Sass String to convert.
|
||||||
|
#
|
||||||
|
# Returns the CSS formatted String.
|
||||||
|
def sassify(input)
|
||||||
|
site = @context.registers[:site]
|
||||||
|
converter = site.getConverterImpl(Jekyll::Converters::Sass)
|
||||||
|
converter.convert(input)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Convert a Scss string into CSS output.
|
||||||
|
#
|
||||||
|
# input - The Scss String to convert.
|
||||||
|
#
|
||||||
|
# Returns the CSS formatted String.
|
||||||
|
def scssify(input)
|
||||||
|
site = @context.registers[:site]
|
||||||
|
converter = site.getConverterImpl(Jekyll::Converters::Scss)
|
||||||
|
converter.convert(input)
|
||||||
|
end
|
||||||
|
|
||||||
# Format a date in short format e.g. "27 Jan 2011".
|
# Format a date in short format e.g. "27 Jan 2011".
|
||||||
#
|
#
|
||||||
# date - the Time to format.
|
# date - the Time to format.
|
||||||
|
|
|
@ -34,6 +34,14 @@ class TestFilters < Test::Unit::TestCase
|
||||||
assert_equal "<p>something <strong>really</strong> simple</p>\n", @filter.markdownify("something **really** simple")
|
assert_equal "<p>something <strong>really</strong> simple</p>\n", @filter.markdownify("something **really** simple")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "sassify with simple string" do
|
||||||
|
assert_equal "p {\n color: #123456; }\n", @filter.sassify("$blue:#123456\np\n color: $blue")
|
||||||
|
end
|
||||||
|
|
||||||
|
should "scssify with simple string" do
|
||||||
|
assert_equal "p {\n color: #123456; }\n", @filter.scssify("$blue:#123456; p{color: $blue}")
|
||||||
|
end
|
||||||
|
|
||||||
should "convert array to sentence string with no args" do
|
should "convert array to sentence string with no args" do
|
||||||
assert_equal "", @filter.array_to_sentence_string([])
|
assert_equal "", @filter.array_to_sentence_string([])
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue