UNPKG

typhonjs-escomplex-commons

Version:
53 lines (47 loc) 1.23 kB
import FormatTextAdjacency from '../text/FormatTextAdjacency'; /** * Provides a format transform for ModuleReport / ProjectReport instances converting a matrix list into markdown. */ export default class FormatMarkdownAdjacency extends FormatTextAdjacency { /** * Initializes markdown adjacency format. * * @param {object} headers - * @param {object} keys - */ constructor(headers = {}, keys = {}) { super(Object.assign({}, s_DEFAULT_HEADERS, headers), keys); } /** * Gets the file extension. * * @returns {string} */ get extension() { return 'md'; } /** * Gets the format name. * * @returns {string} */ get name() { return 'markdown-adjacency'; } } // Module private --------------------------------------------------------------------------------------------------- /** * Defines the default headers added to any output strings.. * @type {{entryPrepend: string, entryWrapper: string, textHeader: string}} * @ignore */ const s_DEFAULT_HEADERS = { entryPrepend: '* ', entryWrapper: '`', textHeader: '* Adjacency (dependencies / numerical indices correspond to ProjectReport modules / reports):\n' };