Skip to content

Commit

Permalink
Update documentation (#2)
Browse files Browse the repository at this point in the history
* Update docs, add .readthedocs.yml, update CHANGELOG.md
  • Loading branch information
dyve committed Mar 16, 2021
1 parent 78cdf1c commit fb53cd4
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 10 deletions.
18 changes: 18 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: docs/requirements.txt
- method: pip
path: .
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [0.0.1] - In development

- Document approach to form rendering in `docs/forms.rst`.
- Use .readthedocs.yml to configure Read the Docs.
- Place AUTHORS in text file, remove from documentation.
- Drop all jQuery stuff since Bootstrap 5 does not need jQuery.
- Use `django_bootstrap5` as name for Python package.
- Started `django-bootstrap5` based on `django-bootstrap4`.
Expand Down
1 change: 0 additions & 1 deletion docs/authors.rst

This file was deleted.

33 changes: 33 additions & 0 deletions docs/forms.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
=====
Forms
=====

Forms are an important part of any Bootstrap version.

In this section, we describe our approach to rendering forms in Bootstrap 5.

Reference: https://getbootstrap.com/docs/5.0/forms/validation/

Structure of a rendered field
-----------------------------

A rendered fields has these components:

- wrapper
- label (optional)
- field
- help text (optional)
- validation texts (optional)

See below for an example.

.. code:: html

<div class="mb-3"> <!-- wrapper start -->
<label for="name" class="form-label">Email address</label> <!-- label -->
<input type="text" class="form-control" id="name" aria-describedby="nameHelp"> <!-- field -->
<div id="nameHelp" class="form-text">An alias is fine.</div> <!-- help text -->
<div class="valid-feedback">Looks good!</div> <!-- validation text -->
</div>

How and in which order these will components be rendered differs per widget type.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Contents:
installation
quickstart
migrate
forms
templatetags
settings
templates
widgets
authors
changelog
20 changes: 13 additions & 7 deletions docs/migrate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@
Migration
=========

Below is a list of caveats when migrating from Bootstrap3/django-bootstrap3 to Bootstrap4/django-bootstrap5.
Below is a list of caveats when migrating from `django-bootstrap4` (Bootstrap 4) to `django-bootstrap5` (Bootstrap 5).

This document only considers the differences between django-bootstrap3 and django-bootstrap5. For the migration
This document only considers the differences between `django-bootstrap4` and `django-bootstrap5`. For the migration
guide from Bootstrap 3 to 4, please look at the Bootstrap docs, especially the `Migration section <https://getbootstrap.com/docs/4.6/migration/>`_.

Icons
-----
jQuery
------

Bootstrap 5 does not ship with an icon set, so everything regarding to icons has been removed.
Bootstrap 5 does not depend on jQuery. Every function and tag referencing jQuery has been removed.

If you need easy access to icons that are compatible with Bootstrap 5, please consider
https://github.com/zostera/django-icons.
If you need jQuery, you will have to include it yourself.

Popper
------

We use the Bootstrap 5 JavaScript that has bundled Popper.

If you want a separate Popper.js file, do not use the `{% bootstrap_javascript %} tag, but load the JavaScript yourself.
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ whitelist_externals =
setenv =
PYTHONWARNINGS=all
commands =
coverage run --parallel-mode --source bootstrap5 manage.py test -v1 --noinput
coverage run --parallel-mode manage.py test -v1 --noinput
deps =
django22: Django==2.2.*
django30: Django==3.0.*
Expand Down

0 comments on commit fb53cd4

Please sign in to comment.