Add tutorial page, favicon.

- The tutorial is written in markdown and transformed into HTML via Javascript, so anyone can edit it without knowledge of web development.
This commit is contained in:
Chris Wilson 2020-07-31 19:59:33 -04:00
parent 49189bec02
commit d5d6c717e0
6 changed files with 99 additions and 0 deletions

View File

@ -72,6 +72,11 @@ def register_session():
session["_id"] = uuid4() # uniquely identify each session without needing a login session["_id"] = uuid4() # uniquely identify each session without needing a login
@app.route('/tutorial')
def readme():
return render_template("tutorial.html")
@app.route('/seed/<suuid:seed>') @app.route('/seed/<suuid:seed>')
def view_seed(seed: UUID): def view_seed(seed: UUID):
seed = Seed.get(id=seed) seed = Seed.get(id=seed)
@ -123,5 +128,10 @@ def host_room(room: UUID):
return render_template("host_room.html", room=room) return render_template("host_room.html", room=room)
@app.route('/<filename>', methods=['GET'])
def static_file(filename: str):
return app.send_static_file(filename)
from WebHostLib.customserver import run_server_process from WebHostLib.customserver import run_server_process
from . import tracker, upload, landing, check # to trigger app routing picking up on it from . import tracker, upload, landing, check # to trigger app routing picking up on it

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

View File

@ -0,0 +1,57 @@
#tutorial-wrapper{
margin-left: auto;
margin-right: auto;
}
#tutorial-wrapper h1{
font-size: 2.5rem;
font-weight: normal;
border-bottom: 1px solid #9f916a;
width: 100%;
}
#tutorial-wrapper h2{
font-size: 2rem;
font-weight: normal;
border-bottom: 1px solid #9f916a;
width: 100%;
}
#tutorial-wrapper h3{
font-size: 1.75rem;
font-weight: normal;
text-align: left;
width: 100%;
}
#tutorial-wrapper h4{
font-size: 1.5rem;
font-weight: normal;
}
#tutorial-wrapper h5{
font-size: 1.25rem;
font-weight: normal;
}
#tutorial-wrapper h6{
font-size: 1.25rem;
font-weight: normal;
color: #434343;
}
#tutorial-wrapper ul{
}
#tutorial-wrapper ol{
}
#tutorial-wrapper li{
}
#tutorial-wrapper a{
}

View File

@ -0,0 +1,17 @@
window.addEventListener('load', () => {
new Promise((resolve, reject) => {
let ajax = new XMLHttpRequest();
ajax.onreadystatechange = () => {
if (ajax.readyState !== 4) { return; }
if (ajax.status !== 200) { reject('Unable to retrieve tutorial markdown file.') }
resolve(ajax.responseText);
};
ajax.open('GET', 'tutorial.md', true);
ajax.send();
}).then((response) => {
let markdown = new showdown.Converter();
document.getElementById('tutorial-wrapper').innerHTML = markdown.makeHtml(response);
}).catch((error) => {
console.log(error);
});
});

View File

@ -0,0 +1 @@
# Tutorial Coming Soon™

View File

@ -0,0 +1,14 @@
{% extends 'layout.html' %}
{% block head %}
<title>Setup Tutorial</title>
<link rel="stylesheet" type="text/css" href="{{ static_autoversion("tutorial.css") }}" />
<script type="application/ecmascript" src="https://unpkg.com/showdown/dist/showdown.min.js"></script>
<script type="application/ecmascript" src="{{ static_autoversion("tutorial.js") }}"></script>
{% endblock %}
{% block body %}
<div id="tutorial-wrapper" class="main-content">
<!-- Content generated from MarkDown by EcmaScript -->
</div>
{% endblock %}