django-rest-framework-docs icon indicating copy to clipboard operation
django-rest-framework-docs copied to clipboard

Formatting of docstrings

Open alexf101 opened this issue 12 years ago • 1 comments

Hi,

This is a feature request more than an issue, I suppose, but I was wondering if it would be possible to chuck 'pre' tags around docstrings to preserve formatting.

In particular, I'd like to be able to provide examples of some of my custom JSON messages, but they get mashed into a single line.

An (better?) alternative would be to support Markdown syntax in docstrings, but I feel that simply marking the content as preformatted would go a long way, and perhaps be more general (much as I love Markdown, participants in larger projects may have already picked a different kind of formatting for other reasons).

As a side note, the doc fields on the param parameters are truncated if they contain line breaks, but I guess that's a reasonable restriction.

PS. I thought I'd posted this a few days ago but I guess I forgot to press Submit! And thanks for the great code.

alexf101 avatar Jun 13 '13 06:06 alexf101

Just noticed that this is a problem for the djangorestframework as well.

alexf101 avatar Jun 13 '13 06:06 alexf101