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

DocString Formatting for Description

Open psyonara opened this issue 8 years ago • 6 comments

How do I format the description of an endpoint for when DRF Docs displays it? I've tried several things and nothing works. For example, I'd like to add line breaks. Is there a way to do this? Thanks

psyonara avatar Jul 28 '16 06:07 psyonara

Did you ever find a solution to this? I am very interested...

ianoboyle avatar Feb 16 '17 21:02 ianoboyle

No, not yet. :(

psyonara avatar Feb 17 '17 04:02 psyonara

I did come across these threads...

https://github.com/manosim/django-rest-framework-docs/pull/117

http://www.django-rest-framework.org/topics/documenting-your-api/

supposedly if you have markdown installed you can use markdown in the docstrings of your api... I haven't tried using it yet but I hope this is still relevant to you!

ianoboyle avatar Feb 17 '17 14:02 ianoboyle

Hello! Any solution to this? I'm stuck at the same point :(

mytrhan avatar Jun 15 '17 09:06 mytrhan

Turns out the version available in pip repos is older and still does not support description markdown formatting.

To enable it you have to download the latest version from git and install it manually. git clone https://github.com/manosim/django-rest-framework-docs.git pip install -r django-rest-framework-docs/requirements.txt pip install -e django-rest-framework-docs/

Note that django-rest-framework-docs/requirements.txt contains: Django==1.8.7 djangorestframework==3.3.2

If you have different versions of Django or djangorestframework you can remove them.

mytrhan avatar Jun 21 '17 09:06 mytrhan

@mytrhan, I tried ur method, didn't work.

explosic4 avatar Jul 31 '17 03:07 explosic4