Skip to content

Commit

Permalink
v0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
motss committed Apr 18, 2020
1 parent 5c7f19e commit 4d063c0
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 12 deletions.
2 changes: 1 addition & 1 deletion deep_clone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

```ts
/** Import from GH via `denopkg` */
import { deepClone } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/deep_clone/mod.ts";
import { deepClone } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/deep_clone/mod.ts";

(async () => {
const simpleObject = {
Expand Down
2 changes: 1 addition & 1 deletion delay_until/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

```ts
/** Import from GH via `denopkg` */
import { delayUntil } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/delay_until/mod.ts";
import { delayUntil } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/delay_until/mod.ts";

(async () => {
await delayUntil(3e3);
Expand Down
4 changes: 2 additions & 2 deletions jsmodern/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

```ts
// It is recommended to only import those extensions you need instead of everything.
import { extend } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/jsmodern/extend.ts";
import { sum } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/jsmodern/array.ts";
import { extend } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/jsmodern/extend.ts";
import { sum } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/jsmodern/array.ts";

extend({ array: [sum] });

Expand Down
49 changes: 43 additions & 6 deletions lit_ntml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,23 @@
## Table of contents <!-- omit in toc -->

- [Usage](#usage)
- [html()](#html)
- [htmlFragment()](#htmlfragment)
- [html()](#html)
- [htmlSync()](#htmlsync)
- [htmlFragment()](#htmlfragment)
- [htmlFragmentSync()](#htmlfragmentsync)
- [API Reference](#api-reference)
- [html()](#html-1)
- [htmlSync()](#htmlsync-1)
- [htmlFragment()](#htmlfragment-1)
- [htmlFragmentSync()](#htmlfragmentsync-1)
- [License](#license)

## Usage

#### html()
### html()

```ts
import { html } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/lit_ntml/mod.ts";
import { html } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/lit_ntml/mod.ts";

const peopleList = ["Cash Black", "Vict Fisherman"];
const syncTask = () => `<h1>Hello, World!</h1>`;
Expand All @@ -37,10 +41,22 @@ const asyncListTask = async () =>
await html`${syncTask}${asyncLiteral}${asyncListTask}`; /** <!DOCTYPE html><html><head></head><body><h1>Hello, World!</h1><h2>John Doe</h2><ul><li>Cash Black</li><li>Vict Fisherman</li></ul></body></html> */
```

#### htmlFragment()
### htmlSync()

```ts
import { htmlSync as html } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/lit_ntml/mod.ts";

const peopleList = ['Cash Black', 'Vict Fisherman'];
const syncTask = () => `<h1>Hello, World!</h1>`;

html`${syncTask}${peopleList}`;
/** <!DOCTYPE html><html><head></head><body><h1>Hello, World!</h1>Cash BlackVictFisherman</body></html> */
```

### htmlFragment()

```ts
import { htmlFragment as html } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/lit_ntml/mod.ts";
import { htmlFragment as html } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/lit_ntml/mod.ts";

const syncTask = () => `<h1>Hello, World!</h1>`;
const externalStyleLiteral = `<style>body { margin: 0; padding: 0; box-sizing: border-box; }</style>`;
Expand All @@ -49,16 +65,37 @@ const externalStyleLiteral = `<style>body { margin: 0; padding: 0; box-sizing: b
await html`${externalStyleLiteral}${syncTask}`; /** <style>body { margin: 0; padding: 0; box-sizing: border-box; }</style><h1>Hello, World!</h1> */
```

### htmlFragmentSync()

```ts
import { htmlFragmentSync as html } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/lit_ntml/mod.ts";

const peopleList = ['Cash Black', 'Vict Fisherman'];
const syncTask = () => `<h1>Hello, World!</h1>`;
const asyncTask = Promise.resolve(1);

html`${syncTask}${peopleList}${asyncTask}`;
/** <h1>Hello, World!</h1>Cash BlackVictFisherman[object Promise] */
```

## API Reference

### html()

- returns: <[Promise][promise-mdn-url]&lt;[string][string-mdn-url]&gt;> Promise which resolves with rendered HTML document string.

### htmlSync()

This method works the same as `html()` except that this is the synchronous version.

### htmlFragment()

- returns: <[Promise][promise-mdn-url]&lt;[string][string-mdn-url]&gt;> Promise which resolves with rendered HTML document fragment string.

### htmlFragmentSync()

This method works the same as `htmlFragment()` except that this is the synchronous version.

## License

[MIT License](http://motss.mit-license.org/) © Rong Sen Ng
Expand Down
2 changes: 1 addition & 1 deletion normalize_diacritics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

```ts
/** Import from GH via `denopkg` */
import { normalize } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/normalize_diacritics/mod.ts";
import { normalize } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/normalize_diacritics/mod.ts";

(async () => {
const str = "söme stüff with áccènts";
Expand Down
2 changes: 1 addition & 1 deletion polling_observer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface DataType {
items: Record<string, any>[];
}

import { PollingObserver } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/polling_observer/mod.ts";
import { PollingObserver } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/polling_observer/mod.ts";

const obs = new PollingObserver((data /** list, observer */) => {
const { status, items } = data || {};
Expand Down

0 comments on commit 4d063c0

Please sign in to comment.