remplaced markdown2 by markdown module
This commit is contained in:
@@ -38,7 +38,7 @@ class BlogRecordService(object):
|
||||
|
||||
@classmethod
|
||||
def get_last_created(cls, request):
|
||||
# gest the last created posts
|
||||
# gest the 10 last created posts
|
||||
query = request.dbsession.query(BlogRecord).filter(BlogRecord.topic_id != '_admin')
|
||||
if request.authenticated_userid == None:
|
||||
# if user is anonym, display only published posts
|
||||
|
||||
@@ -56,7 +56,8 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<p class="text-center">Apprendre la syntaxe de <a href="https://daringfireball.net/projects/markdown" target="_blank">Markdown</a></li></p>
|
||||
<p class="text-center">Apprendre la syntaxe de <a href="https://daringfireball.net/projects/markdown/syntax"
|
||||
target="_blank">Markdown</a></li></p>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
<h5 class="text-center">PAGES RECENTES - CÁC BÀI MỚI</h5>
|
||||
|
||||
<table id="users_list" class="table table-condensed">
|
||||
{% for entry in last_five %}
|
||||
{% for entry in last_ten %}
|
||||
<tr>
|
||||
<td>{{ entry.created.strftime("%d.%m.%Y") }}</td>
|
||||
<td>
|
||||
|
||||
@@ -119,15 +119,15 @@
|
||||
<div class="col-md-4 item">
|
||||
<h3>Les sites SUNYATA dans le monde</h3>
|
||||
<ul>
|
||||
<li><a href="https://ttkadelaide.wordpress.com/">Sunyata Adelaide, Australie</a></li>
|
||||
<li><a href="http://hoithientanhkhongontario.org/">Sunyata Ontario, Canada</a></li>
|
||||
<li><a href="http://www.meditationsunyatatoulouse.fr/">Sunyata Toulouse, France</a> (fr)</li>
|
||||
<li><a href="https://www.sunyata-bw.de/">Sunyata Stuttgart, Allemagne</a> (de)</li>
|
||||
<li><a href="http://www.sunyata-meditation-ch.org/">Sunyata Suisse</a> (fr)</li>
|
||||
<li><a href="https://www.facebook.com/Sacramento.Tanhkhong">Sunyata Sacramento, CA, USA</a></li>
|
||||
<li><a href="https://tanhkhong.org/">Monastère central, Perris, CA, USA</a></li>
|
||||
<li><a href="http://www.sunyatameditation.org/">Monastère central, Perris, CA, USA</a> (en)</li>
|
||||
<li><a href="https://thientanhkhong.org/">Sunyata Houston, TX, USA</a></li>
|
||||
<li><a href="https://ttkadelaide.wordpress.com/" target="_blank">Sunyata Adelaide, Australie</a></li>
|
||||
<li><a href="http://hoithientanhkhongontario.org/" target="_blank">Sunyata Ontario, Canada</a></li>
|
||||
<li><a href="http://www.meditationsunyatatoulouse.fr/" target="_blank">Sunyata Toulouse, France</a> (fr)</li>
|
||||
<li><a href="https://www.sunyata-bw.de/" target="_blank">Sunyata Stuttgart, Allemagne</a> (de)</li>
|
||||
<li><a href="http://www.sunyata-meditation-ch.org/" target="_blank">Sunyata Suisse</a> (fr)</li>
|
||||
<li><a href="https://www.facebook.com/Sacramento.Tanhkhong" target="_blank">Sunyata Sacramento, CA, USA</a></li>
|
||||
<li><a href="https://tanhkhong.org/" target="_blank">Monastère central, Perris, CA, USA</a></li>
|
||||
<li><a href="http://www.sunyatameditation.org/" target="_blank">Monastère central, Perris, CA, USA</a> (en)</li>
|
||||
<li><a href="https://thientanhkhong.org/" target="_blank">Sunyata Houston, TX, USA</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-2 item">
|
||||
|
||||
@@ -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