Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rethink rendering final templates to DOM #57

Open
tpluscode opened this issue May 8, 2022 · 0 comments
Open

Rethink rendering final templates to DOM #57

tpluscode opened this issue May 8, 2022 · 0 comments

Comments

@tpluscode
Copy link
Member

I have this idea which might make it possible to be more flexible about actually rendering the result of properties to DOM

Instead of dumping everything in Shadow DOM of roadshow-view, the render function could return an array of individual property results (maybe only no top level?)

This could make is possible to select where they are rendered. By default would remain to put them in the shadow DOM but could also open for customisation where a result annotated with a CSS selector would go to a matching element in the Light DOM. Alternatively, it might actually create such elements but it's going to be tricky in lit to handle updates

For example, a schema:WebPage and its shape could look like

<>
  a schema:WebPage ;
  schema:hasPart [ a schema:WPHeader ; schema:cssSelector "header" ] ;
  schema:hasPart [ a schema:WPFooter ; schema:cssSelector "footer" ] ;
  schema:mainEntity </some-resource> ;
  dash:shape </layout/narrow> ;
.

</layout/narrow>
  sh:property [ 
    sh:path schema:hasPart ;
    sh:class schema:WPHeader ;
    dash:viewer :collapsibleHeaderViewer ;
  ] ,  [ 
    sh:path schema:hasPart ;
    sh:class schema:WPFooter ;
    dash:viewer :narrowFooter ;
  ] , [
    sh:path schema:mainEntity ;
    # no such property as of yet
    roadshow:cssSelector "section.main" ;
  ] ;
.

Then, given the view like below, the results of SHACL properties would be rendered in the slotted elements (would need a slot inside the shadow)

<roadshow-view>
  <header />
  <section class="main" />
  <footer />
</roadshow-view>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant