views/integrations: Change non-generic HelpView to MarkdownDirectoryView.

The HelpView class will render a directory as markdown with an index HTML
page. This however can also be used for other generics and applied to
the API pages as well, so change the class to a generic class and
specify the path templates and names.

Tweaked by tabbott and Eeshan Garg.
This commit is contained in:
Brock Whittaker
2017-07-24 17:35:22 -07:00
committed by Tim Abbott
parent 4cb3cdb5b0
commit 6933d51c0f
2 changed files with 8 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ import os
import zerver.forms
from zproject import dev_urls
from zproject.legacy_urls import legacy_urls
from zerver.views.integrations import IntegrationView, APIView, HelpView
from zerver.views.integrations import IntegrationView, APIView, MarkdownDirectoryView
from zerver.lib.integrations import WEBHOOK_INTEGRATIONS
from zerver.webhooks import github_dispatcher
@@ -543,7 +543,9 @@ urls += [
urls += [url(r'^', include('social_django.urls', namespace='social'))]
# User documentation site
urls += [url(r'^help/(?P<article>.*)$', HelpView.as_view(template_name='zerver/help/main.html'))]
urls += [url(r'^help/(?P<article>.*)$',
MarkdownDirectoryView.as_view(template_name='zerver/help/main.html',
path_template='/zerver/help/%s.md'))]
if settings.DEVELOPMENT:
urls += dev_urls.urls