[w3c/webcomponents] [templates] Unclear usage of markdown-like syntax in state object (#689)

First of all I want to say that I am very excited about this proposal. It is thorough and addresses a lot of concerns I had with updating templates.

One very minor issue that I found while reading through was regarding the markdown-like syntax in the basics section 3.1. It shows the following snippets:

```html
<section><h1>{{name}}</h1>Email: <a href="mailto:{{email}}">{{email}}</a></section>
```
```js
// Template content is '`<section><h1>{{name}}</h1>Email: <a href="mailto:{{email}}">{{email}}</a></section>'`
shadowRoot.appendChild(template.createInstance({name: "Ryosuke Niwa", email: "[rniwa@webkit.org](mailto:rniwa@webkit.org)"}));
```

However, in section 3.2 the usage is changed to the following:

```html
<template type="my-template-type" id="contactTemplate">
    <section><h1>{{name}}</h1>Email: <a href="mailto:{{email}}">{{email}}</a></section>`
</template>
```
```js
rniwa = {name: "R. Niwa", email: "rniwa@webkit.org"};
```

The difference between the two snippets being the notation of `email: "[rniwa@webkit.org](mailto:rniwa@webkit.org)"` in the former section. (This might have been artifact of multiple iterations, but that is my speculation)

Anyways, the usage as specified in section 3.2 with the compound attribute binding to the `href` attribute feels a lot more natural and understandable, whereas I have a lot of questions regarding the usage in section 3.1. It does not some clear to me how the relation of the brackets are used and how they map to either the attribute or textContent.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/689

Received on Thursday, 2 November 2017 14:59:49 UTC