Get the docs rendering in the app

This commit replaces the old _API Documentation_ page with the Markdown
version that Catherine has been working on.

I’ve checked that there’s nothing obviously wrong or placeholder-y still
in there, so I think we’re good to go.
This commit is contained in:
Chris Hill-Scott
2016-04-15 10:48:31 +01:00
parent 3c87af44ee
commit 57ad64fae6
4 changed files with 19 additions and 144 deletions

View File

@@ -6,11 +6,6 @@ from app import api_key_api_client
from app.utils import user_has_permissions
@main.route("/documentation")
def documentation():
return render_template('views/documentation.html')
@main.route("/services/<service_id>/api-keys")
@login_required
@user_has_permissions('manage_api_keys')

View File

@@ -1,8 +1,10 @@
from flask import render_template, url_for, redirect, jsonify
import markdown
from flask import render_template, url_for, redirect, Markup
from app.main import main
from flask_login import login_required
from flask.ext.login import current_user
from mdx_gfm import GithubFlavoredMarkdownExtension
@main.route('/')
@@ -36,3 +38,15 @@ def pricing():
@main.route('/terms')
def terms():
return render_template('views/terms-of-use.html')
@main.route('/documentation')
def documentation():
with open('docs/index.md') as source:
return render_template(
'views/documentation.html',
body=Markup(markdown.markdown(
source.read(),
extensions=[GithubFlavoredMarkdownExtension()]
))
)