Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
Add markdown help page parser
Browse files Browse the repository at this point in the history
  • Loading branch information
fullonic committed Feb 23, 2020
1 parent 657ae5f commit ef79825
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12,738 deletions.
7 changes: 4 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
from flask_socketio import SocketIO
from werkzeug.security import check_password_hash, generate_password_hash # noqa

from core.converter import ControlFile, ExperimentCycle
from core import ControlFile, ExperimentCycle, ResumeControl, ResumeDataFrame
from core.error_handler import checker
from core.resume import ResumeControl, ResumeDataFrame
from core import parser
from core.utils import (
SUPPORTED_FILES,
check_extensions,
Expand Down Expand Up @@ -375,7 +375,8 @@ def settings():

@app.route("/help", methods=["GET"])
def help():
return render_template("help.html")
help_page = parser("https://gitlab.com/fullonic/resPi/-/raw/master/README.md")
return render_template("help.html", help_page=help_page)


####################
Expand Down
1 change: 1 addition & 0 deletions core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from .converter import ControlFile, ExperimentCycle, FileFormater, Plot # noqa
from .resume import ResumeDataFrame, ResumeControl # noqa
from .parse_help_page import parser # noqa
11 changes: 11 additions & 0 deletions core/parse_help_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Markdown web page parser.
Converts raw markdown gitlab project help page into a html page."""

import markdown2
import requests


def parser(url="https://gitlab.com/fullonic/resPi/-/raw/master/README.md"):
"""Download page from gitlab and generate a html."""
return markdown2.markdown(requests.get(url).text)
2 changes: 1 addition & 1 deletion static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ body, .settingsModal {

#spinner-front {
z-index: 999;
margin-top: 45vh;
margin-top: 30vh;
color: #fff;
text-align: center;
}
Expand Down
Loading

0 comments on commit ef79825

Please sign in to comment.