1
Fork 0

remove unused extension

This commit is contained in:
Jake Howard 2016-06-25 14:06:35 +01:00
parent df4f942828
commit 9b83c0cc12
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 0 additions and 9 deletions

View file

@ -68,7 +68,6 @@ MD_EXTENSIONS = [FontAwesomeExtension(), 'codehilite(css_class=highlight)', 'ext
import filters
JINJA_FILTERS = {
"datetime": filters.format_datetime,
"raw": filters.html_to_raw,
"category_find": filters.category_find,
"limit": filters.limit
}

View file

@ -1,18 +1,10 @@
import iso8601
from bs4 import BeautifulSoup
def format_datetime(value):
return iso8601.parse_date(str(value)).strftime("%x")
def html_to_raw(html):
soup = BeautifulSoup(html, "html.parser")
for script in soup(["script", "style"]): # Remove script / style tags
script.extract()
return soup.get_text()
def category_find(categories, name):
for category_name, articles in categories:
if category_name == name: