const path = require('path'); const proc = require('process'); console.log('cwd ' + proc.cwd()) // const c = require('@plastichub/osrl/library') const context = {}// require('@plastichub/osrl/library').getContext(); const link = (name, link, _class) => `${name}`; const wrap = (content) => `
${content}
`; const image = (src, link, style) => ``; const item = (content, style = 'border-color: #c5c5c5;width: 300px;display: inline-block', title) => `
${content}
${title||''}
`; const styles = { thumb: 'border:none; width:200px;max-height:200px' }; const center_caption = (el = 'h5', text) => `<${el} style="text-align:center">${text}`; const thumbs = (url, folder) => { folder = path.resolve(folder); images = []; /* let images = context.fs.images(folder, { absolute: false }); */ images = images.map((i) => item(image(`${url}/${i}`), 'border:none; width:200px;max-height:200px')); images = wrap(images.join('\n')); return images; } module.exports = { html: { link: link, caption: { center: center_caption }, container: { wrap: wrap, item: item }, image: image, styles: styles, thumbs: thumbs } };