# `MishkaCmsCore.Dev.Generator`
[🔗](https://github.com/mishka-group/mishka_cms_core/blob/v0.0.1/lib/mishka_cms_core/dev/generator.ex#L5)

Generator for MishkaCmsCore resources.
- Test functions (no prefix): simple, deterministic — used by factory and tests.
- Dev functions (dev_ prefix): realistic, rich data — used by dev seeds.

## Every attribute an action accepts is named

One a generator leaves out is INVENTED by `Ash.Generator` from its type, and a type is looser than
the resource: a layout's `example` drawn from all of printable Unicode passes `min_length: 3` and
is refused by the guard, which strips zero-width and control characters before counting, so seeds
failed now and then. The same omission made `precompile` a coin flip and `uploads` a random list
before it. `MishkaCmsCore.Dev.GeneratorNamesEveryAttributeTest` reads each `defaults` list against
its action's `accept`, so an attribute added to a resource fails there first.

## The error-page templates are AUTHOR CONTENT, not markup

`generate_error_pages/0` builds template STRINGS that are written into the database. Nothing here
is rendered by Phoenix: `MishkaCmsCore.Runtime.Compilers.ErrorCompiler` reads those rows back,
compiles them per site and serves them from a controller on a PUBLIC page. Two things follow.

Their Tailwind classes are found by the per-site pass over stored templates rather than by
`mix admin_css`, which is why `test/mishka_cms_web/live/interpolated_class_test.exs` exempts this
file by name.

And they cannot carry an inline event handler. A site that enforces a Content-Security-Policy
refuses `onclick=` outright — `script-src` has no nonce or hash that applies to an event handler,
so the attribute IS the violation — and there is no LiveView on an error page to accept a
`phx-click` instead. A control that needs the browser to move is therefore a link: "Try Again"
re-requests `@conn.request_path`, which is what a reload is. Walking back through history is the
one thing no link expresses, so it is not offered.

# `component`

# `dev_error_page`

# `dev_layout_global`

# `dev_layout_with_tenant`

# `dev_page_with_layout`

# `dev_page_without_layout`

# `dev_site`

# `error_page`

# `generate`

# `generate_many`

# `js_hook`

# `layout`

# `media`

# `media_category`

# `page`

# `permission`

# `redirect`

# `site`

# `user`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
