刘凡 9ff4d1d109 add S3,archive,truncate | пре 2 година | |
---|---|---|
.. | ||
highlighter | пре 2 година | |
.gitignore | пре 2 година | |
LICENSE | пре 2 година | |
README.md | пре 2 година | |
setup.py | пре 2 година |
A django app permits to highlight the searched words (self.query) in a long text and truncates it, counts number of chars == max_length
Use the following command: pip install twentytab-highlighter
INSTALLED_APPS = {
...,
'highlighter',
...
}
In your html template
{% load highlight_tags %}
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
{{a_very_long_text|highlight:"word"}}
</body>
</html>