Skip to content
This repository has been archived by the owner on Apr 29, 2023. It is now read-only.

Commit

Permalink
Add README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Swizz committed Aug 12, 2017
1 parent b85523b commit 7791d22
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 18 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
@@ -1,4 +1,4 @@
Copyright © 2017-present [Jorge Bucaran](https://github.com/jbucaran)
Copyright © 2017-present [Quentin Gerodel](https://github.com/Swizz)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
55 changes: 38 additions & 17 deletions README.md
@@ -1,58 +1,79 @@
# hyperapp-package
[![Travis CI](https://img.shields.io/travis/YOU/hyperapp-PACKAGE/master.svg)](https://travis-ci.org/YOU/hyperapp-PACKAGE)
[![Codecov](https://img.shields.io/codecov/c/github/YOU/hyperapp-PACKAGE/master.svg)](https://codecov.io/gh/YOU/hyperapp-PACKAGE)
[![npm](https://img.shields.io/npm/v/hyperapp-PACKAGE.svg)](https://www.npmjs.org/package/PACKAGE)
# hyperapp-html
[![Travis CI](https://img.shields.io/travis/Swizz/hyperapp-html/master.svg)](https://travis-ci.org/Swizz/hyperapp-html)
[![Codecov](https://img.shields.io/codecov/c/github/Swizz/hyperapp-html/master.svg)](https://codecov.io/gh/Swizz/hyperapp-html)
[![npm](https://img.shields.io/npm/v/hyperapp-html.svg)](https://www.npmjs.org/package/hyperapp-html)
[![Slack](https://hyperappjs.herokuapp.com/badge.svg)](https://hyperappjs.herokuapp.com "Join us")

hyperapp-package is virgo HyperApp package starter.
Html helpers for hyperapp and every `h`.
## Installation

Using [npm](https://npmjs.com):

<pre>
npm i <a href="https://www.npmjs.com/package/hyperapp-PACKAGE">hyperapp-PACKAGE</a>
npm i <a href="https://www.npmjs.com/package/hyperapp-html">hyperapp-html</a>
</pre>

Then setup a [build pipeline](https://github.com/hyperapp/hyperapp/blob/master/docs/getting-started.md#build-pipeline) and import it.

```jsx
import { WHATEVER } from "hyperapp-PACKAGE"
import { div, h1 } from "hyperapp-html"
```

Using a CDN:

```html
<script src="https://unpkg.com/hyperapp-PACKAGE"></script>
<script src="https://unpkg.com/hyperapp-html"></script>
```

Then access the WHATEVER in the global scope as <samp>WHATEVER</samp>.
Then access the all hmtl tags or the factory in the global scope as <samp>div</samp>, <samp>h1</samp>, etc...

## Usage

```jsx
app({
})
const vnode = h1({ id: "title" }, "Hi.")
```

## Example

[Try it online](PLEASE ADD A LIVE PLAYGROUND)
<!-- [Try it online](PLEASE ADD A LIVE PLAYGROUND) -->

```jsx
app({
state: {
title: "Hi."
},
view: state => div({}, [
h1(null, state.title)
])
})
```

## API

### group
#### name
### Tags
#### tagname

Type: (props: object, children: vnode[]) => vnode

Type: ...
Call the proper `h` to return a vnode according to the tag name.

```jsx
const vnode = tagname({ id: "title" }, "Hi.")
```

Desc.
### Factory
#### html

Type: (h: function) => tagsObject

Return a calalog of html helpers that call the given `h` then return a vnode.

```jsx
const { tagname } = html(h)

const vnode = tagname({ id: "title" }, "Hi.")
```

## License

hyperapp-PACKAGE is MIT licensed (by default). See [LICENSE](LICENSE.md).
hyperapp-html is MIT licensed. See [LICENSE](LICENSE.md).

0 comments on commit 7791d22

Please sign in to comment.