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.
- Host: GitHub
- URL: https://github.com/midnighter/jinja2-ospath
- Owner: Midnighter
- License: bsd-3-clause
- Created: 2017-03-16T11:17:59.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-15T10:04:27.000Z (almost 8 years ago)
- Last Synced: 2025-05-13T01:14:57.054Z (about 1 year ago)
- Language: Python
- Size: 7.81 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
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 `__