Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbkaplun/domscii
Convert arbitrary DOM elements to ASCII
https://github.com/dbkaplun/domscii
Last synced: 28 days ago
JSON representation
Convert arbitrary DOM elements to ASCII
- Host: GitHub
- URL: https://github.com/dbkaplun/domscii
- Owner: dbkaplun
- License: mit
- Created: 2015-10-23T08:39:42.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-01T01:47:24.000Z (about 8 years ago)
- Last Synced: 2024-10-14T16:11:41.678Z (about 1 month ago)
- Language: JavaScript
- Homepage: http://dbkaplun.github.io/domscii/
- Size: 105 KB
- Stars: 8
- Watchers: 4
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# domscii • [demo](http://dbkaplun.github.io/domscii/)
Convert arbitrary DOM elements to ASCII## Installation
```html
```
## Usage
```js
function handleASCII (ascii) { console.log(ascii); }
domscii(opts).then(handleASCII);
// or
domscii(el).then(handleASCII);
```### Options
```js
domscii({
// REQUIRED
el: undefined, // The element to render to ASCII.// DEFAULTS
template: '${char}', // How each character is formatted. Replaces '${color}' with an RGB value, and '${char}' with a representative ASCII character. For plaintext rendering, use '${char}'.
chars: '@#$=*!;:~-,.', // The ASCII characters to use for rendering, darkest to lightest. This can also be an array of strings.
newline: '\n', // The string to use for starting a new line of ASCII.
scaleX: 7.875, // Determines how many pixels are used for one ASCII character, horizontally.
scaleY: 15, // Determines how many pixels are used for one ASCII character, vertically.
html2canvas: {} // Specify html2canvas options. http://html2canvas.hertzen.com/documentation.html#available-options
});
```