An open API service indexing awesome lists of open source software.

https://github.com/midnighter/jinja2-ospath

A tiny Jinja2 extension that introduces dirname and basename as template filters.
https://github.com/midnighter/jinja2-ospath

Last synced: about 1 year ago
JSON representation

A tiny Jinja2 extension that introduces dirname and basename as template filters.

Awesome Lists containing this project

README

          

Jinja2 ``os.path`` Filters
==========================

A Jinja2 extension that introduces the template filters ``basename`` and
``dirname``.

Examples
--------

.. code:: python

my_path = "/some/absolute/path/with/file.txt"
{{ my_path | basename }}

Will fill in ``'file.txt'``.

.. code:: python

my_path = "/some/absolute/path/with/file.txt"
{{ my_path | dirname }}

Will fill in ``'/some/absolute/path/with'``.

Copyright and Licensing
-----------------------

- Copyright 2017, `Moritz Emanuel Beber `__
- Free software: `3-Clause BSD License `__