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

Create tool to scaffold html tree from an example json #42

Open
GrosSacASac opened this issue Dec 18, 2018 · 0 comments
Open

Create tool to scaffold html tree from an example json #42

GrosSacASac opened this issue Dec 18, 2018 · 0 comments

Comments

@GrosSacASac
Copy link
Owner

One of the strength of this framework is the mapping between graphs (variables) and DOM.

Everything has to be done manually.

Create a tool that takes example JSON and outputs example HTML, the result could then be added directly or configured with extra structure and styling.

For example given

[
        {
            picture: "./images/boss.jpg",
            bio: "Loves biking and skating"
        },
        {
            picture: "./images/sister.jpg",
            bio: "Drinks tons of café."
        }
]

output could be

    <template data-template="user-element">
            <img data-variable="picture" alt="user-picture" class="user-picture">
            <p data-variable="bio" class="user-bio">SHORT BIO</p>
    </template>


    <div data-list="users-user-element"></div>

then after adding it to html d.feed({users: exampleGraph}); would just work

See other examples at https://dom99.now.sh/documentation#examples1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant