Skip to content

Commit

Permalink
docs: fix README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kawarimidoll committed Jul 24, 2021
1 parent 3ee4de2 commit fdbd6e4
Showing 1 changed file with 25 additions and 57 deletions.
82 changes: 25 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,40 @@
# deno-dev-template
# deno-markup-tag

[![ci](https://github.com/kawarimidoll/deno-dev-template/workflows/ci/badge.svg)](.github/workflows/ci.yml)
[![ci](https://github.com/kawarimidoll/deno-markup-tag/workflows/ci/badge.svg)](.github/workflows/ci.yml)
[![deno.land](https://img.shields.io/badge/deno-%5E1.0.0-green?logo=deno)](https://deno.land)
[![vr scripts](https://badges.velociraptor.run/flat.svg)](https://velociraptor.run)
[![LICENSE](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE)
[![tag](https://img.shields.io/github/v/tag/kawarimidoll/deno-markup-tag?sort=semver)](https://github.com/kawarimidoll/deno-markup-tag/tags)

my deno template
## Usage

Confirm there is `~/.deno/bin` in `$PATH` to use the scripts installed by
`deno install`.
### tag

## Run with Velociraptor

Need to install [Velociraptor](https://velociraptor.run/).

```
$ # install velociraptor
$ deno install -qAn vr https://deno.land/x/velociraptor/cli.ts
$ # install hook
$ vr
```

The scripts are defined in [velociraptor.yml](/velociraptor.yml).

### Run main.ts

```
$ vr start
```

### Start server.ts

Need to install [deployctl](https://deno.com/deploy/docs/deployctl).

```
$ # install deployctl
$ deno install --allow-read --allow-write --allow-env --allow-net --allow-run --no-check -f https://deno.land/x/deploy/deployctl.ts
$ # start server
$ vr dev
```

### Run tests

Need to create `.env`.

```
$ # create .env
$ cp .env.example .env
$ # run tests
$ vr test
```
```ts
// common usage
assertEquals(
tag("div", { id: "foo", class: "bar" }, "Hello world!"),
`<div id="foo" class="bar">Hello world!</div>`,
);

### Run CI
// void (no-close) tag
assertEquals(tag("meta", { charset: "utf-8" }), `<meta charset="utf-8">`);

```
$ # run lint, format, tests
$ vr ci
// nested tags
assertEquals(
tag("ul", { class: "nav" }, tag("li", "first"), tag("li", "second")),
`<ul class="nav"><li>first</li><li>second</li></ul>`,
);
```

## Logger
### Character references

Import from `logger.ts`.
These constants are exported.

```ts
import { Logger } from "./logger.ts";

Logger.debug("This log is debug!");
Logger.info("This log is info!");
Logger.warning("This log is warning!");
Logger.error("This log is error!");
const NBSP = "&nbsp;";
const LT = "&lt;";
const GT = "&gt;";
const AMP = "&amp;";
const QUOT = "&quot;";
```

0 comments on commit fdbd6e4

Please sign in to comment.