remplaced markdown2 by markdown module
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from pyramid.view import view_config
|
||||
from pyramid.httpexceptions import HTTPNotFound, HTTPFound
|
||||
from markdown2 import Markdown
|
||||
import markdown
|
||||
import datetime #<- will be used to set default dates on models
|
||||
|
||||
from ..models.blog_record import BlogRecord
|
||||
@@ -20,9 +20,8 @@ def blog(request):
|
||||
|
||||
# insèrer le path de static/img
|
||||
body = entry.body.replace('static/', "%s/static/" % request.application_url)
|
||||
# convertir mardown en HTML
|
||||
markdowner = Markdown()
|
||||
body_html = markdowner.convert(body)
|
||||
# convertir de markdown en HTML
|
||||
body_html = markdown.markdown(body, extensions=['footnotes'])
|
||||
|
||||
return {
|
||||
'page_title': entry.title,
|
||||
@@ -172,8 +171,7 @@ def topic(request):
|
||||
# get the topic record
|
||||
topic_record = BlogRecordService.get_topic_byTopic(request, topic)
|
||||
# convertir champ topic_quote en HTML
|
||||
markdowner = Markdown()
|
||||
topic_quote = markdowner.convert(topic_record.topic_quote)
|
||||
topic_quote = markdown.markdown(topic_record.topic_quote)
|
||||
# insèrer le path de static/img
|
||||
topic_quote = topic_quote.replace('static/', "%s/static/" % request.application_url)
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ def home(request):
|
||||
# insèrer le path de static/img
|
||||
activities = activ.body.replace('static/', "%s/static/" % request.application_url)
|
||||
# get the last created posts
|
||||
last_five = BlogRecordService.get_last_created(request)
|
||||
last_ten = BlogRecordService.get_last_created(request)
|
||||
name = ''
|
||||
email = ''
|
||||
comments = ''
|
||||
@@ -81,7 +81,7 @@ def home(request):
|
||||
|
||||
return {
|
||||
'page_title': "",
|
||||
'last_five': last_five,
|
||||
'last_ten': last_ten,
|
||||
'activities': activities,
|
||||
'car_images': car_images,
|
||||
'name': name,
|
||||
@@ -121,7 +121,7 @@ def settings(request):
|
||||
# informations sur les versions
|
||||
pyramid_version = pkg_resources.get_distribution("pyramid").version
|
||||
wtforms_version = pkg_resources.get_distribution("wtforms").version
|
||||
markdown_version = pkg_resources.get_distribution("markdown2").version
|
||||
markdown_version = pkg_resources.get_distribution("markdown").version
|
||||
sqlalchemy_version = pkg_resources.get_distribution("sqlalchemy").version
|
||||
sqlite_version = sqlite3.sqlite_version
|
||||
python_version = sys.version
|
||||
|
||||
Reference in New Issue
Block a user