From 6204182c8884398ccaf604a5ca0e69299bfd2e13 Mon Sep 17 00:00:00 2001 From: ambivalentno Date: Tue, 22 Mar 2016 22:02:20 +0200 Subject: [PATCH 1/8] Update settings.md We shouldn't propose people to use incorrectly named env variables: previously: if "SHOW_DRFDOCS" is True - docs are hidden now: correct naming of variables. --- docs/settings.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/settings.md b/docs/settings.md index 5b90b04..29cad50 100755 --- a/docs/settings.md +++ b/docs/settings.md @@ -16,10 +16,10 @@ To set DRF docs' settings just include the dictionary below in Django's `setting You can use hidden to prevent your docs from showing up in different environments (ie. Show in development, hide in production). To do so you can use environment variables. REST_FRAMEWORK_DOCS = { - 'HIDE_DOCS': os.environ.get('SHOW_DRFDOCS', False) + 'HIDE_DOCS': os.environ.get('HIDE_DRFDOCS', False) } -Then set the value of the environment variable `SHOW_DRFDOCS` for each environment (ie. Use `.env` files) +Then set the value of the environment variable `HIDE_DRFDOCS` for each environment (ie. Use `.env` files) ### List of Settings From 59d88bb0f90fbfcbe61d59a69c767535f7263fa1 Mon Sep 17 00:00:00 2001 From: Nikita Khlestov Date: Thu, 24 Mar 2016 15:32:39 +0200 Subject: [PATCH 2/8] fix --- docs/settings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.md b/docs/settings.md index 29cad50..abd2106 100755 --- a/docs/settings.md +++ b/docs/settings.md @@ -12,7 +12,7 @@ To set DRF docs' settings just include the dictionary below in Django's `setting ### Settings Description -##### HIDDEN +##### HIDE_DOCS You can use hidden to prevent your docs from showing up in different environments (ie. Show in development, hide in production). To do so you can use environment variables. REST_FRAMEWORK_DOCS = { From fd25718801e7453851f08648b815a8b220d65947 Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Thu, 24 Mar 2016 23:21:45 +0000 Subject: [PATCH 3/8] Bump 0.0.8 --- docs/changelog.md | 8 +++++++- rest_framework_docs/__init__.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index e65760e..0eef5a6 100755 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -3,6 +3,12 @@ title: "Changelog" source_filename: "changelog" --- +### Release 0.0.8 + + - Support for more types of `ROOT_URLCONF` + - Move docs to [MKDocs](http://www.mkdocs.org/) + + ### Release 0.0.7 - Fix methods in Live API Endpoints (now compatible with Python 2.7) @@ -18,7 +24,7 @@ source_filename: "changelog" ### Release 0.0.5 - - Support both common types of ROOT_URLCONF + - Support both common types of `ROOT_URLCONF` ### Release 0.0.4 diff --git a/rest_framework_docs/__init__.py b/rest_framework_docs/__init__.py index 2792152..9123cf0 100644 --- a/rest_framework_docs/__init__.py +++ b/rest_framework_docs/__init__.py @@ -1 +1 @@ -__version__ = '0.0.7' +__version__ = '0.0.8' From 9f705503ef18d621299485122de3b2a62c0271b2 Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Thu, 24 Mar 2016 23:45:54 +0000 Subject: [PATCH 4/8] Bump 0.0.9 --- docs/changelog.md | 2 +- rest_framework_docs/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 0eef5a6..d98f5c4 100755 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -3,7 +3,7 @@ title: "Changelog" source_filename: "changelog" --- -### Release 0.0.8 +### Release 0.0.9 - Support for more types of `ROOT_URLCONF` - Move docs to [MKDocs](http://www.mkdocs.org/) diff --git a/rest_framework_docs/__init__.py b/rest_framework_docs/__init__.py index 9123cf0..9d1ffab 100644 --- a/rest_framework_docs/__init__.py +++ b/rest_framework_docs/__init__.py @@ -1 +1 @@ -__version__ = '0.0.8' +__version__ = '0.0.9' From 318e4978892c9242efd50e61f83e24d0a342b5e5 Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Fri, 25 Mar 2016 22:31:56 +0000 Subject: [PATCH 5/8] Remove "raw" from templates docs --- docs/templates.md | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/docs/templates.md b/docs/templates.md index a9d5316..f7d957f 100755 --- a/docs/templates.md +++ b/docs/templates.md @@ -5,52 +5,43 @@ source_filename: templates ### Create the template file To edit the template you will have to create a `.html` file to override the original one. Inside your `templates` directory create a directory named `rest_framework_docs` and inside this create the file `docs.html`. You can then extend/override the default template. - {% raw %} {% extends "rest_framework_docs/base.html" %} - {% endraw %} ### Default Blocks ##### Styles (CSS) - {% raw %} {% block style %} {% endblock %} - {% endraw %} ##### GitHub Badge To hide the GitHub badge from the page, just override it with an empty block. - {% raw %}{% block github_badge %}{% endblock %}{% endraw %} + {% block github_badge %}{% endblock %} ##### Title - {% raw %}{% block title %}Project Name{% endblock %}{% endraw %} + {% block title %}Project Name{% endblock %} ##### Logo - {% raw %} {% block logo %} DRF Docs {% endblock %} - {% endraw %} ##### Jumbotron - {% raw %} {% block jumbotron %}

Project Title

Documentantion of the project 'Example'.

{% endblock %} - {% endraw %} ##### Footer - {% raw %} {% block footer %} - Copyright © 2015 Emmanouil Konstantinidis. + Copyright © 2016 Emmanouil Konstantinidis. {% endblock %} From 4f06d05c58e28c186e31cf34e5ac75567e384b73 Mon Sep 17 00:00:00 2001 From: Yingtao Qiu Date: Fri, 8 Apr 2016 02:55:20 +0800 Subject: [PATCH 7/8] modify installation.md remove a slash --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 8c26909..1e7805c 100755 --- a/docs/installation.md +++ b/docs/installation.md @@ -22,4 +22,4 @@ Finally include the `rest_framework_docs` urls in your `urls.py`: url(r'^docs/', include('rest_framework_docs.urls')), ] -You can now visit [http://0.0.0.0:/8000/docs/](http://0.0.0.0:/8000/docs/) to view your Web API's docs. +You can now visit [http://0.0.0.0:/8000/docs/](http://0.0.0.0:8000/docs/) to view your Web API's docs. From f44ccbae43a9b1614b0c61f164175ae2fa6748eb Mon Sep 17 00:00:00 2001 From: Brobin Date: Fri, 8 Apr 2016 14:50:26 -0500 Subject: [PATCH 8/8] fix broken test by sorting both lists --- tests/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests.py b/tests/tests.py index afb58d0..c1978ec 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -31,7 +31,7 @@ def test_index_view_with_endpoints(self): # Test the login view self.assertEqual(response.context["endpoints"][0].name_parent, "accounts") - self.assertEqual(response.context["endpoints"][0].allowed_methods, ['POST', 'OPTIONS']) + self.assertEqual(sorted(response.context["endpoints"][0].allowed_methods), sorted(['OPTIONS', 'POST'])) self.assertEqual(response.context["endpoints"][0].path, "/accounts/login/") self.assertEqual(response.context["endpoints"][0].docstring, "A view that allows users to login providing their username and password.") self.assertEqual(len(response.context["endpoints"][0].fields), 2)