示例#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})
示例#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})
示例#3
0
 def details_html(self):
     return docupy.markdown_to_html(self.details)
示例#4
0
 def description_html(self):
     return docupy.markdown_to_html(self.description)
示例#5
0
 def summary_html(self):
     return docupy.markdown_to_html(self.summary)
示例#6
0
 def body_html(self):
     return docupy.markdown_to_html(self.body.replace("\r", ""),
                                    get_image_lookup())
示例#7
0
 def body(self):
     return docupy.markdown_to_html("\n".join(
         self.description.splitlines()[1:]))
示例#8
0
 def intro(self):
     return docupy.markdown_to_html(self.description.splitlines()[0])
示例#9
0
 def description_html(self):
     return docupy.markdown_to_html(self.description.replace("\r", ""),
                                    get_image_lookup())