import * as marked from 'marked' import {isNamedSection, MarkMark} from './types' export class HtmlRenderer { public render(mm: MarkMark): string { let mmLines: string[] = [] for ( const section of mm.sections ) { mmLines.push('
') // if this section has a title/description, write those out if ( isNamedSection(section) ) { mmLines.push(`

${marked.marked.parse(section.title)}

`) if ( section.description ) { mmLines.push(`

${marked.marked.parse(section.description)}

`) } } mmLines.push('') mmLines.push('
') } return mmLines.join('\n') } }