import os
import yaml
-import markdown
+import textile
from pytz import timezone
from django.core.files import File
yaml.add_multi_constructor(u"!ruby/object:", construct_ruby_object)
yaml.add_constructor(u"!ruby/sym", construct_ruby_sym)
-def get_markdown_as_html(text):
- return markdown.markdown(text)
+def get_as_html(text):
+ return textile.textile(text)
class Command(BaseCommand):
def add_arguments(self, parser):
})
show = yaml.load(open(os.path.join(dirname, 'show.yaml')))
emission.title = show['attributes']['name']
- emission.text = get_markdown_as_html(show['attributes']['description'])
+ emission.text = get_as_html(show['attributes']['description'])
emission.archived = True
emission.save()
episode.diffusions().delete()
broadcasted_at = utc.localize(episode_data['attributes']['broadcasted_at']).astimezone(europe_brussels)
Diffusion(episode=episode, datetime=make_naive(broadcasted_at)).save()
- episode.text = get_markdown_as_html(episode_data['attributes']['description'])
+ episode.text = get_as_html(episode_data['attributes']['description'])
if not episode.image and episode_data['attributes'].get('image_id'):
episode.image = File(open(os.path.join(dirname, 'images', images[episode_data['attributes']['image_id']])))
episode.save()