Skip to content

yourepo/Kennel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

154 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kennel

A complete implementation of Sileo's native depictions in TypeScript.


Get Started

$ npm i @parcility/kennel

API

Kennel was written to be as easy to interact with as possible.

render(depiction: any, options?: Partial<RenderOptions>): Promise<HTMLElement | string>

Render a depiction to either a HTMLElement or a string.

depiction: An object that stores the native depiction's contents.

options: The settings used for rendering.

options.ssr: Output a string instead of a DOM element.

options.defaultTintColor: The css color used for the tint.

options.backgroundColor: The css color used for the background.

options.ignoredViewNames: An array of view class names to ignore/not render.

options.linkForm: Link to a webpage to render form- links.

options.linkHeaderless: Link to a webpage to render depiction- links.

options.proxyIframeUrl: The specific proxy url to use for iframe only.

options.proxyImageUrl: The specific proxy url to use for image only.

options.proxyVideoUrl: The specific proxy url to use for video only.

options.proxyUrl: The default proxy url to use for iframe, image or video.

hydrate(target?: ParentNode): void

Runs the hydrate function on views that need to be hydrate. Can only be ran on the client side. target: The root element for hydration. Defaults to document.body.

Example

// Import Kennel
import { render, hydrate } from "@parcility/kennel";

// Assumes the `depiction` variables exists elsewhere. The second argument (options) can be omitted.
let output = await render(depiction, { ssr: true });

// sometime on the client.
hydrate();

A full demo is available by running yarn dev.


Development

Testing

Run the test page, which loads depictions from the test/ directory.

yarn dev

Building

This is not required if you installed Kennel through NPM.

1: Install dependencies

yarn install

2: Build module

yarn build

About

A comprehensive, easy-to-use native depiction renderer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 83.5%
  • SCSS 8.4%
  • HTML 6.2%
  • CSS 1.2%
  • JavaScript 0.7%