1.0.2 • Published 6 years ago

element2file v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

Element2File

Element2File is a tool that allows you to generate (and save) pre-rendered content given an url a selector

How to use it

The config file looks like

// config.js
module.exports = config = {
    browser_args: [
        '--no-sandbox',
    	//'--disable-setuid-sandbox',
        '--enable-logging', 
        '--v=4'
    ],
    base_path: '../backend/home/templates/home',
    components: [{
        viewport: {width: 600, height: 900, scale: 1},
        url: 'http://localhost:18000/bolig/aarhus-c/8000/thorvaldsensgade/1/1/th/sundhed',
        selector: '.home__menu-wrap--mobile',
        file_path: './home_menu_mobile.html'
    },{
        viewport: {width: 1600, height: 900, scale: 1},
        url: 'http://localhost:18000/bolig/aarhus-c/8000/thorvaldsensgade/1/1/th/sundhed',
        selector: '.home__menu-wrap',
        file_path: './home_menu.html'
    }]   
}

Note that you can set the viewport so you can save pre-render content for different screensize (mobile and desktop for exmaple).

you can run with

element2file -c config.js
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago