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
--- | |
# ----------------------------------------------------------------------------- | |
# qr0001 – /Precision/UseDefiniteArticles | |
# | |
qr0001_precision_usedefinitearticles: | |
definition: > | |
Use definite article "the" rather than the | |
indefinite article "a." |
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
# ----------------------------------------------------------------------------- | |
def _get_page(title, id_topic, list_id_ui): | |
""" | |
Return the HTML page. | |
""" | |
html = xact.lib.ui.web.markup.html | |
page = html.document(title = title) | |
with page.head: | |
html.meta(charset = 'utf-8') |
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
htmx.defineExtension('xact', { | |
onEvent : function(name_evt_src, evt_src) { | |
// New logic is either swapped in or sent via SSE. | |
is_swap = (name_evt_src === 'htmx:afterSwap'); | |
is_sse = name_evt_src.startsWith('htmx:sse:'); | |
is_update = (is_swap || is_sse); | |
if (!is_update) { | |
return; | |
} |
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
<body> | |
<div data-hx-sse="connect:/topic"> | |
<div data-hx-sse="swap:outer"> | |
<div data-hx-sse="swap:inner1"></div> | |
<div data-hx-sse="swap:inner2"></div> | |
</div> | |
</div> | |
</body> |
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
/req/testpage: | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Test Page</title> | |
<meta charset="utf-8"> | |
<meta content="width=device-width, initial-scale=1.0" name="viewport"> | |
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;900&display=swap" rel="stylesheet"> | |
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet"> |
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
from geventwebsocket.handler import WebSocketHandler | |
from gevent.pywsgi import WSGIServer | |
from flask import Flask, request, render_template | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return render_template('index.html') |