Skip to content

Commit

Permalink
Fix docs with iommi.js
Browse files Browse the repository at this point in the history
  • Loading branch information
boxed committed Nov 23, 2023
1 parent 81b0b20 commit a1d4008
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ coverage:
docs:
rm -f docs/test_doc__*
tox -e docs
cp iommi/static/js/iommi.js docs/_build/html/_static/

docs-viewer:
echo "http://127.0.0.1:10331"
Expand Down
8 changes: 4 additions & 4 deletions docs/test_doc_cookbook_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,8 @@ def album_choices(form, **_):
def test_form_with_foreign_key_reverse(small_discography, artist):
# language=rst
"""
How do I show a reverse foreign key relationship?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How do I enable a reverse foreign key relationship?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By default reverse foreign key relationships are hidden. To turn it on, pass `include=True` to the field. Note that these are read only, because the semantics of hijacking another models foreign keys would be quite weird.
"""
Expand All @@ -649,8 +649,8 @@ def test_form_with_foreign_key_reverse(small_discography, artist):
def test_non_rendered(artist):
# language=rst
"""
How set an initial value on a field that is not in the form?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How do I set an initial value on a field that is not in the form?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You do have to include the field, but you can make it not rendered by using
the `non_rendered` shortcut and setting `initial`.
Expand Down
1 change: 1 addition & 0 deletions iommi/style_bootstrap_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
bootstrap_docs = Style(
bootstrap,
root__assets__doc_style=Asset.css(attrs__href='https://docs.iommi.rocks/en/latest/_static/iframe_custom.css'),
root__assets__iommi_js=Asset.js(attrs=dict(src='/_static/iommi.js')),
internal=True,
Container=dict(
attrs__class={
Expand Down

0 comments on commit a1d4008

Please sign in to comment.