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') and rendered_content fields to the FlatPage model.
  • Add a get_content method(or an attribute) to the FlatPage model: If markup_type is None, it will be use the content attribute. Otherwise, rendered_content will be used.

Change History (2)

comment:1 by Tim Graham, 10 years ago

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.

comment:2 by Tim Graham, 10 years ago

Resolution: wontfix
Status: newclosed

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.
Back to Top