<commit_before>===========
jinja2_maps
===========

``jinja2_maps`` is a set of filters to display locations in Jinja2 templates.

Install
-------

.. code-block::

    pip install jinja2_maps

Support
-------

====           ===  ===
               URL  Map
OpenStreetMap  Yes  Yes
Google Maps    Yes  -
Bing Maps      -    -
Apple Maps     -    -
====           ===  ===

Usage
-----

All filters take a location as a dict with ``latitude`` and ``longitude`` keys.
You can also pass an object with these attributes.

Before using any template you need to add the filters to your Jinja2
environment: ::

  from jinja2_maps import activate_filters
  activate_filters(your_env)

If using Flask you can do the following: ::

  from jinja2_maps import activate_filters
  activate_filters(app.jinja_env)

URLs
~~~~

::
  <a href="{{ your_location | osm_url }}">Check on OpenStreetMap</a>
  <a href="{{ your_location | gmaps_url }}">Check on Google Maps</a>

Maps
~~~~

::
  {{ your_location | osm_map(width=500, height=400) }}<commit_msg>README: fix table & blocs formatting<commit_after>===========
jinja2_maps
===========

``jinja2_maps`` is a set of filters to display locations in Jinja2 templates.

Install
-------

.. code-block::

    pip install jinja2_maps

Support
-------

=============  ===  ===
               URL  Map
OpenStreetMap  Yes  Yes
Google Maps    Yes  -
Bing Maps      -    -
Apple Maps     -    -
=============  ===  ===

Usage
-----

All filters take a location as a dict with ``latitude`` and ``longitude`` keys.
You can also pass an object with these attributes.

Before using any template you need to add the filters to your Jinja2
environment: ::

  from jinja2_maps import activate_filters
  activate_filters(your_env)

If using Flask you can do the following: ::

  from jinja2_maps import activate_filters
  activate_filters(app.jinja_env)

URLs
~~~~

::

  <a href="{{ your_location | osm_url }}">Check on OpenStreetMap</a>
  <a href="{{ your_location | gmaps_url }}">Check on Google Maps</a>

Maps
~~~~

::

  {{ your_location | osm_map(width=500, height=400) }}
{'fraction_non_alphanumeric': 0.1509794553272814, 'fraction_numerical': 0.012422360248447204, 'mean_word_length': 3.122047244094488, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5720767', 'n_tokens_mistral': 701, 'n_tokens_neox': 642, 'n_words': 218}