sqlite-html icon indicating copy to clipboard operation
sqlite-html copied to clipboard

HTML element tools

Open asg017 opened this issue 4 years ago • 1 comments

  • [ ] html_element(tag, attributes, child1, child2, ....)
  • [ ] html_attributes(attr1, attr2, ...) (or html_attrs)
    • [ ] html_attribute(name, value, namespace) (or html_attr()
-- https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/HTML_basics
select 
html_element('html', null, 
  html_element('head', null, 
    html_element('meta', html_attributes('charset', 'utf-8')), 
    html_element('title', null, 'My test page'),
  ),
  html_element('body', null,
    html_element('img', html_attributes('src', 'images/firefox-icon.png', 'alt', 'My test image')),
  )
);

asg017 avatar Oct 20 '21 23:10 asg017

aggregate functions?

select html_element('table', null,
  -- thead stuff...
  html_element('tbody', null, 
    html_element_agg('tr', null, 
      html_element('td', null, name),
      html_element('td', null, value),
    )
  )
)
from measurements;

asg017 avatar Oct 20 '21 23:10 asg017