Skip to content

evanx/render-html-rpf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

render-html-rpf

Basic HTML rendering library.

Named in honour of https://en.wikipedia.org/wiki/Richard_Feynman

Use case

We wish to generate a simple HTML page.

const h = require('render-html-rpf');

module.exports = (api, metrics) => {
   api.get('/metrics', async ctx => {       
       if (/(Mobile)/.test(ctx.get('user-agent'))) {
           h.page(ctx, {
               title: 'gcache',
               heading: 'Metrics',
               elements: [{
                   name: 'pre',
                   content: JSON.stringify(metrics, null, 2)}
               ],
               footerLink: 'https://github.com/evanx/geo-cache'
           });
       }
   });
  }

Used by

https://github.com/evanx/geo-cache


https://twitter.com/@evanxsummers

About

Basic HTML rendering library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published