mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
manual: Link to manual from each service
Closes #930 - Make targets to download wiki pages of each service - Add post-processor script for DocBook file processing Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
c6bccaaac0
commit
4064d6e231
128 files changed
+14994
-1539
No files matched your search
+13
-10
@@ -51,8 +51,9 @@ def init():
|
||||
|
||||
def index(request):
|
||||
"""Serve the index page"""
|
||||
return TemplateResponse(request, 'help_index.html',
|
||||
{'title': _('Documentation and FAQ')})
|
||||
return TemplateResponse(request, 'help_index.html', {
|
||||
'title': _('Documentation and FAQ')
|
||||
})
|
||||
|
||||
|
||||
def about(request):
|
||||
@@ -68,20 +69,22 @@ def about(request):
|
||||
return TemplateResponse(request, 'help_about.html', context)
|
||||
|
||||
|
||||
def manual(request):
|
||||
def manual(request, page='freedombox-manual.part.html'):
|
||||
"""Serve the manual page from the 'doc' directory"""
|
||||
try:
|
||||
with open(
|
||||
os.path.join(cfg.doc_dir, 'freedombox-manual.part.html'), 'r',
|
||||
encoding='utf-8') as input_file:
|
||||
page = '{}.part.html'.format(
|
||||
page) if not page.endswith('html') else page
|
||||
with open(os.path.join(cfg.doc_dir, page), 'r',
|
||||
encoding='utf-8') as input_file:
|
||||
content = input_file.read()
|
||||
except IOError:
|
||||
raise Http404
|
||||
|
||||
return TemplateResponse(request, 'help_manual.html', {
|
||||
'title': _('{box_name} Manual').format(box_name=_(cfg.box_name)),
|
||||
'content': content
|
||||
})
|
||||
return TemplateResponse(
|
||||
request, 'help_manual.html', {
|
||||
'title': _('{box_name} Manual').format(box_name=_(cfg.box_name)),
|
||||
'content': content
|
||||
})
|
||||
|
||||
|
||||
def download_manual(request):
|
||||
|
||||
@@ -32,8 +32,10 @@ urlpatterns = [
|
||||
url(r'^help/index/$', non_admin_view(views.index), name='index-explicit'),
|
||||
url(r'^help/about/$', non_admin_view(views.about), name='about'),
|
||||
url(r'^help/manual/$', non_admin_view(views.manual), name='manual'),
|
||||
url(r'^help/manual/download/$',
|
||||
non_admin_view(views.download_manual), name='download-manual'),
|
||||
url(r'^help/status-log/$',
|
||||
non_admin_view(views.status_log), name='status-log'),
|
||||
url(r'^help/manual/download/$', non_admin_view(views.download_manual),
|
||||
name='download-manual'),
|
||||
url(r'^help/manual/(?P<page>[\w-]+)?/?$', non_admin_view(views.manual),
|
||||
name='manual-page'),
|
||||
url(r'^help/status-log/$', non_admin_view(views.status_log),
|
||||
name='status-log'),
|
||||
]
|
||||
Reference in new issue
Block a user