1 | /*global env: true */
|
2 |
|
3 | /**
|
4 | * Make the contents of a README file available to include in the output.
|
5 | * @module jsdoc/readme
|
6 | * @author Michael Mathews <micmath@gmail.com>
|
7 | * @author Ben Blank <ben.blank@gmail.com>
|
8 | */
|
9 | ;
|
10 |
|
11 | var fs = require('jsdoc/fs'),
|
12 | markdown = require('jsdoc/util/markdown');
|
13 |
|
14 | /**
|
15 | * @class
|
16 | * @classdesc Represents a README file.
|
17 | * @param {string} path - The filepath to the README.
|
18 | */
|
19 | function ReadMe(path) {
|
20 | var content = fs.readFileSync(path, env.opts.encoding),
|
21 | parse = markdown.getParser();
|
22 |
|
23 | this.html = parse(content);
|
24 | }
|
25 |
|
26 | module.exports = ReadMe;
|