diff --git a/docs/changelog.md b/docs/changelog.md index e65760e..d98f5c4 100755 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -3,6 +3,12 @@ title: "Changelog" source_filename: "changelog" --- +### Release 0.0.9 + + - 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/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. diff --git a/docs/settings.md b/docs/settings.md index 5b90b04..abd2106 100755 --- a/docs/settings.md +++ b/docs/settings.md @@ -12,14 +12,14 @@ 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 = { - '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 diff --git a/docs/templates.md b/docs/templates.md index a9d5316..30391e2 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 %} {% endblock %} - {% endraw %} ### Complete Example File location: `templates/rest_framework_docs/docs.html` - {% raw %} {% extends "rest_framework_docs/base.html" %} {% block title %}Project Name{% endblock %} @@ -81,5 +70,3 @@ File location: `templates/rest_framework_docs/docs.html` {% endblock %} {% block footer %}{% endblock %} - - {% endraw %} diff --git a/rest_framework_docs/__init__.py b/rest_framework_docs/__init__.py index 2792152..9d1ffab 100644 --- a/rest_framework_docs/__init__.py +++ b/rest_framework_docs/__init__.py @@ -1 +1 @@ -__version__ = '0.0.7' +__version__ = '0.0.9' 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)