diff --git a/examples/bootstrap5/app.py b/examples/bootstrap5/app.py index acb85b23..5e7441d5 100644 --- a/examples/bootstrap5/app.py +++ b/examples/bootstrap5/app.py @@ -287,6 +287,11 @@ def new_message(): return 'Here is the new message page. Return to table.' +@app.route('/image') +def test_image(): + return render_template('image.html') + + @app.route('/icon') def test_icon(): return render_template('icon.html') diff --git a/examples/bootstrap5/static/rectangle-256x64.png b/examples/bootstrap5/static/rectangle-256x64.png new file mode 100644 index 00000000..5a2763de Binary files /dev/null and b/examples/bootstrap5/static/rectangle-256x64.png differ diff --git a/examples/bootstrap5/static/rectangle-256x64.svg b/examples/bootstrap5/static/rectangle-256x64.svg new file mode 100644 index 00000000..ea2403f0 --- /dev/null +++ b/examples/bootstrap5/static/rectangle-256x64.svg @@ -0,0 +1,63 @@ + + + + diff --git a/examples/bootstrap5/templates/image.html b/examples/bootstrap5/templates/image.html new file mode 100644 index 00000000..da6c5551 --- /dev/null +++ b/examples/bootstrap5/templates/image.html @@ -0,0 +1,44 @@ +{% extends 'base.html' %} +{% from 'bootstrap5/utils.html' import render_image, render_figure %} + +{% block content %} +See also https://getbootstrap.com/docs/5.3/content/images/ +and https://getbootstrap.com/docs/5.3/content/figures/. + +
{% raw %}{{ render_image(url_for('static', filename='rectangle-256x64.png'), alt='url_for') }}{% endraw %}+Output: {{ render_image(url_for('static', filename='rectangle-256x64.png'), alt='url_for') }} + +
{% raw %}{{ render_image('static/rectangle-256x64.png', alt='thumb', corner='thumbnail') }}{% endraw %}+Output: {{ render_image('static/rectangle-256x64.png', alt='thumb', corner='thumbnail') }} + +
{% raw %}{{ render_image('static/rectangle-256x64.png', alt='fluid', fluid=True) }}{% endraw %}+Output: {{ render_image('static/rectangle-256x64.png', alt='fluid', fluid=True) }} + +
{% raw %}{{ render_image('static/rectangle-256x64.png', alt='center', text_align='center') }}{% endraw %}+Output: {{ render_image('static/rectangle-256x64.png', alt='center', text_align='center') }} +
{% raw %}{{ render_image('static/rectangle-256x64.png', alt='end', text_align='end') }}{% endraw %}+Output: {{ render_image('static/rectangle-256x64.png', alt='end', text_align='end') }} +
{% raw %}{{ render_image('static/rectangle-256x64.png', alt='mx-auto', mx_auto=True) }}{% endraw %}+Output: {{ render_image('static/rectangle-256x64.png', alt='mx-auto', mx_auto=True) }} + +
{% raw %}{{ render_image('static/rectangle-256x64.png', alt='rounded', corner='rounded') }}{% endraw %}+Output: {{ render_image('static/rectangle-256x64.png', alt='rounded', corner='rounded') }} + +
{% raw %}{{ render_image('static/rectangle-256x64.png', alt='float-start', float='start') }} +{{ render_image('static/rectangle-256x64.png', alt='float-end', float='end') }}{% endraw %}+Output: {{ render_image('static/rectangle-256x64.png', alt='float-start', float='start') }}{{ render_image('static/rectangle-256x64.png', alt='float-end', float='end') }} + +
{% raw %}{{ render_figure('static/rectangle-256x64.png', alt='rounded', caption='A caption for the above image.', corner='rounded') }}{% endraw %}+Output: {{ render_figure('static/rectangle-256x64.png', alt='rounded', caption='A caption for the above image.', corner='rounded') }} +
{% raw %}{{ render_figure('static/rectangle-256x64.png', alt='thumb', caption='A caption for the above image.', corner='thumbnail') }}{% endraw %}+Output: {{ render_figure('static/rectangle-256x64.png', alt='thumb', caption='A caption for the above image.', corner='thumbnail') }} +
{% raw %}{{ render_figure('static/rectangle-256x64.png', alt='end', caption='A caption for the above image.', text_align='end') }}{% endraw %}+Output: {{ render_figure('static/rectangle-256x64.png', alt='end', caption='A caption for the above image.', text_align='end') }} +{% endblock %} diff --git a/examples/bootstrap5/templates/index.html b/examples/bootstrap5/templates/index.html index f179ed36..2be8d0bc 100644 --- a/examples/bootstrap5/templates/index.html +++ b/examples/bootstrap5/templates/index.html @@ -10,6 +10,7 @@