/** * @packageDocumentation * @module main */ import markdown from 'markdown-it'; import { Metadata } from './dataset'; import { getElement } from './utils'; import * as styles from './styles'; import Modal from './modal'; import INFO_SVG from './static/info.svg'; function generateModal(metadata: Metadata): string { const md = markdown({ html: false, linkify: true, typographer: true, }); // Deal with missing metadata let description = 'No description for this dataset.'; if (metadata.description !== undefined) { description = metadata.description; } let authors = 'No authors for this dataset.'; if (metadata.authors !== undefined) { authors = '
'; } let ref = 'No references for this dataset.'; if (metadata.references !== undefined) { ref = '