summarize-template
Show a summary of a Django or Jinja template
Installation
Install this tool using pip:
pip install summarize-template
Usage
You can run the command against a template file like this:
summarize-template path/to/template.html
The tool will output just the structural tags from the template.
Example
Given a template that looks like this:
{% extends "base.html" %}
{% block title %}This is the title{% endblock %}
{% block content %}
<h1>{{ title }}</h1>
{% if docs %}
<ul>
{% for doc in docs %}
<li><a href="{{ doc.url }}">{{ doc.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}
Running summarize-template against it will produce the following:
{% extends "base.html" %}
{% block title %} {% endblock %}
{% block content %}
{{ title }}
{% if docs %}
{% for doc in docs %}
{{ doc.url }}{{ doc.title }}
{% endfor %}
{% endif %}
{% endblock %}
Development
To contribute to this tool, first checkout the code. Then create a new virtual environment:
cd summarize-template
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Release files for summarize-template 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| summarize-template-0.1.tar.gz | 6.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| summarize_template-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.7 kB
Release files / summarize-template-0.1.tar.gz
| Download URL | summarize-template-0.1.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c3159ac427e68cb217922356c6989c3332bde291f7342daedb9c2734cac80d2
|
|
BLAKE2b-256 checksum How to use checksums |
90ce53f4ff60822aaad44fbe880abefa93a74e8de87b8df008a6b14baefa47b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Release files / summarize_template-0.1-py3-none-any.whl
| Download URL | summarize_template-0.1-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
90a76595649e55b6fecb223dcf52d2b2ec3da1664c97987af8af21c747564b3d
|
|
BLAKE2b-256 checksum How to use checksums |
97c25316593da83fad5cd666544cc6973a2742b471ed72adc51de872f7273b12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|