# dynamic-posterjs

> HTML5 Canvas powered code editor.

Latest version **0.1.6** (published 2018-10-06) · 0 weekly downloads

## Install

```sh
npm install dynamic-posterjs
pnpm add dynamic-posterjs
yarn add dynamic-posterjs
bun add dynamic-posterjs
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2018-10-06 |
| First published | 2018-09-30 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 662.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | brdmvegeto |

## Links

- npm: https://www.npmjs.com/package/dynamic-posterjs
- Repository: https://github.com/zectbynmo/poster
- Homepage: https://github.com/zectbynmo/poster#readme
- Issues: https://github.com/zectbynmo/poster/issues
- npm.io page: https://npm.io/package/dynamic-posterjs

## Recent versions

- 0.1.6 (latest) — 2018-10-06
- 0.1.5 — 2018-10-06
- 0.1.4 — 2018-10-06
- 0.1.3 — 2018-10-06
- 0.1.2 — 2018-09-30

## README

# Poster
[![Join the chat at https://gitter.im/jdfreder/poster](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jdfreder/poster?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

HTML5 canvas based code editor.  
Demo at [http://jdfreder.github.io/poster/](http://jdfreder.github.io/poster/).

## Install

First install [node.js](https://nodejs.org/download/).  
Then install Poster inside the directory that you will be using it in:  

```
npm install posterjs
```

## Use (via HTML)
In an HTML file:

```html
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="node_modules/posterjs/build/poster.css">
        <script type="text/javascript" src="node_modules/posterjs/build/poster.js"></script>
    </head>
    <body>
        <div id="demo"></div>
        <script type="text/javascript">
            var demo_element = document.getElementById('demo');
            var poster = new poster.Poster();
            demo_element.appendChild(poster.el);

            // Set Poster's size, language, and value.
            poster.width = 600;
            poster.height = 300;
            poster.language = 'javascript';
            poster.value = "// Code here...";
        </script>
    </body>
</html>
```

### Loading additional languages
Download the language(s) files you want to use from PrismJS's repository [here](https://github.com/PrismJS/prism/tree/gh-pages/components).  Place the files in the directory that you're using Poster in.  Then inside your document's `<head>` tag, include the Javascript file(s) after Poster. i.e. Using the above example, adding support for Python:

```html
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="node_modules/posterjs/build/poster.css">
    <script type="text/javascript" src="node_modules/posterjs/build/poster.js"></script>
    <script type="text/javascript" src="prism-python.min.js"></script>
  </head>
  <body>
    <div id="demo"></div>
    <script type="text/javascript">
        var demo_element = document.getElementById('demo');
        var poster = new poster.Poster();
        demo_element.appendChild(poster.el);

        // Set Poster's size, language, and value.
        poster.width = 600;
        poster.height = 300;
        poster.language = 'python';
        poster.value = "# Code here...";
    </script>
  </body>
</html>
```

## Build

Runtime Poster doesn't depend on any libraries, [prism.js](http://prismjs.com/) is built into it for syntax highlighting.  Building Poster is simple.  First (fork&)clone this repository:

```
git clone https://github.com/jdfreder/poster.git
cd poster
```

Install [node.js](https://nodejs.org/download/) and then install the other dependencies:

```
npm install
```

Now you can build Poster:

```
gulp
```

The compiled output will be written to the `build` directory.

---
_Source: https://npm.io/package/dynamic-posterjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
