Minor documentation formatting (Prettier)

pull/10998/head
LB Johnston 2023-11-12 17:04:11 +10:00 zatwierdzone przez LB (Ben Johnston)
rodzic 8932c67270
commit 2e2e8f4452
8 zmienionych plików z 9 dodań i 7 usunięć

Wyświetl plik

@ -12,7 +12,7 @@ You can customise the resolved value of this title using a JavaScript [event lis
The simplest way to add JavaScript to the editor is via the [`insert_global_admin_js` hook](insert_global_admin_js), however any JavaScript that adds the event listener will work.
## DOM Event
## DOM event
The event name to listen for is `'wagtail:images-upload'`. It will be dispatched on the image upload `form`. The event's `detail` attribute will contain:
@ -30,7 +30,7 @@ The event will 'bubble' up so that you can simply add a global `document` listen
See MDN for more information about [custom JavaScript events](https://developer.mozilla.org/en-US/docs/Web/Events/Creating_and_triggering_events).
## Code Examples
## Code examples
### Removing any url unsafe characters from the title

Wyświetl plik

@ -273,7 +273,7 @@ def register_viewset():
return CalendarViewSet()
```
Compared to the previous example with the two separate hooks, this will result in a single menu item "Calendar" that takes you to the `/admin/calendar/` URL. The second URL will not have its own menu item, but it will still be accessible at `/admin/calendar/month/`. This is useful for grouping related views together, that may not necessarily need their own menu items.
Compared to the previous example with the two separate hooks, this will result in a single menu item "Calendar" that takes you to the `/admin/calendar/` URL. The second URL will not have its own menu item, but it will still be accessible at `/admin/calendar/month/`. This is useful for grouping related views together, that may not necessarily need their own menu items.
For further customisations, refer to the {class}`~wagtail.admin.viewsets.base.ViewSet` documentation.

Wyświetl plik

@ -1,4 +1,5 @@
```{currentmodule} wagtail.admin.viewsets.model
```
(generic_views)=

Wyświetl plik

@ -58,8 +58,8 @@ To prevent deleting important revisions when they become stale, you can refer to
Support for respecting `on_delete=models.PROTECT` is added.
```
If the `pages` argument is supplied, only revisions of page models will be deleted. If the `non-pages` argument is supplied, only revisions of non-page models will be deleted. If both or neither arguments are supplied, revisions of all models will be deleted.
If deletion of a revision is not desirable, mark `Revision` with `on_delete=models.PROTECT`.
If the `pages` argument is supplied, only revisions of page models will be deleted. If the `non-pages` argument is supplied, only revisions of non-page models will be deleted. If both or neither arguments are supplied, revisions of all models will be deleted.
If deletion of a revision is not desirable, mark `Revision` with `on_delete=models.PROTECT`.
(purge_embeds)=

Wyświetl plik

@ -37,7 +37,6 @@ body = StreamField([
The `use_json_field` argument is no longer required.
```
## Block options
All block definitions accept the following optional keyword arguments:

Wyświetl plik

@ -1,4 +1,5 @@
```{module} wagtail.admin.viewsets
```
(viewsets_reference)=

Wyświetl plik

@ -1,4 +1,5 @@
```{currentmodule} wagtail.snippets.views.snippets
```
(wagtailsnippets_custom_admin_views)=

Wyświetl plik

@ -115,7 +115,7 @@ See [](multiple_formats) for full documentation.
### Images in multiple sizes
The `srcset_image` tag works like `image`, but allows specifying multiple sizes to generate a `srcset` attribute and leverage [responsive image rules](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images).
The `srcset_image` tag works like `image`, but allows specifying multiple sizes to generate a `srcset` attribute and leverage [responsive image rules](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images).
For example: