{{title}}
+{{summary}}
+diff --git a/.gitignore b/.gitignore deleted file mode 100644 index bde1b9d..0000000 --- a/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -.coverage -covhtml/ - -*.pyc -__pycache__/ - -env/ -demo/db.sqlite3 -dist/ -drfdocs.egg-info/ - -site/ - -demo/node_modules/ -rest_framework_docs/static/rest_framework_docs/js/dist.min.js - -rest_framework_docs/static/node_modules/ -rest_framework_docs/static/rest_framework_docs/js/dist.min.js.map diff --git a/demo/project/__init__.py b/.nojekyll similarity index 100% rename from demo/project/__init__.py rename to .nojekyll diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8a61d83..0000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -language: python - -sudo: false - -python: - - "2.7" - - "3.4" - - "3.5" - -env: - - DJANGO_VERSION=1.8 - - DJANGO_VERSION=1.9 - -cache: - - pip - - directories: - - rest_framework_docs/static/node_modules/ - -before_install: - - nvm install 5 - -install: - - cd rest_framework_docs/static/ && npm install && cd ../../ - - pip install -r requirements.txt - - pip install -U Django==$DJANGO_VERSION - - pip install codecov - -script: - - python runtests.py - -after_success: - - codecov - -notifications: - slack: - secure: ZTzxh+tXuf7uaFMBQtrjupS+qqtM3dsnYgHptErsg3SjH0q1jH+HpKD+1RlqGqN36mREB1wSlOhGMzfyGNeNhl0PHQLEtZhs3dRLdzR1xMZWKm7xtCe4TcFoSPh5SoLOHrQVaSEyHeE53gkbOfI7Q5SqVRJOlJv9iCCD8TM+KVdDubCeByevunFSzGFwdLvtk7QpRwXivOGJdJHXXWgVl6ieviQKun5Z03woiLr5L4p37szVkbD60T5lFYAhCL1PzLQ6hVhDn7L4J06LIaQ+l+Jp6cunB1iJtR1Rz+C7g/r2VGgJ5G3sHB3QyFqw9Q/E3oBB81xQTwjL7WSfDuKctW2CPWHac0T9VhidQDoq7uR0EYPMkZXnc+iZa5wmL8IfjEadse0rxdfiIOE+mev+i5BrzHBq/+tZV/D+HKzsRXUEf3BZaRpq7gQHWbj0dusX+R504BQtKqYaGqBFdWJ0+Dry739R4xTeWk10Xa3wpzSFQ1c0yUQbY+3W/DNSYKcRV+Z9eGhMSO1QfBlGzqTlkWkVDnD9OYIpo5iJOkDouJVtzPOyyFBoNGqkvUHiKBO6ohuh48S3xXrjhihkz8xuOSrU1W7xGhCG2RA/vHZh8Fm20l1oIJ/p/Gn6kTLT33XZsxnF9C0Qmgvr6f96MKNPJjNKp0zYj4tJaZr9Xi4rsD8= diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 875f5c1..0000000 --- a/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2015 Emmanouil Konstantinidis -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 5be0ea4..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,16 +0,0 @@ -include README.md -include LICENSE -include MANIFEST.in - -global-exclude __pycache__ -global-exclude *.py[co] -global-exclude package.json - -prune docs -prune rest_framework_docs/static/node_modules - -graft rest_framework_docs/static/rest_framework_docs -graft rest_framework_docs/templates/rest_framework_docs - -recursive-exclude rest_framework_docs/static/rest_framework_docs dist.min.js.map index.js -recursive-exclude rest_framework_docs/static/rest_framework_docs/*/* * diff --git a/README.md b/README.md deleted file mode 100644 index 3bfde01..0000000 --- a/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# [DRF Docs](http://www.drfdocs.com/) [![travis][travis-image]][travis-url] [![codecov][codecov-image]][codecov-url] [![pypi][pypi-image]][pypi-url] [![slack][slack-image]][slack-url] - -Document Web APIs made with Django Rest Framework. [View Demo](http://demo.drfdocs.com/) - -> **Contributors Wanted**: Do you like this project? Using it? Let's make it better! - - - -### Supports - - - Python (2.7, 3.3, 3.4, 3.5) - - Django (1.8, 1.9) - - Django Rest Framework (3+) - - -### Documentation - Table of contents - - - [Installation](http://drfdocs.com/installation/) - - [Settings](http://drfdocs.com/settings/) - - [Extending the template](http://drfdocs.com/templates/) - - [Live API Endpoints](http://drfdocs.com/live-api/) - - [Contributing & Development](http://drfdocs.com/contributing/) - - [Changelog](http://drfdocs.com/changelog/) - - -### Development & Demo Project -If you are looking to develop this package with one of your own django projects: - - pyvenv env - env/bin/pip install -r requirements.txt - pip install -e ~/Projects/drf-docs/ - -If you want to use the demo app to work on this package: -Included in this repo you can find the demo project(at `/demo`). It is a project with *Django* & *Django Rest Framework* that will allow you to work with this project. For more information on how you can set it up please check the [README.md](demo/README.md) of the demo project. - -For more information visit [the docs](http://drfdocs.com/contributing/). - -### Installation - -Install using pip: - - pip install drfdocs - -Add 'rest_framework_docs' to your `INSTALLED_APPS` setting: - - INSTALLED_APPS = ( - ... - 'rest_framework_docs', - ) - -Finally include the `rest_framework_docs` urls in your `urls.py`: - - urlpatterns = [ - ... - url(r'^docs/', include('rest_framework_docs.urls')), - ] - - -### Settings -You can find detailed information about the package's settings at [the docs](http://drfdocs.com/settings/). - - REST_FRAMEWORK_DOCS = { - 'HIDE_DOCS': True # Default: False - } - - -### Credits - -First of all thanks to the [Django](http://www.djangoproject.com/) core team and to all the contributors of [Django REST Framework](http://www.django-rest-framework.org/) for their amazing work. Also I would like to thank [Marc Gibbons](https://github.com/marcgibbons) for his *django-rest-framework-docs* project. Both projects share the same idea, it is just that Marc's is not maintained anymore and does not support DRF 3+ & Python 3. - -[travis-image]: https://travis-ci.org/manosim/django-rest-framework-docs.svg?branch=master -[travis-url]: https://travis-ci.org/manosim/django-rest-framework-docs - -[pypi-image]: https://badge.fury.io/py/drfdocs.svg -[pypi-url]: https://pypi.python.org/pypi/drfdocs/ - -[codecov-image]: https://codecov.io/github/manosim/django-rest-framework-docs/coverage.svg?branch=master -[codecov-url]:https://codecov.io/github/manosim/django-rest-framework-docs?branch=master - -[slack-image]: https://img.shields.io/badge/slack-pythondev/drfdocs-e01563.svg -[slack-url]: https://pythondev.slack.com diff --git a/demo/project/accounts/__init__.py b/__init__.py old mode 100644 new mode 100755 similarity index 100% rename from demo/project/accounts/__init__.py rename to __init__.py diff --git a/docs/template/base.html b/base.html similarity index 98% rename from docs/template/base.html rename to base.html index 0db72a9..8ab2199 100755 --- a/docs/template/base.html +++ b/base.html @@ -58,7 +58,7 @@
{% if copyright %}ROOT_URLCONF
.<format>
from urlsHIDDEN
is now HIDE_DOCS
ROOT_URLCONF
blocks
to be overriddennode_modules/
collectstatic
command was failing because of GlyphiconsFirst release of the project to pypi. Features include:
+APIView
If you want to use the demo app to work on this package:
+In the project repository you can find the demo app(at /demo). It is a project with Django & Django Rest Framework that will allow you to work with this project.
+From the root of the repository:
+# Create the virtual environment
+pyvenv env
+
+# Install requirements
+env/bin/pip install -r requirements.txt
+
+# Activate the environment
+source env/bin/activate
+
+# Cd Into the demo
+cd demo/
+
+# Install Django Rest Framework Docs
+pip install -e ../
+
+# Run the project
+python manage.py runserver
+
+Note: You do not need a database or to run migrate.
+If you are looking to develop this package with one of your own django projects:
+pyvenv env
+env/bin/pip install -r requirements.txt
+pip install -e ~/Projects/drf-docs/
+
+git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
As contributors and maintainers of this project, and in the interest of +fostering an open and welcoming community, we pledge to respect all people who +contribute through reporting issues, posting feature requests, updating +documentation, submitting pull requests or patches, and other activities.
+We are committed to making participation in this project a harassment-free +experience for everyone, regardless of level of experience, gender, gender +identity and expression, sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality.
+Examples of unacceptable behavior by participants include:
+Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful.
+By adopting this Code of Conduct, project maintainers commit themselves to +fairly and consistently applying these principles to every aspect of managing +this project. Project maintainers who do not follow or enforce the Code of +Conduct may be permanently removed from the project team.
+This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community.
+Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting a project maintainer at manos@iamemmanouil.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. Maintainers are +obligated to maintain confidentiality with regard to the reporter of an +incident.
+This Code of Conduct is adapted from the Contributor Covenant, +version 1.3.0, available at +http://contributor-covenant.org/version/1/3/0/
+ + + Edit on Github + +Django REST Framework Docs (DRF Docs) allows you to list all your API Endpoints that inherit from Django REST Framework automatically. Its purpose is to work out of the box and it should take a minimum to install it.
+ +A really useful feature of DRF Docs is that you can also test endpoints from within the docs. Feel free to use our demo and try them! For more information visit the Live API Endpoints page of the docs.
+The concept is pretty simple. Once you install it you should go the the url you set (ie. http://0.0.0.0:8000/docs/
) and you should see all your API endpoints along with the serializer fields, allowed methods etc for each one.
DRF Docs will then read all your urls
and will list those that inherit from Django REST Framework's APIView
.
The installation itself should not take more than a couple of minutes. Follow the simple steps below.
+pip install drfdocs
+
+Add 'rest_framework_docs' to your INSTALLED_APPS
setting:
INSTALLED_APPS = (
+ ...
+ 'rest_framework_docs',
+)
+
+Finally include the rest_framework_docs
urls in your urls.py
:
urlpatterns = [
+ ...
+ url(r'^docs/', include('rest_framework_docs.urls')),
+]
+
+You can now visit http://0.0.0.0:/8000/docs/ to view your Web API's docs.
+ + + Edit on Github + +Live API Endpoints allow you to test your endpoints from within DRF docs. For each endpoints you can press the little plug icon which will bring up a modal with all the endpoint's fields and all the relevant information so that you can make a request instantly.
+It is still in beta so if you face any problems - feel free to open an issue/pull request on GitHub.
+The Live API is made with React. For more information on how to hack on them, check the README of the repository.
+ + + Edit on Github + +{{summary}}
+No results found
"); + } + + if(jQuery){ + /* + * We currently only automatically hide bootstrap models. This + * requires jQuery to work. + */ + jQuery('#mkdocs_search_modal a').click(function(){ + jQuery('#mkdocs_search_modal').modal('hide'); + }) + } + + }; + + var search_input = document.getElementById('mkdocs-search-query'); + + var term = getSearchTerm(); + if (term){ + search_input.value = term; + search(); + } + + search_input.addEventListener("keyup", search); + +}); diff --git a/mkdocs/js/text.js b/mkdocs/js/text.js new file mode 100644 index 0000000..17921b6 --- /dev/null +++ b/mkdocs/js/text.js @@ -0,0 +1,390 @@ +/** + * @license RequireJS text 2.0.12 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/requirejs/text for details + */ +/*jslint regexp: true */ +/*global require, XMLHttpRequest, ActiveXObject, + define, window, process, Packages, + java, location, Components, FileUtils */ + +define(['module'], function (module) { + 'use strict'; + + var text, fs, Cc, Ci, xpcIsWindows, + progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'], + xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, + bodyRegExp = /]*>\s*([\s\S]+)\s*<\/body>/im, + hasLocation = typeof location !== 'undefined' && location.href, + defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''), + defaultHostName = hasLocation && location.hostname, + defaultPort = hasLocation && (location.port || undefined), + buildMap = {}, + masterConfig = (module.config && module.config()) || {}; + + text = { + version: '2.0.12', + + strip: function (content) { + //Strips declarations so that external SVG and XML + //documents can be added to a document without worry. Also, if the string + //is an HTML document, only the part inside the body tag is returned. + if (content) { + content = content.replace(xmlRegExp, ""); + var matches = content.match(bodyRegExp); + if (matches) { + content = matches[1]; + } + } else { + content = ""; + } + return content; + }, + + jsEscape: function (content) { + return content.replace(/(['\\])/g, '\\$1') + .replace(/[\f]/g, "\\f") + .replace(/[\b]/g, "\\b") + .replace(/[\n]/g, "\\n") + .replace(/[\t]/g, "\\t") + .replace(/[\r]/g, "\\r") + .replace(/[\u2028]/g, "\\u2028") + .replace(/[\u2029]/g, "\\u2029"); + }, + + createXhr: masterConfig.createXhr || function () { + //Would love to dump the ActiveX crap in here. Need IE 6 to die first. + var xhr, i, progId; + if (typeof XMLHttpRequest !== "undefined") { + return new XMLHttpRequest(); + } else if (typeof ActiveXObject !== "undefined") { + for (i = 0; i < 3; i += 1) { + progId = progIds[i]; + try { + xhr = new ActiveXObject(progId); + } catch (e) {} + + if (xhr) { + progIds = [progId]; // so faster next time + break; + } + } + } + + return xhr; + }, + + /** + * Parses a resource name into its component parts. Resource names + * look like: module/name.ext!strip, where the !strip part is + * optional. + * @param {String} name the resource name + * @returns {Object} with properties "moduleName", "ext" and "strip" + * where strip is a boolean. + */ + parseName: function (name) { + var modName, ext, temp, + strip = false, + index = name.indexOf("."), + isRelative = name.indexOf('./') === 0 || + name.indexOf('../') === 0; + + if (index !== -1 && (!isRelative || index > 1)) { + modName = name.substring(0, index); + ext = name.substring(index + 1, name.length); + } else { + modName = name; + } + + temp = ext || modName; + index = temp.indexOf("!"); + if (index !== -1) { + //Pull off the strip arg. + strip = temp.substring(index + 1) === "strip"; + temp = temp.substring(0, index); + if (ext) { + ext = temp; + } else { + modName = temp; + } + } + + return { + moduleName: modName, + ext: ext, + strip: strip + }; + }, + + xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/, + + /** + * Is an URL on another domain. Only works for browser use, returns + * false in non-browser environments. Only used to know if an + * optimized .js version of a text resource should be loaded + * instead. + * @param {String} url + * @returns Boolean + */ + useXhr: function (url, protocol, hostname, port) { + var uProtocol, uHostName, uPort, + match = text.xdRegExp.exec(url); + if (!match) { + return true; + } + uProtocol = match[2]; + uHostName = match[3]; + + uHostName = uHostName.split(':'); + uPort = uHostName[1]; + uHostName = uHostName[0]; + + return (!uProtocol || uProtocol === protocol) && + (!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) && + ((!uPort && !uHostName) || uPort === port); + }, + + finishLoad: function (name, strip, content, onLoad) { + content = strip ? text.strip(content) : content; + if (masterConfig.isBuild) { + buildMap[name] = content; + } + onLoad(content); + }, + + load: function (name, req, onLoad, config) { + //Name has format: some.module.filext!strip + //The strip part is optional. + //if strip is present, then that means only get the string contents + //inside a body tag in an HTML string. For XML/SVG content it means + //removing the declarations so the content can be inserted + //into the current doc without problems. + + // Do not bother with the work if a build and text will + // not be inlined. + if (config && config.isBuild && !config.inlineText) { + onLoad(); + return; + } + + masterConfig.isBuild = config && config.isBuild; + + var parsed = text.parseName(name), + nonStripName = parsed.moduleName + + (parsed.ext ? '.' + parsed.ext : ''), + url = req.toUrl(nonStripName), + useXhr = (masterConfig.useXhr) || + text.useXhr; + + // Do not load if it is an empty: url + if (url.indexOf('empty:') === 0) { + onLoad(); + return; + } + + //Load the text. Use XHR if possible and in a browser. + if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) { + text.get(url, function (content) { + text.finishLoad(name, parsed.strip, content, onLoad); + }, function (err) { + if (onLoad.error) { + onLoad.error(err); + } + }); + } else { + //Need to fetch the resource across domains. Assume + //the resource has been optimized into a JS module. Fetch + //by the module name + extension, but do not include the + //!strip part to avoid file system issues. + req([nonStripName], function (content) { + text.finishLoad(parsed.moduleName + '.' + parsed.ext, + parsed.strip, content, onLoad); + }); + } + }, + + write: function (pluginName, moduleName, write, config) { + if (buildMap.hasOwnProperty(moduleName)) { + var content = text.jsEscape(buildMap[moduleName]); + write.asModule(pluginName + "!" + moduleName, + "define(function () { return '" + + content + + "';});\n"); + } + }, + + writeFile: function (pluginName, moduleName, req, write, config) { + var parsed = text.parseName(moduleName), + extPart = parsed.ext ? '.' + parsed.ext : '', + nonStripName = parsed.moduleName + extPart, + //Use a '.js' file name so that it indicates it is a + //script that can be loaded across domains. + fileName = req.toUrl(parsed.moduleName + extPart) + '.js'; + + //Leverage own load() method to load plugin value, but only + //write out values that do not have the strip argument, + //to avoid any potential issues with ! in file names. + text.load(nonStripName, req, function (value) { + //Use own write() method to construct full module value. + //But need to create shell that translates writeFile's + //write() to the right interface. + var textWrite = function (contents) { + return write(fileName, contents); + }; + textWrite.asModule = function (moduleName, contents) { + return write.asModule(moduleName, fileName, contents); + }; + + text.write(pluginName, nonStripName, textWrite, config); + }, config); + } + }; + + if (masterConfig.env === 'node' || (!masterConfig.env && + typeof process !== "undefined" && + process.versions && + !!process.versions.node && + !process.versions['node-webkit'])) { + //Using special require.nodeRequire, something added by r.js. + fs = require.nodeRequire('fs'); + + text.get = function (url, callback, errback) { + try { + var file = fs.readFileSync(url, 'utf8'); + //Remove BOM (Byte Mark Order) from utf8 files if it is there. + if (file.indexOf('\uFEFF') === 0) { + file = file.substring(1); + } + callback(file); + } catch (e) { + if (errback) { + errback(e); + } + } + }; + } else if (masterConfig.env === 'xhr' || (!masterConfig.env && + text.createXhr())) { + text.get = function (url, callback, errback, headers) { + var xhr = text.createXhr(), header; + xhr.open('GET', url, true); + + //Allow plugins direct access to xhr headers + if (headers) { + for (header in headers) { + if (headers.hasOwnProperty(header)) { + xhr.setRequestHeader(header.toLowerCase(), headers[header]); + } + } + } + + //Allow overrides specified in config + if (masterConfig.onXhr) { + masterConfig.onXhr(xhr, url); + } + + xhr.onreadystatechange = function (evt) { + var status, err; + //Do not explicitly handle errors, those should be + //visible via console output in the browser. + if (xhr.readyState === 4) { + status = xhr.status || 0; + if (status > 399 && status < 600) { + //An http 4xx or 5xx error. Signal an error. + err = new Error(url + ' HTTP status: ' + status); + err.xhr = xhr; + if (errback) { + errback(err); + } + } else { + callback(xhr.responseText); + } + + if (masterConfig.onXhrComplete) { + masterConfig.onXhrComplete(xhr, url); + } + } + }; + xhr.send(null); + }; + } else if (masterConfig.env === 'rhino' || (!masterConfig.env && + typeof Packages !== 'undefined' && typeof java !== 'undefined')) { + //Why Java, why is this so awkward? + text.get = function (url, callback) { + var stringBuffer, line, + encoding = "utf-8", + file = new java.io.File(url), + lineSeparator = java.lang.System.getProperty("line.separator"), + input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)), + content = ''; + try { + stringBuffer = new java.lang.StringBuffer(); + line = input.readLine(); + + // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324 + // http://www.unicode.org/faq/utf_bom.html + + // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK: + // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058 + if (line && line.length() && line.charAt(0) === 0xfeff) { + // Eat the BOM, since we've already found the encoding on this file, + // and we plan to concatenating this buffer with others; the BOM should + // only appear at the top of a file. + line = line.substring(1); + } + + if (line !== null) { + stringBuffer.append(line); + } + + while ((line = input.readLine()) !== null) { + stringBuffer.append(lineSeparator); + stringBuffer.append(line); + } + //Make sure we return a JavaScript string and not a Java string. + content = String(stringBuffer.toString()); //String + } finally { + input.close(); + } + callback(content); + }; + } else if (masterConfig.env === 'xpconnect' || (!masterConfig.env && + typeof Components !== 'undefined' && Components.classes && + Components.interfaces)) { + //Avert your gaze! + Cc = Components.classes; + Ci = Components.interfaces; + Components.utils['import']('resource://gre/modules/FileUtils.jsm'); + xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc); + + text.get = function (url, callback) { + var inStream, convertStream, fileObj, + readData = {}; + + if (xpcIsWindows) { + url = url.replace(/\//g, '\\'); + } + + fileObj = new FileUtils.File(url); + + //XPCOM, you so crazy + try { + inStream = Cc['@mozilla.org/network/file-input-stream;1'] + .createInstance(Ci.nsIFileInputStream); + inStream.init(fileObj, 1, 0, false); + + convertStream = Cc['@mozilla.org/intl/converter-input-stream;1'] + .createInstance(Ci.nsIConverterInputStream); + convertStream.init(inStream, "utf-8", inStream.available(), + Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER); + + convertStream.readString(inStream.available(), readData); + convertStream.close(); + inStream.close(); + callback(readData.value); + } catch (e) { + throw new Error((fileObj && fileObj.path || '') + ': ' + e); + } + }; + } + return text; +}); diff --git a/mkdocs/search_index.json b/mkdocs/search_index.json new file mode 100644 index 0000000..e5154d2 --- /dev/null +++ b/mkdocs/search_index.json @@ -0,0 +1,184 @@ +{ + "docs": [ + { + "location": "/", + "text": "Django REST Framework Docs (DRF Docs) allows you to list all your API Endpoints that inherit from \nDjango REST Framework\n \nautomatically\n. Its purpose is to work out of the box and it should take a minimum to install it.\n\n\n Visit the Demo\n\n\nLive API Endpoints\n\n\nA really useful feature of DRF Docs is that you can also test endpoints from within the docs. Feel free to use our demo and try them! For more information visit the \nLive API Endpoints\n page of the docs.\n\n\n\n\nHow It Works\n\n\nThe concept is pretty simple. Once you \ninstall it\n you should go the the url you set (ie. \nhttp://0.0.0.0:8000/docs/\n) and you should see all your API endpoints along with the serializer fields, allowed methods etc for each one.\n\n\nDRF Docs will then read all your \nurls\n and will list those that inherit from Django REST Framework's \nAPIView\n.", + "title": "Home" + }, + { + "location": "/#live-api-endpoints", + "text": "A really useful feature of DRF Docs is that you can also test endpoints from within the docs. Feel free to use our demo and try them! For more information visit the Live API Endpoints page of the docs.", + "title": "Live API Endpoints" + }, + { + "location": "/#how-it-works", + "text": "The concept is pretty simple. Once you install it you should go the the url you set (ie. http://0.0.0.0:8000/docs/ ) and you should see all your API endpoints along with the serializer fields, allowed methods etc for each one. DRF Docs will then read all your urls and will list those that inherit from Django REST Framework's APIView .", + "title": "How It Works" + }, + { + "location": "/installation/", + "text": "The installation itself should not take more than a couple of minutes. Follow the simple steps below.\n\n\nInstall from PyPI\n\n\npip install drfdocs\n\n\n\nAdd 'rest_framework_docs' to your \nINSTALLED_APPS\n setting:\n\n\nINSTALLED_APPS = (\n ...\n 'rest_framework_docs',\n)\n\n\n\nFinally include the \nrest_framework_docs\n urls in your \nurls.py\n:\n\n\nurlpatterns = [\n ...\n url(r'^docs/', include('rest_framework_docs.urls')),\n]\n\n\n\nYou can now visit \nhttp://0.0.0.0:/8000/docs/\n to view your Web API's docs.", + "title": "Installation" + }, + { + "location": "/installation/#install-from-pypi", + "text": "pip install drfdocs Add 'rest_framework_docs' to your INSTALLED_APPS setting: INSTALLED_APPS = (\n ...\n 'rest_framework_docs',\n) Finally include the rest_framework_docs urls in your urls.py : urlpatterns = [\n ...\n url(r'^docs/', include('rest_framework_docs.urls')),\n] You can now visit http://0.0.0.0:/8000/docs/ to view your Web API's docs.", + "title": "Install from PyPI" + }, + { + "location": "/settings/", + "text": "How to set the settings\n\n\nTo set DRF docs' settings just include the dictionary below in Django's \nsettings.py\n file.\n\n\nREST_FRAMEWORK_DOCS = {\n 'HIDE_DOCS': True\n}\n\n\n\nSettings Description\n\n\nHIDE_DOCS\n\n\nYou 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.\n\n\nREST_FRAMEWORK_DOCS = {\n 'HIDE_DOCS': os.environ.get('HIDE_DRFDOCS', False)\n}\n\n\n\nThen set the value of the environment variable \nHIDE_DRFDOCS\n for each environment (ie. Use \n.env\n files)\n\n\nList of Settings\n\n\n\n\n\n\n\n\nSetting\n\n\nType\n\n\nOptions\n\n\nDefault\n\n\n\n\n\n\n\n\n\n\nHIDE_DOCS\n\n\nBoolean\n\n\nTrue\n, \nFalse\n\n\nFalse", + "title": "Settings" + }, + { + "location": "/settings/#how-to-set-the-settings", + "text": "To set DRF docs' settings just include the dictionary below in Django's settings.py file. REST_FRAMEWORK_DOCS = {\n 'HIDE_DOCS': True\n}", + "title": "How to set the settings" + }, + { + "location": "/settings/#settings-description", + "text": "", + "title": "Settings Description" + }, + { + "location": "/settings/#hide_docs", + "text": "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 = {\n 'HIDE_DOCS': os.environ.get('HIDE_DRFDOCS', False)\n} Then set the value of the environment variable HIDE_DRFDOCS for each environment (ie. Use .env files)", + "title": "HIDE_DOCS" + }, + { + "location": "/settings/#list-of-settings", + "text": "Setting Type Options Default HIDE_DOCS Boolean True , False False", + "title": "List of Settings" + }, + { + "location": "/live-api/", + "text": "What is \"Live API Endpoints\"?\n\n\nLive API Endpoints allow you to test your endpoints from within DRF docs. For each endpoints you can press the little \nplug\n icon which will bring up a modal with all the endpoint's fields and all the relevant information so that you can make a request instantly.\n\n\nIt is still in \nbeta\n so if you face any problems - feel free to open an issue/pull request on GitHub.\n\n\n\n\nThe Live API is made with \nReact\n. For more information on how to hack on them, check the README of the repository.", + "title": "Live API Endpoints" + }, + { + "location": "/live-api/#what-is-live-api-endpoints", + "text": "Live API Endpoints allow you to test your endpoints from within DRF docs. For each endpoints you can press the little plug icon which will bring up a modal with all the endpoint's fields and all the relevant information so that you can make a request instantly. It is still in beta so if you face any problems - feel free to open an issue/pull request on GitHub. The Live API is made with React . For more information on how to hack on them, check the README of the repository.", + "title": "What is \"Live API Endpoints\"?" + }, + { + "location": "/templates/", + "text": "Create the template file\n\n\nTo edit the template you will have to create a \n.html\n file to override the original one. Inside your \ntemplates\n directory create a directory named \nrest_framework_docs\n and inside this create the file \ndocs.html\n. You can then extend/override the default template.\n\n\n{% extends \"rest_framework_docs/base.html\" %}\n\n\n\nDefault Blocks\n\n\nStyles (CSS)\n\n\n{% block style %}\n\n{% endblock %}\n\n\n\nGitHub Badge\n\n\nTo hide the GitHub badge from the page, just override it with an empty block.\n\n\n{% block github_badge %}{% endblock %}\n\n\n\nTitle\n\n\n{% block title %}Project Name{% endblock %}\n\n\n\nLogo\n\n\n{% block logo %}\n DRF Docs\n{% endblock %}\n\n\n\nJumbotron\n\n\n{% block jumbotron %}\nAwaiting request...
-
-
- {hasToken ? (
- $2>")+c[2],r=c[0];r--;)s=s.lastChild;if(!ae.leadingWhitespace&&He.test(i)&&f.push(t.createTextNode(He.exec(i)[0])),!ae.tbody)for(i="table"!==u||ze.test(i)?"
t |