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