Skip to content

Commit

Permalink
chore: make index page our readme
Browse files Browse the repository at this point in the history
  • Loading branch information
KolbyML committed Dec 4, 2023
1 parent a734c59 commit 430a578
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Python Import Index

This Undergraduate research project was done by Kolby Moroz Liebl and Marafi Mergani with research department UAlberta Software Maintenance and Reuse (SMR) at the University of Alberta. Our supervisors were Mohayeminul Islam and Sarah Nadi
This Undergraduate research project was done by [Kolby Moroz Liebl](https://github.com/KolbyML) and [Marafi Mergani](https://github.com/maraf-dev) with research department UAlberta Software Maintenance and Reuse (SMR) at the University of Alberta. Our supervisors were Mohayeminul Islam and Sarah Nadi

Instructions for using the tools we created locally will be provided below, but instructions to deploy our "Flask API Interface" will not be provided

Expand Down
11 changes: 7 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
from flask import Flask, json, make_response
from flask import Flask, json, make_response, render_template
from utils import get_db_connection
import markdown

app = Flask(__name__)
app = Flask(__name__, template_folder='.')


@app.route('/')
def hello_world(): # put application's code here
return 'Python Import Index read our ReadMe https://github.com/ualberta-smr/Python-Import-Index/blob/main/README.md\n\n\n Made by Kolby Moroz Liebl and Marafi Mergani'

f = open('README.md', 'r')
markdownFile = f.read()
stringOfMarkdown = markdown.markdown(markdownFile, extensions=['markdown.extensions.toc', 'markdown.extensions.attr_list','markdown.extensions.codehilite','markdown.extensions.fenced_code'])
return render_template('index.html', stringOfMarkdown = stringOfMarkdown)

# http://127.0.0.1:5000/library/discord.py:0.11.0,setuptools
@app.route('/library/<string:packages>')
Expand Down
26 changes: 26 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" rel="stylesheet">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js">
</script>
<title>Python Import Index</title><!-- Required meta tags -->
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"><!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
</head>
<body>
<div class="container">
<script>
hljs.initHighlightingOnLoad();
</script> {{stringOfMarkdown|safe}} <!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js">
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js">
</script>
</div>
</body>
</html>
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ toml==0.10.2
urllib3==2.1.0
Werkzeug==3.0.1
wimpy==0.6
markdown==3.5.1

0 comments on commit 430a578

Please sign in to comment.