This repository has been archived by the owner. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for markdown files (#2)
* Adding support for markdown files * Initialize project with basic instructions * Add navigation to documentation * Use markdown library for rendering * Update README.md with new instructions * Remove unused /views folder * Edit documentation
- Loading branch information
Showing
17 changed files
with
222 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2019 Major League Hacking, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Introduction | ||
|
||
This is a hackathon boilerplate for new Flask web applications created by [Major League Hacking](https://github.com/MLH). It is for hackers looking to get started quickly on a new hackathon project using the Flask microframework. | ||
|
||
* [Installation Guide](#installation-guide) - How to get started with a new Flask app | ||
* [User Guide](/user-guide) - How to develop apps created with this starter project | ||
* [Contributing Guide](/contributing) - How to contribute to the project | ||
|
||
# <a name='installation-guide'>Installation Guide</a> | ||
|
||
This project requires the following tools: | ||
|
||
* Python ([3.4](https://www.python.org/downloads/)) - The programming language used by Flask. | ||
* PostgreSQL ([9.4](https://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.4)) - A relational database system. | ||
* Virtualenv - A tool for creating isolated Python environments. | ||
|
||
To get started, install Python and Postgres on your local computer, if you don't have them already. A simple way for Mac OS X users to install Postgres is using [Postgres.app](https://postgresapp.com/). You can optionally use another database system instead of Postgres, like [SQLite](http://flask.pocoo.org/docs/1.0/patterns/sqlite3/). | ||
|
||
## Installation | ||
|
||
**1. Clone this repository to your local computer.** | ||
|
||
``` | ||
$ git clone https://github.com/MLH/github-hackathon-starter.git | ||
$ cd github-hackathon-starter | ||
``` | ||
|
||
**2. Create and activate a [virtual environment](http://flask.pocoo.org/docs/1.0/installation/#virtual-environments).** | ||
|
||
``` | ||
$ python3 -m venv venv | ||
$ . venv/bin/activate | ||
``` | ||
|
||
**3. Install Flask dependencies using `pip`.** | ||
|
||
``` | ||
$ pip install -r requirements.txt | ||
``` | ||
|
||
|
||
## Starting the app | ||
|
||
You can run your application from your terminal using the `flask` command. To run the app locally, you need to tell Flask where to find your application, then run it in development mode. | ||
|
||
Development mode makes it easier to make changes to your application. It includes an interactive debugger and will restart the server whenever you make changes to the code. | ||
|
||
For Linux and Mac: | ||
|
||
``` | ||
export FLASK_APP=starter | ||
export FLASK_ENV=development | ||
flask run | ||
``` | ||
|
||
For Windows Powershell, use `$env:` instead of `export`: | ||
|
||
``` | ||
$env:FLASK_APP = 'starter' | ||
$env:FLASK_ENV = 'development' | ||
flask run | ||
``` | ||
|
||
### `flask run` | ||
|
||
Runs the app in development mode. Requires the `FLASK_APP` and `FLASK_ENV` variables to be set. | ||
Opens http://localhost:5000 to view it in your browser. | ||
|
||
The app will automatically reload if you make changes to the code. | ||
You will see the build errors and warnings in the console. | ||
|
||
### `pip install` | ||
|
||
Installs a Python package for your application. Used to add new functionality to the project. | ||
|
||
# What's Included? | ||
|
||
* [Flask](http://flask.pocoo.org/) - A microframework for Python web applications | ||
* [Flask Blueprints](http://flask.pocoo.org/docs/1.0/blueprints/) - A Flask concept for making modular applications | ||
* [Flask-SQLAlchemy](http://flask-sqlalchemy.pocoo.org/2.3/) - A Flask extension that adds ORM support for your data models. | ||
* [Flask-Misaka](https://flask-misaka.readthedocs.io) - A Flask extension that supports rendering markdown into HTML. | ||
* [Werkzeug](http://werkzeug.pocoo.org/) - A Flask framework that implements WSGI for handling server requests. | ||
* [Bootstrap 4](https://getbootstrap.com/) - An open source design system for HTML, CSS, and JS. | ||
* [Jinja2](http://jinja.pocoo.org/docs/2.10/) - A templating language for Python, used by Flask. | ||
|
||
# Code of Conduct | ||
|
||
The [MLH Code of Conduct](https://static.mlh.io/docs/mlh-code-of-conduct.pdf) applies to project participants and we expect contributors and maintainers to adhere to this standard. | ||
|
||
# License | ||
|
||
The Hackathon Starter Kit is open source software [licensed as MIT](https://github.com/nlaz/github-hackathon-starter/blob/master/LICENSE.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
alembic==1.0.6 | ||
certifi==2018.11.29 | ||
cffi==1.11.5 | ||
chardet==3.0.4 | ||
Click==7.0 | ||
Flask==1.0.2 | ||
Flask-Misaka==1.0.0 | ||
Flask-SQLAlchemy==2.3.2 | ||
gunicorn==19.9.0 | ||
idna==2.8 | ||
itsdangerous==1.1.0 | ||
Jinja2==2.10 | ||
Mako==1.0.7 | ||
MarkupSafe==1.1.0 | ||
misaka==2.1.1 | ||
psycopg2==2.7.3.2 | ||
pycparser==2.19 | ||
python-dotenv==0.10.1 | ||
python-editor==1.0.3 | ||
requests==2.21.0 | ||
six==1.12.0 | ||
SQLAlchemy==1.2.16 | ||
urllib3==1.24.1 | ||
Werkzeug==0.14.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
from flask import ( | ||
Blueprint, flash, g, redirect, render_template, request, url_for, session | ||
) | ||
from flask import Blueprint, render_template | ||
|
||
from starter.controllers.auth import login_required | ||
from starter.extensions import markdown | ||
|
||
blueprint = Blueprint('public', __name__) | ||
|
||
@blueprint.route('/') | ||
def index(): | ||
return render_template('home/index.html') | ||
with open('README.md', 'r') as input_file: | ||
text = input_file.read() | ||
content = markdown.render(text) | ||
return render_template('home/index.html', body=content) | ||
|
||
@blueprint.route('/about') | ||
def about(): | ||
# TODO: Create this template | ||
return render_template('home/index.html') | ||
@blueprint.route('/user-guide') | ||
def user_guide(): | ||
with open('starter/docs/USER_GUIDE.md', 'r') as input_file: | ||
text = input_file.read() | ||
content = markdown.render(text) | ||
return render_template('home/index.html', body=content) | ||
|
||
@blueprint.route('/getting-started') | ||
def getting_started(): | ||
# TODO: Create this template | ||
return render_template('home/index.html') | ||
with open('starter/docs/GETTING_STARTED.md', 'r') as input_file: | ||
text = input_file.read() | ||
content = markdown.render(text) | ||
return render_template('home/index.html', body=content) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Contributing | ||
|
||
* Core Ideas | ||
* Filing an issue | ||
* Submitting a Pull Request | ||
* Setting up a Local Copy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Getting Started | ||
|
||
* Environment requirements | ||
* Project structure | ||
* Installation commands | ||
* Simple command definitions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# User Guide | ||
|
||
This is the User Guide for the Hackathon Starter Kit. Here you will find additional documentation and guides on how to use the project. | ||
|
||
## How It Works | ||
|
||
## Starting the app | ||
|
||
## Project Structure (Overview) | ||
|
||
## Flask Development | ||
* Application Setup | ||
* Templates | ||
* Blueprints and Views | ||
* Static Files | ||
* Using the Database | ||
* Flash Messages | ||
|
||
## Guides | ||
|
||
### GitHub | ||
* Setting up OAuth apps, authentication, etc. | ||
* Fetching and using GitHub's API | ||
|
||
### PostgresSQL | ||
* Setting up database | ||
* Inserting and running commands | ||
|
||
## Deployment | ||
* Deploy to Heroku | ||
* Deploy to Google Cloud Platform | ||
* Deploy using Docker | ||
|
||
## Support | ||
* Troubleshooting | ||
* Support channel for hackathons | ||
* Filing issues | ||
* Contact email |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"""Database module""" | ||
from flask_sqlalchemy import SQLAlchemy | ||
from flask_misaka import Misaka | ||
|
||
db = SQLAlchemy() | ||
markdown = Misaka(fenced_code=True, tables=True, autolink=True, strikethrough=True, no_intra_emphasis=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters