Skip to content

Commit

Permalink
Move chapter examples to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
greyli committed Mar 10, 2023
1 parent dfce502 commit e3b3793
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 42 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
{% extends 'base.html' %}
{% from 'bootstrap/form.html' import render_field, render_form, render_form_row %}
# 第 4 章:表单

{% block metas %}
{{ super() }}
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{% endblock %}

{% block styles %}
{{ super() }}
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
{% endblock %}
## 使用 Bootstrap-Flask 渲染表单

base.html

```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>HelloFlask</title>
{% block styles %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
{% endblock %}
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>
```

index.html

```html
{% extends 'base.html' %}
{% from 'bootstrap5/form.html' import render_field, render_form, render_form_row %}

{% block content %}
<div class="container">
Expand All @@ -33,3 +50,4 @@ <h2>1. render_form_row</h2>
</form>
</div>
{% endblock %}
```
1 change: 0 additions & 1 deletion examples/c1/.flaskenv

This file was deleted.

31 changes: 0 additions & 31 deletions examples/c1/app.py

This file was deleted.

0 comments on commit e3b3793

Please sign in to comment.