This commit includes the following changes: * CLI version information is read from the CLI package from which we read the help files. * CLI API pages now contain GH links * line numbers are not shown in GH links, if the doc does not have a truthy `startingLine` value. This allows us to remove hard coded checks for `guide` pages * content pages and CLI api docs no longer have a `startingLine` * the hard-coded `packages` path segment has been removed from the templates; instead we now only use the `realProjectRelativePath`. * the `realProjectRelativePath` has been updated accordingly for API and CLI API docs. PR Close #26515
25 lines
567 B
JavaScript
25 lines
567 B
JavaScript
/**
|
|
* @dgService
|
|
* @description
|
|
* This file reader will pull the contents from a text file (by default .md)
|
|
*
|
|
* The doc will initially have the form:
|
|
* ```
|
|
* {
|
|
* content: 'the content of the file',
|
|
* startingLine: 1
|
|
* }
|
|
* ```
|
|
*/
|
|
module.exports = function contentFileReader() {
|
|
return {
|
|
name: 'contentFileReader',
|
|
defaultPattern: /\.md$/,
|
|
getDocs: function(fileInfo) {
|
|
|
|
// We return a single element array because content files only contain one document
|
|
return [{docType: 'content', content: fileInfo.content}];
|
|
}
|
|
};
|
|
};
|