刘凡 9ff4d1d109 add S3,archive,truncate | 2 éve | |
---|---|---|
.. | ||
highlighter | 2 éve | |
.gitignore | 2 éve | |
LICENSE | 2 éve | |
README.md | 2 éve | |
setup.py | 2 éve |
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>