Skip to content

Switch to iframes for in-line examples #145

@damncabbage

Description

@damncabbage

The in-line examples on the component pages sorta work, but it's mostly an artefact of the static assets/loom.css lining up with the current Bikeshed setup.

I think the only real way of making this work long-term is to have sandbox for each example. And that sandbox would need to have everything provided; examples would need to start providing the <html> onwards.

I'd probably do this via a convenience template calling bikeshed/modules/general/template, eg.

{- bikeshed/modules/my/actualthingtotest/example/e1.prj -}
{ bikeshed/modules/general/example
    { bikeshed/modules/my/actualthingtotest (...) ... ... }
}

Examples would still be distinct from Mocks in that the former would be in-line and the latter would still be on a new page: it's just that the construction of Examples will more closely match Mocks than they have previously.

The only problem that I can see: iframes need to have a fixed size (they don't autoexpand). Suggests welcome on this front. 😰

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions