feature #3148 Rename inky to inky_to_html (fabpot)

This PR was merged into the 2.x branch.

Discussion
----------

Rename inky to inky_to_html

closes #3142

Commits
-------

9f9a2088 Renamed inky to inky_to_html
This commit is contained in:
Fabien Potencier
2019-09-07 09:25:39 +02:00
7 changed files with 15 additions and 16 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
* added support for an "arrow" function on the "sort" filter
* added the CssInliner extension in the "extra" repositories: "inline_css"
filter
* added the Inky extension in the "extra" repositories: "inky" filter
* added the Inky extension in the "extra" repositories: "inky_to_html" filter
* added Intl extension in the "extra" repositories: "country_name",
"currency_name", "currency_symbol", "language_name", "locale_name",
"timezone_name", "country_timezones", "format_currency", "format_number",
+1 -1
View File
@@ -28,7 +28,7 @@ Filters
format_time
html_to_markdown
inline_css
inky
inky_to_html
join
json_encode
keys
@@ -1,15 +1,15 @@
``inky``
========
``inky_to_html``
================
.. versionadded:: 2.12
The ``inky`` filter was added in Twig 2.12.
The ``inky_to_html`` filter was added in Twig 2.12.
The ``inky`` filter processes an `inky email template
The ``inky_to_html`` filter processes an `inky email template
<https://github.com/zurb/inky>`_:
.. code-block:: twig
{% apply inky %}
{% apply inky_to_html %}
<row>
<columns large="6"></columns>
<columns large="6"></columns>
@@ -20,11 +20,11 @@ You can also use the filter on an included file:
.. code-block:: twig
{{ include('some_template.inky.twig')|inky }}
{{ include('some_template.inky.twig')|inky_to_html }}
.. note::
The ``inky`` filter is part of the ``CssInlinerExtension`` which is not
The ``inky_to_html`` filter is part of the ``CssInlinerExtension`` which is not
installed by default. Install it first:
.. code-block:: bash
@@ -1,5 +1,5 @@
--TEST--
"inky" filter
"inline_css" filter
--TEMPLATE--
{% apply inline_css|spaceless %}
<html>
+1 -2
View File
@@ -12,7 +12,6 @@
namespace Twig\Extra\Inky;
use Pinky;
use Twig\Error\RuntimeError;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
@@ -21,7 +20,7 @@ class InkyExtension extends AbstractExtension
public function getFilters()
{
return [
new TwigFilter('inky', 'Twig\\Extra\\Inky\\twig_inky', ['is_safe' => ['html']]),
new TwigFilter('inky_to_html', 'Twig\\Extra\\Inky\\twig_inky', ['is_safe' => ['html']]),
];
}
}
+3 -3
View File
@@ -1,11 +1,11 @@
--TEST--
"inky" filter
"inky_to_html" filter
--TEMPLATE--
{% apply inky %}
{% apply inky_to_html %}
<container class="extra">{{ var }}</container>
{%- endapply %}
{{ include("inky")|inky }}
{{ include("inky")|inky_to_html }}
--TEMPLATE(inky)--
<container class="extra">{{ var }}</container>
--DATA--
+1 -1
View File
@@ -61,7 +61,7 @@ final class Extensions
'class' => InkyExtension::class,
'class_name' => 'InkyExtension',
'package' => 'twig/inky-extra',
'filters' => ['inky'],
'filters' => ['inky_to_html'],
'functions' => [],
],
];