Opened 10 years ago
Closed 10 years ago
#23743 closed New feature (wontfix)
Add markup support to flatpages
Reported by: | Berker Peksag | Owned by: | nobody |
---|---|---|---|
Component: | contrib.flatpages | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Berker Peksag | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
It would be good if flatpages supports reST and markdown markups in addition to raw HTML.
The default behavior can be same as now. The user can choose either reST or markdown (of course the related packages should be installed) when they creating a page from the admin site(or via the Python API).
Proposed API changes:
- Add
markup_type
(None, 'reST', 'markdown') andrendered_content
fields to theFlatPage
model. - Add a
get_content
method(or an attribute) to theFlatPage
model: Ifmarkup_type
isNone
, it will be use thecontent
attribute. Otherwise,rendered_content
will be used.
Change History (2)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Marking as "won't fix" until there is consensus on the DevelopersMailingList that this should be in core.
Note:
See TracTickets
for help on using tickets.
It might be interesting to see if this could be implemented as a third-party app which could be something like a model mixin so it could be applied to arbitrary models. The djangoproject.com blog implements a selector as you describe for raw HTML/reST support. I would prefer to see this approach if possible, but if there is consensus on the DevelopersMailingList to add it to Django, then okay. The third-party app approach might then require making the
FlatPage
model swappable which is also something that we'd need to discuss.