Exemplo n.º 1
0
def about_view(request):
    try:
        with open("../ShoppingList_Concept.md") as f:
            desc_text = f.read()
            desc_text = re.sub(r"(?<!\n)\n(?![\n-])", " ", desc_text)
            desc_text = re.sub(r"  ", " ", desc_text)
            desc = docupy.markdown_to_html(desc_text.replace("\r", ""),
                                           MediaFile.media_lookup())
    except IOError:
        desc = ""
    return render(request, "about.html", {"description": desc})
Exemplo n.º 2
0
def privacy_view(request):
    try:
        with open("shoppinglist/static/texts/Privacy.md") as f:
            desc_text = f.read()
            desc_text = re.sub(r"(?<!\n)\n(?![\n-])", " ", desc_text)
            desc_text = re.sub(r"  ", " ", desc_text)
            desc = docupy.markdown_to_html(desc_text.replace("\r", ""),
                                           MediaFile.media_lookup())
    except IOError:
        desc = ""
    return render(request, "privacy.html", {"description": desc})
Exemplo n.º 3
0
 def details_html(self):
     return docupy.markdown_to_html(self.details)
Exemplo n.º 4
0
 def description_html(self):
     return docupy.markdown_to_html(self.description)
Exemplo n.º 5
0
 def summary_html(self):
     return docupy.markdown_to_html(self.summary)
Exemplo n.º 6
0
 def body_html(self):
     return docupy.markdown_to_html(self.body.replace("\r", ""),
                                    get_image_lookup())
Exemplo n.º 7
0
 def body(self):
     return docupy.markdown_to_html("\n".join(
         self.description.splitlines()[1:]))
Exemplo n.º 8
0
 def intro(self):
     return docupy.markdown_to_html(self.description.splitlines()[0])
Exemplo n.º 9
0
 def description_html(self):
     return docupy.markdown_to_html(self.description.replace("\r", ""),
                                    get_image_lookup())