mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-04 22:38:25 -04:00
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:
@@ -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')
|
||||
|
||||
@@ -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()]
|
||||
))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user