marcgibbons / django-rest-framework-docs

An inventory tool for Django Rest Framework v2 API endpoints
BSD 2-Clause "Simplified" License
95 stars 34 forks source link

Formatting of docstrings #18

Open alexf101 opened 11 years ago

alexf101 commented 11 years ago

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 commented 11 years ago

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