mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-27 15:47:46 -06:00
Moving docs to readthedocs.org
This commit is contained in:
@@ -2,7 +2,7 @@ from django.conf.urls import include, url
|
||||
from django.contrib import admin
|
||||
from django.views.defaults import page_not_found
|
||||
|
||||
from views import home, docs, trigger_500
|
||||
from views import home, trigger_500
|
||||
from users.views import login, logout
|
||||
|
||||
|
||||
@@ -30,10 +30,6 @@ urlpatterns = [
|
||||
url(r'^api/docs/', include('rest_framework_swagger.urls')),
|
||||
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
|
||||
|
||||
# Dcoumentation
|
||||
url(r'^docs/$', docs, kwargs={'path': 'index'}, name='docs_root'),
|
||||
url(r'^docs/(?P<path>[\w-]+)/$', docs, name='docs'),
|
||||
|
||||
# Error testing
|
||||
url(r'^404/$', page_not_found),
|
||||
url(r'^500/$', trigger_500),
|
||||
|
||||
@@ -45,25 +45,6 @@ def home(request):
|
||||
})
|
||||
|
||||
|
||||
def docs(request, path):
|
||||
"""
|
||||
Display a page of Markdown-formatted documentation.
|
||||
"""
|
||||
filename = '{}/docs/{}.md'.format(settings.BASE_DIR.rsplit('/', 1)[0], path)
|
||||
try:
|
||||
with open(filename, 'r') as docfile:
|
||||
markup = docfile.read()
|
||||
except:
|
||||
raise Http404
|
||||
|
||||
content = mark_safe(markdown(markup, extensions=['mdx_gfm', 'toc']))
|
||||
|
||||
return render(request, 'docs.html', {
|
||||
'content': content,
|
||||
'path': path,
|
||||
})
|
||||
|
||||
|
||||
def trigger_500(request):
|
||||
"""Hot-wired method of triggering a server error to test reporting."""
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@
|
||||
</div>
|
||||
<div class="col-md-4 text-right">
|
||||
<p class="text-muted">
|
||||
<i class="fa fa-fw fa-book text-primary"></i> <a href="{% url 'docs_root' %}">Docs</a> ·
|
||||
<i class="fa fa-fw fa-book text-primary"></i> <a href="http://netbox.readthedocs.io/" target="_blank">Docs</a> ·
|
||||
<i class="fa fa-fw fa-cloud text-primary"></i> <a href="/api/docs/">API</a> ·
|
||||
<i class="fa fa-fw fa-code text-primary"></i> <a href="https://github.com/digitalocean/netbox">Code</a>
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user