gestiojeux/website/views.py
sinavir c01ed7cb47 style(pre-commit): Add hook
Python:
- black
- isort (black profile)
- ruff

Nix:
- statix
- nixfmt-rfc-style
- deadnix
2024-07-04 20:47:46 +02:00

15 lines
474 B
Python

from django.utils.safestring import mark_safe
from django.views.generic import DetailView
from markdownx.utils import markdownify
from .models import MarkdownPage
class MarkdownPageView(DetailView):
model = MarkdownPage
template_name = "website/markdown_page.html"
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["markdown_body"] = mark_safe(markdownify(self.object.content))
return context