0.1.2 • Published 9 years ago
embed-support v0.1.2
Create embed codes for a static web project
Create a simple html page with embed codes and supporting script assets for embedding a web page in an auto-resizing iframe, based on iframe-resizer version 2.8.0.
The page to be embedded should contain iframeResizer.contentWindow.min.js.
The different types of embed codes are explained in the project documentation of embed-code, which this project uses for generating the embed codes.
Install
npm install embed-support -gUsage
Passing options via command line
embed-support --dest='dist' \\
--destUrl='http://www.my-server.com/embed/' \\
--iframeUrl='http://www.my-server.com/embed/?lang=en' \\
--verbosePassing options via configuration object
Create file embed-support-config.js
module.exports = {
dest: 'dist',
destUrl: 'http://www.my-server.com/embed/',
iframeUrl: 'http://www.my-server.com/embed/?lang=en'
}Then simply run
embed-support --verboseThe tool looks by default for a configuration object from ./embed-support-config.js. You can also specify an alternative path for the configuration object with the --config option.
Usage via Javascript API
var embedSupport = require('embed-support');
embedSupport({
dest: 'dist',
destUrl: 'http://www.my-server.com/embed/',
iframeUrl: 'http://www.my-server.com/embed/?lang=en'
});Options
dest: Local path to folder in which to create embed support assets (required).destUrl: URL pointing to thedestfolder on the target web server (optional, defaults toiframeUrl).iframeUrl: URL to set insrcfor the embedding iFrame (required).template: Custom template forembed-codes.html(optional)
CLI-only options
config: Alternative path for configuration object.verbose: Enable verbose output for command line.
Test
Make sure you have the correct node version
nvm useThen run tests with
npm test