Skip to content

Commit

Permalink
Add documentation for the newly introduced Jinja filters.
Browse files Browse the repository at this point in the history
  • Loading branch information
github-abcde committed Apr 10, 2019
1 parent cd9a96d commit 43896e2
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions doc/topics/jinja/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,49 @@ Returns:
.. _`JMESPath language`: http://jmespath.org/
.. _`jmespath`: https://github.com/jmespath/jmespath.py


.. jinja_ref:: to_snake_case

``to_snake_case``
-----------------

.. versionadded:: Neon

Converts a string from camelCase (or CamelCase) to snake_case.

.. code-block:: jinja
Example: {{ camelsWillLoveThis | to_snake_case }}
Returns:

.. code-block:: text
Example: camels_will_love_this
.. jinja_ref:: to_camelcase

``to_camelcase``
----------------

.. versionadded:: Neon

Converts a string from snake_case to camelCase (or UpperCamelCase if so indicated).

.. code-block:: jinja
Example 1: {{ snake_case_for_the_win | to_camelcase }}
Example 2: {{ snake_case_for_the_win | to_camelcase(uppercamel=True) }}
Returns:

.. code-block:: text
Example 1: snakeCaseForTheWin
Example 2: SnakeCaseForTheWin
Networking Filters
------------------

Expand Down

0 comments on commit 43896e2

Please sign in to comment.