Dependencies ready to go
parent
5e3661dc2c
commit
28c6a9ac43
@ -1,73 +0,0 @@
|
|||||||
#
|
|
||||||
# This file is autogenerated by pip-compile with Python 3.11
|
|
||||||
# by the following command:
|
|
||||||
#
|
|
||||||
# pip-compile dev-requirements.in
|
|
||||||
#
|
|
||||||
black==23.7.0
|
|
||||||
# via -r dev-requirements.in
|
|
||||||
build==0.10.0
|
|
||||||
# via pip-tools
|
|
||||||
cfgv==3.4.0
|
|
||||||
# via pre-commit
|
|
||||||
click==8.1.7
|
|
||||||
# via
|
|
||||||
# black
|
|
||||||
# pip-tools
|
|
||||||
coverage[toml]==7.3.0
|
|
||||||
# via pytest-cov
|
|
||||||
distlib==0.3.7
|
|
||||||
# via virtualenv
|
|
||||||
filelock==3.12.2
|
|
||||||
# via virtualenv
|
|
||||||
identify==2.5.26
|
|
||||||
# via pre-commit
|
|
||||||
iniconfig==2.0.0
|
|
||||||
# via pytest
|
|
||||||
invoke==2.2.0
|
|
||||||
# via -r dev-requirements.in
|
|
||||||
isort==5.12.0
|
|
||||||
# via -r dev-requirements.in
|
|
||||||
mypy-extensions==1.0.0
|
|
||||||
# via black
|
|
||||||
nodeenv==1.8.0
|
|
||||||
# via pre-commit
|
|
||||||
packaging==23.1
|
|
||||||
# via
|
|
||||||
# black
|
|
||||||
# build
|
|
||||||
# pytest
|
|
||||||
pathspec==0.11.2
|
|
||||||
# via black
|
|
||||||
pip-tools==7.3.0
|
|
||||||
# via -r dev-requirements.in
|
|
||||||
platformdirs==3.10.0
|
|
||||||
# via
|
|
||||||
# black
|
|
||||||
# virtualenv
|
|
||||||
pluggy==1.2.0
|
|
||||||
# via pytest
|
|
||||||
pre-commit==3.3.3
|
|
||||||
# via -r dev-requirements.in
|
|
||||||
pyproject-hooks==1.0.0
|
|
||||||
# via build
|
|
||||||
pytest==7.4.0
|
|
||||||
# via
|
|
||||||
# -r dev-requirements.in
|
|
||||||
# pytest-cov
|
|
||||||
pytest-cov==4.1.0
|
|
||||||
# via -r dev-requirements.in
|
|
||||||
pyyaml==6.0.1
|
|
||||||
# via pre-commit
|
|
||||||
ruff==0.0.285
|
|
||||||
# via -r dev-requirements.in
|
|
||||||
shellcheck-py==0.9.0.5
|
|
||||||
# via -r dev-requirements.in
|
|
||||||
virtualenv==20.24.3
|
|
||||||
# via pre-commit
|
|
||||||
wheel==0.41.1
|
|
||||||
# via pip-tools
|
|
||||||
|
|
||||||
# The following packages are considered to be unsafe in a requirements file:
|
|
||||||
# pip
|
|
||||||
# setuptools
|
|
@ -0,0 +1,26 @@
|
|||||||
|
# app.py
|
||||||
|
|
||||||
|
from flask import Flask
|
||||||
|
from flask import render_template
|
||||||
|
from flask_assets import Bundle
|
||||||
|
from flask_assets import Environment
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
assets = Environment(app)
|
||||||
|
css = Bundle("src/main.css", output="dist/main.css")
|
||||||
|
js = Bundle("src/*.js", output="dist/main.js") # new
|
||||||
|
|
||||||
|
assets.register("css", css)
|
||||||
|
assets.register("js", js) # new
|
||||||
|
css.build()
|
||||||
|
js.build()
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/")
|
||||||
|
def homepage():
|
||||||
|
return render_template("index.html")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
app.run(debug=True)
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,5 @@
|
|||||||
|
/* static/src/main.css */
|
||||||
|
|
||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
@ -0,0 +1,20 @@
|
|||||||
|
{# templates/base.html -#}
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
{% assets 'css' -%}
|
||||||
|
<link rel="stylesheet" href="{{ ASSET_URL }}">
|
||||||
|
{% endassets -%}
|
||||||
|
{% assets 'js' -%}
|
||||||
|
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
|
||||||
|
{% endassets-%}
|
||||||
|
<title>Flask + htmlx + Tailwind CSS</title>
|
||||||
|
</head>
|
||||||
|
<body class="bg-blue-100">
|
||||||
|
{% block content -%}
|
||||||
|
{% endblock content -%}
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,5 @@
|
|||||||
|
{# templates/index.html -#}
|
||||||
|
{% extends "base.html" -%}
|
||||||
|
{% block content -%}
|
||||||
|
<h1>Hello Dirp</h1>
|
||||||
|
{% endblock content %}
|
@ -0,0 +1,10 @@
|
|||||||
|
/** @type {import('tailwindcss').Config} */
|
||||||
|
module.exports = {
|
||||||
|
content: [
|
||||||
|
'./learn_htmx/templates/**/*.html',
|
||||||
|
],
|
||||||
|
theme: {
|
||||||
|
extend: {},
|
||||||
|
},
|
||||||
|
plugins: [],
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
from invoke import task
|
||||||
|
|
||||||
|
|
||||||
|
@task
|
||||||
|
def tailwind(c, watch=False):
|
||||||
|
tailwind_cmd = "tailwindcss -i ./learn_htmx/static/src/main.css -o ./learn_htmx/static/dist/main.css --minify"
|
||||||
|
if watch:
|
||||||
|
tailwind_cmd = tailwind_cmd + "--watch"
|
||||||
|
c.run(tailwind_cmd)
|
||||||
|
|
||||||
|
|
||||||
|
@task
|
||||||
|
def serve_dev(c, host="0.0.0.0", port=8000):
|
||||||
|
c.run(f"FLASK_APP=./learn_htmx/app.py flask run --host {host} --port {port} --debug")
|
Loading…
Reference in New Issue