import { applyTo } from '../transformers/markdown'

export const render = (options = {}, context = {}) => {
  if (typeof options === 'string') {
    options = {
      pattern: options
    }
  }
  
  const { project } = context
  const {
    pattern = '*.md'
  } = options

  const docs = options.document 
    ? typeof options.document === 'string' ? [project.document(options.document)] : [options.document]
    : project.query(pattern)

  return docs    
    .map(d => d.ready.get('exportables.html'))
}