Skip to content

Commit

Permalink
Merge pull request #6 from voorhoede/use-tag-html-extension
Browse files Browse the repository at this point in the history
"use `*.tag.html` extension" rule
  • Loading branch information
petergoes committed Feb 22, 2016
2 parents 3f239fb + a9d70a8 commit 18a6516
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,31 @@ This guide provides a uniform way to structure your [RiotJS](http://riotjs.com/)
* easier to cache and serve bundles of code separately.

This guide is inspired by the [AngularJS Style Guide](https://github.com/johnpapa/angular-styleguide) by John Papa.


## Table of Contents

* [Use `*.tag.html` extension](#use-taghtml-extension)


## Use `*.tag.html` extension

Riot introduces a new concept called *tags*, and suggests to use a `*.tag` extension.
However in essence these tags are simply custom elements containing markup. Therefore you should **use the `*.tag.html` extension**.

### Why?

* Tells developers it's not just HTML, but a Riot tag element.
* Improves IDE support (signals how to interpret).

### How?

In case of [in-browser compilation](http://riotjs.com/guide/compiler/#in-browser-compilation):
```html
<script src="path/to/modules/my-example/my-example.tag.html" type="riot/tag"></script>
```

In case of [pre-compilation](http://riotjs.com/guide/compiler/#pre-compilation), set the [custom extension](http://riotjs.com/guide/compiler/#custom-extension):
```bash
riot --ext tag.html modules/ dist/tags.js
```

0 comments on commit 18a6516

Please sign in to comment.