root 3bf41bf355 update 2 years ago
..
opts 3bf41bf355 update 2 years ago
src 3bf41bf355 update 2 years ago
tag 3bf41bf355 update 2 years ago
tutorial 3bf41bf355 update 2 years ago
util 3bf41bf355 update 2 years ago
app.js 3bf41bf355 update 2 years ago
augment.js 3bf41bf355 update 2 years ago
borrow.js 3bf41bf355 update 2 years ago
config.js 3bf41bf355 update 2 years ago
doclet.js 3bf41bf355 update 2 years ago
env.js 3bf41bf355 update 2 years ago
fs.js 3bf41bf355 update 2 years ago
name.js 3bf41bf355 update 2 years ago
package.js 3bf41bf355 update 2 years ago
path.js 3bf41bf355 update 2 years ago
plugins.js 3bf41bf355 update 2 years ago
readme.js 3bf41bf355 update 2 years ago
schema.js 3bf41bf355 update 2 years ago
tag.js 3bf41bf355 update 2 years ago
template.js 3bf41bf355 update 2 years ago
tutorial.js 3bf41bf355 update 2 years ago

readme.js

/**
* Make the contents of a README file available to include in the output.
* @module jsdoc/readme
*/
const env = require('jsdoc/env');
const fs = require('jsdoc/fs');
const markdown = require('jsdoc/util/markdown');

/**
* Represents a README file.
*/
class ReadMe {
/**
* @param {string} path - The filepath to the README.
*/
constructor(path) {
const content = fs.readFileSync(path, env.opts.encoding);
const parse = markdown.getParser();

this.html = parse(content);
}
}

module.exports = ReadMe;