Skip to content

Commit

Permalink
docs(README): update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Nov 7, 2023
1 parent ec859c2 commit 166ade2
Showing 1 changed file with 3 additions and 60 deletions.
63 changes: 3 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,10 @@
<div align="center"><img src="https://res.cloudinary.com/adonis-js/image/upload/v1620150474/edge-banner_tzmnox.jpg" width="600px"></div>

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of contents

- [Table of contents](#table-of-contents)
- [Maintainers](#maintainers)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Edge
> A template for Node.js
[![gh-workflow-image]][gh-workflow-url] [![typescript-image]][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url] [![synk-image]][synk-url]

Edge is a logical and batteries included template engine for Node.js. It can render any text based format, whether is **HTML**, **Markdown** or **plain text** files.

## Usage
Install the package from the npm registry.

```sh
npm i edge.js

# yarn
yarn add edge.js
```

And use it as follows

```js
const { join } = require('path')
[![gh-workflow-image]][gh-workflow-url] [![typescript-image]][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url]

// CommonJS
const { Edge } = require('edge.js')
Edge is a simple, Modern, and batteries included template engine for Node.js. Edge is similar to writing JavaScript. If you know JavaScript, you know Edge.

// Typescript import
// import { Edge } from 'edge.js'

const edge = new Edge({ cache: false })
edge.mount(join(__dirname, 'views'))

const html = await edge.render('welcome', {
greeting: 'Hello world'
})

console.log(html)
```

Next create the `views/welcome.edge` file.

```edge
<p> {{ greeting }} </p>
```

Edge was created to be used inside the AdonisJS framework. However it is a framework agnostic library and can be used standalone as well.

The documentation is written on the [AdonisJS website](https://docs.adonisjs.com/guides/views/rendering). In AdonisJS docs, we refer the `edge` variable as `view`.

<br />
<hr>
## 👉 [Learn more](https://edgejs.dev)

![](https://cdn.jsdelivr.net/gh/thetutlage/static/sponsorkit/sponsors.png)

Expand All @@ -73,6 +19,3 @@ The documentation is written on the [AdonisJS website](https://docs.adonisjs.com

[npm-image]: https://img.shields.io/npm/v/edge.js.svg?style=for-the-badge&logo=npm
[npm-url]: https://npmjs.org/package/edge.js 'npm'

[synk-image]: https://img.shields.io/snyk/vulnerabilities/github/edge-js/edge?label=Synk%20Vulnerabilities&style=for-the-badge
[synk-url]: https://snyk.io/test/github/edge-js/edge?targetFile=package.json "synk"

0 comments on commit 166ade2

Please sign in to comment.