markdown-magic 3.7.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +1 -1
- package/package.json +22 -26
- package/src/{cli.js → cli-run.js} +0 -0
- package/src/{cli.test.js → cli-run.test.js} +1 -1
- package/src/defaults.js +2 -2
- package/src/index.js +26 -20
- package/src/index.test.js +2 -2
- package/src/process-contents.js +2 -458
- package/src/transforms/code/index.js +6 -6
- package/src/transforms/fileTree.js +3 -3
- package/src/transforms/index.js +21 -21
- package/src/transforms/install.js +3 -3
- package/src/transforms/sectionToc.js +4 -4
- package/src/transforms/toc.js +5 -5
- package/src/transforms/wordCount.js +3 -2
- package/src/utils/fs.js +22 -0
- package/src/utils/fs.test.js +2 -2
- package/src/utils/index.js +21 -0
- package/src/utils/regex-timeout.js +1 -1
- package/src/utils/text.js +103 -11
- package/types/_tests/config.d.ts +4 -0
- package/types/_tests/config.d.ts.map +1 -0
- package/types/_tests/errors.test.d.ts +2 -0
- package/types/_tests/errors.test.d.ts.map +1 -0
- package/types/_tests/fixtures/js/simple.d.ts +8 -0
- package/types/_tests/fixtures/js/simple.d.ts.map +1 -0
- package/types/_tests/fixtures/local-code-file-lines.d.ts +1 -0
- package/types/_tests/fixtures/local-code-file-lines.d.ts.map +1 -0
- package/types/_tests/fixtures/local-code-file.d.ts +2 -0
- package/types/_tests/fixtures/local-code-file.d.ts.map +1 -0
- package/types/_tests/fixtures/local-code-id.d.ts +3 -0
- package/types/_tests/fixtures/local-code-id.d.ts.map +1 -0
- package/types/_tests/transforms-toc.test.d.ts +2 -0
- package/types/_tests/transforms-toc.test.d.ts.map +1 -0
- package/types/_tests/transforms.test.d.ts +2 -0
- package/types/_tests/transforms.test.d.ts.map +1 -0
- package/types/_tests/utils/diff.d.ts +3 -0
- package/types/_tests/utils/diff.d.ts.map +1 -0
- package/types/cli.d.ts +3 -0
- package/types/cli.d.ts.map +1 -0
- package/types/src/argparse/argparse.d.ts +33 -0
- package/types/src/argparse/argparse.d.ts.map +1 -0
- package/types/src/argparse/argparse.test.d.ts +2 -0
- package/types/src/argparse/argparse.test.d.ts.map +1 -0
- package/types/src/argparse/index.d.ts +3 -0
- package/types/src/argparse/index.d.ts.map +1 -0
- package/types/src/argparse/splitOutsideQuotes.d.ts +2 -0
- package/types/src/argparse/splitOutsideQuotes.d.ts.map +1 -0
- package/types/src/argparse/splitOutsideQuotes.test.d.ts +2 -0
- package/types/src/argparse/splitOutsideQuotes.test.d.ts.map +1 -0
- package/types/src/cli-run.d.ts +4 -0
- package/types/src/cli-run.d.ts.map +1 -0
- package/types/src/cli-run.test.d.ts +2 -0
- package/types/src/cli-run.test.d.ts.map +1 -0
- package/types/src/defaults.d.ts +5 -0
- package/types/src/defaults.d.ts.map +1 -0
- package/types/src/globparse.d.ts +18 -0
- package/types/src/globparse.d.ts.map +1 -0
- package/types/src/globparse.test.d.ts +2 -0
- package/types/src/globparse.test.d.ts.map +1 -0
- package/types/src/index.d.ts +189 -0
- package/types/src/index.d.ts.map +1 -0
- package/types/src/index.test.d.ts +2 -0
- package/types/src/index.test.d.ts.map +1 -0
- package/types/src/process-contents.d.ts +3 -0
- package/types/src/process-contents.d.ts.map +1 -0
- package/types/src/transforms/code/index.d.ts +35 -0
- package/types/src/transforms/code/index.d.ts.map +1 -0
- package/types/src/transforms/code/resolve-github-file.d.ts +24 -0
- package/types/src/transforms/code/resolve-github-file.d.ts.map +1 -0
- package/types/src/transforms/code/resolve-github-file.test.d.ts +2 -0
- package/types/src/transforms/code/resolve-github-file.test.d.ts.map +1 -0
- package/types/src/transforms/file.d.ts +3 -0
- package/types/src/transforms/file.d.ts.map +1 -0
- package/types/src/transforms/fileTree.d.ts +35 -0
- package/types/src/transforms/fileTree.d.ts.map +1 -0
- package/types/src/transforms/index.d.ts +9 -0
- package/types/src/transforms/index.d.ts.map +1 -0
- package/types/src/transforms/install.d.ts +25 -0
- package/types/src/transforms/install.d.ts.map +1 -0
- package/types/src/transforms/remote.d.ts +3 -0
- package/types/src/transforms/remote.d.ts.map +1 -0
- package/types/src/transforms/sectionToc.d.ts +3 -0
- package/types/src/transforms/sectionToc.d.ts.map +1 -0
- package/types/src/transforms/toc.d.ts +31 -0
- package/types/src/transforms/toc.d.ts.map +1 -0
- package/types/src/transforms/wordCount.d.ts +3 -0
- package/types/src/transforms/wordCount.d.ts.map +1 -0
- package/types/src/types.d.ts +11 -0
- package/types/src/types.d.ts.map +1 -0
- package/types/src/utils/details.d.ts +3 -0
- package/types/src/utils/details.d.ts.map +1 -0
- package/types/src/utils/format-md.d.ts +2 -0
- package/types/src/utils/format-md.d.ts.map +1 -0
- package/types/src/utils/fs.d.ts +29 -0
- package/types/src/utils/fs.d.ts.map +1 -0
- package/types/src/utils/fs.test.d.ts +2 -0
- package/types/src/utils/fs.test.d.ts.map +1 -0
- package/types/src/utils/hash-file.d.ts +2 -0
- package/types/src/utils/hash-file.d.ts.map +1 -0
- package/types/src/utils/index.d.ts +25 -0
- package/types/src/utils/index.d.ts.map +1 -0
- package/types/src/utils/load-config.d.ts +2 -0
- package/types/src/utils/load-config.d.ts.map +1 -0
- package/types/src/utils/logs.d.ts +11 -0
- package/types/src/utils/logs.d.ts.map +1 -0
- package/types/src/utils/regex-timeout.d.ts +2 -0
- package/types/src/utils/regex-timeout.d.ts.map +1 -0
- package/types/src/utils/regex.d.ts +7 -0
- package/types/src/utils/regex.d.ts.map +1 -0
- package/types/src/utils/remoteRequest.d.ts +3 -0
- package/types/src/utils/remoteRequest.d.ts.map +1 -0
- package/types/src/utils/sortOrder.d.ts +3 -0
- package/types/src/utils/sortOrder.d.ts.map +1 -0
- package/types/src/utils/string-break.d.ts +3 -0
- package/types/src/utils/string-break.d.ts.map +1 -0
- package/types/src/utils/syntax.d.ts +77 -0
- package/types/src/utils/syntax.d.ts.map +1 -0
- package/types/src/utils/text.d.ts +146 -0
- package/types/src/utils/text.d.ts.map +1 -0
- package/types/src/utils/text.test.d.ts +2 -0
- package/types/src/utils/text.test.d.ts.map +1 -0
- package/types/src/utils/toc.d.ts +67 -0
- package/types/src/utils/toc.d.ts.map +1 -0
- package/types/src/utils/toposort.d.ts +7 -0
- package/types/src/utils/toposort.d.ts.map +1 -0
- package/README.md +0 -700
- package/src/block-parser-js.test.js +0 -171
- package/src/block-parser.js +0 -405
- package/src/block-parser.test.js +0 -481
- package/src/process-file.js +0 -66
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Allowed file syntaxes
|
|
3
|
+
*/
|
|
4
|
+
export type SyntaxType = "md" | "js" | "yml" | "yaml";
|
|
5
|
+
/**
|
|
6
|
+
* Path to file, files or Glob string or Glob Array
|
|
7
|
+
*/
|
|
8
|
+
export type FilePathsOrGlobs = string | Array<string>;
|
|
9
|
+
export type ProcessFileOptions = import("comment-block-replacer").ProcessFileOptions;
|
|
10
|
+
/**
|
|
11
|
+
* Configuration for markdown magic
|
|
12
|
+
*
|
|
13
|
+
* Below is the main config for `markdown-magic`
|
|
14
|
+
*/
|
|
15
|
+
export type MarkdownMagicOptions = {
|
|
16
|
+
/**
|
|
17
|
+
* - Files to process.
|
|
18
|
+
*/
|
|
19
|
+
files?: FilePathsOrGlobs;
|
|
20
|
+
/**
|
|
21
|
+
* - Custom commands to transform block contents, see transforms & custom transforms sections below.
|
|
22
|
+
*/
|
|
23
|
+
transforms?: any;
|
|
24
|
+
/**
|
|
25
|
+
* - Output configuration
|
|
26
|
+
*/
|
|
27
|
+
output?: OutputConfig;
|
|
28
|
+
/**
|
|
29
|
+
* - Syntax to parse
|
|
30
|
+
*/
|
|
31
|
+
syntax?: SyntaxType;
|
|
32
|
+
/**
|
|
33
|
+
* - Opening match word
|
|
34
|
+
*/
|
|
35
|
+
open?: string;
|
|
36
|
+
/**
|
|
37
|
+
* - Closing match word. If not defined will be same as opening word.
|
|
38
|
+
*/
|
|
39
|
+
close?: string;
|
|
40
|
+
/**
|
|
41
|
+
* - Current working directory. Default process.cwd()
|
|
42
|
+
*/
|
|
43
|
+
cwd?: string;
|
|
44
|
+
/**
|
|
45
|
+
* - Flatten files that are output
|
|
46
|
+
*/
|
|
47
|
+
outputFlatten?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* - Use git glob for LARGE file directories
|
|
50
|
+
*/
|
|
51
|
+
useGitGlob?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* - See planned execution of matched blocks
|
|
54
|
+
*/
|
|
55
|
+
dryRun?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* - See debug details
|
|
58
|
+
*/
|
|
59
|
+
debug?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* - Silence all console output
|
|
62
|
+
*/
|
|
63
|
+
silent?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* - Apply transforms to source file. Default is true.
|
|
66
|
+
*/
|
|
67
|
+
applyTransformsToSource?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* - Fail if transform functions are missing. Default skip blocks.
|
|
70
|
+
*/
|
|
71
|
+
failOnMissingTransforms?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* - Fail if remote file is missing.
|
|
74
|
+
*/
|
|
75
|
+
failOnMissingRemote?: boolean;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Optional output configuration
|
|
79
|
+
*/
|
|
80
|
+
export type OutputConfig = {
|
|
81
|
+
/**
|
|
82
|
+
* - Change output path of new content. Default behavior is replacing the original file
|
|
83
|
+
*/
|
|
84
|
+
directory?: string;
|
|
85
|
+
/**
|
|
86
|
+
* - Remove comments from output. Default is false.
|
|
87
|
+
*/
|
|
88
|
+
removeComments?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* - Custom function for altering output paths
|
|
91
|
+
*/
|
|
92
|
+
pathFormatter?: Function;
|
|
93
|
+
/**
|
|
94
|
+
* - Apply transforms to source file. Default is true. This is for when outputDir is set.
|
|
95
|
+
*/
|
|
96
|
+
applyTransformsToSource?: boolean;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Result of markdown processing
|
|
100
|
+
*/
|
|
101
|
+
export type MarkdownMagicResult = {
|
|
102
|
+
/**
|
|
103
|
+
* - Any errors encountered.
|
|
104
|
+
*/
|
|
105
|
+
errors: any[];
|
|
106
|
+
/**
|
|
107
|
+
* - Modified files
|
|
108
|
+
*/
|
|
109
|
+
filesChanged: Array<string>;
|
|
110
|
+
/**
|
|
111
|
+
* - md data
|
|
112
|
+
*/
|
|
113
|
+
results: any[];
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Allowed file syntaxes
|
|
117
|
+
* @typedef {'md' | 'js' | 'yml' | 'yaml'} SyntaxType
|
|
118
|
+
*/
|
|
119
|
+
/**
|
|
120
|
+
* Path to file, files or Glob string or Glob Array
|
|
121
|
+
* @typedef {string|Array<string>} FilePathsOrGlobs
|
|
122
|
+
*/
|
|
123
|
+
/**
|
|
124
|
+
* @typedef {import('comment-block-replacer').ProcessFileOptions} ProcessFileOptions
|
|
125
|
+
*/
|
|
126
|
+
/**
|
|
127
|
+
* Configuration for markdown magic
|
|
128
|
+
*
|
|
129
|
+
* Below is the main config for `markdown-magic`
|
|
130
|
+
*
|
|
131
|
+
* @typedef {object} MarkdownMagicOptions
|
|
132
|
+
* @property {FilePathsOrGlobs} [files] - Files to process.
|
|
133
|
+
* @property {Object} [transforms = defaultTransforms] - Custom commands to transform block contents, see transforms & custom transforms sections below.
|
|
134
|
+
* @property {OutputConfig} [output] - Output configuration
|
|
135
|
+
* @property {SyntaxType} [syntax = 'md'] - Syntax to parse
|
|
136
|
+
* @property {string} [open = 'doc-gen'] - Opening match word
|
|
137
|
+
* @property {string} [close = 'end-doc-gen'] - Closing match word. If not defined will be same as opening word.
|
|
138
|
+
* @property {string} [cwd = process.cwd() ] - Current working directory. Default process.cwd()
|
|
139
|
+
* @property {boolean} [outputFlatten] - Flatten files that are output
|
|
140
|
+
* @property {boolean} [useGitGlob] - Use git glob for LARGE file directories
|
|
141
|
+
* @property {boolean} [dryRun = false] - See planned execution of matched blocks
|
|
142
|
+
* @property {boolean} [debug = false] - See debug details
|
|
143
|
+
* @property {boolean} [silent = false] - Silence all console output
|
|
144
|
+
* @property {boolean} [applyTransformsToSource = true] - Apply transforms to source file. Default is true.
|
|
145
|
+
* @property {boolean} [failOnMissingTransforms = false] - Fail if transform functions are missing. Default skip blocks.
|
|
146
|
+
* @property {boolean} [failOnMissingRemote = true] - Fail if remote file is missing.
|
|
147
|
+
*/
|
|
148
|
+
/**
|
|
149
|
+
* Optional output configuration
|
|
150
|
+
* @typedef {object} OutputConfig
|
|
151
|
+
* @property {string} [directory] - Change output path of new content. Default behavior is replacing the original file
|
|
152
|
+
* @property {boolean} [removeComments = false] - Remove comments from output. Default is false.
|
|
153
|
+
* @property {function} [pathFormatter] - Custom function for altering output paths
|
|
154
|
+
* @property {boolean} [applyTransformsToSource = false] - Apply transforms to source file. Default is true. This is for when outputDir is set.
|
|
155
|
+
*/
|
|
156
|
+
/**
|
|
157
|
+
* Result of markdown processing
|
|
158
|
+
*
|
|
159
|
+
* @typedef {object} MarkdownMagicResult
|
|
160
|
+
* @property {Array} errors - Any errors encountered.
|
|
161
|
+
* @property {Array<string>} filesChanged - Modified files
|
|
162
|
+
* @property {Array} results - md data
|
|
163
|
+
*/
|
|
164
|
+
/**
|
|
165
|
+
* ### API
|
|
166
|
+
*
|
|
167
|
+
* Markdown Magic Instance
|
|
168
|
+
*
|
|
169
|
+
* ```js
|
|
170
|
+
* markdownMagic(globOrOpts, options)
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* @param {FilePathsOrGlobs|MarkdownMagicOptions} globOrOpts - Files to process or config.
|
|
174
|
+
* @param {MarkdownMagicOptions} [options] - Markdown magic config
|
|
175
|
+
* @returns {Promise<MarkdownMagicResult>}
|
|
176
|
+
* @example
|
|
177
|
+
markdownMagic(['**.**.md'], options).then((result) => {
|
|
178
|
+
console.log(`Processing complete`, result)
|
|
179
|
+
})
|
|
180
|
+
*/
|
|
181
|
+
export function markdownMagic(globOrOpts?: FilePathsOrGlobs | MarkdownMagicOptions, options?: MarkdownMagicOptions): Promise<MarkdownMagicResult>;
|
|
182
|
+
import { blockTransformer } from "comment-block-transformer";
|
|
183
|
+
import { processFile } from "comment-block-replacer";
|
|
184
|
+
export namespace stringUtils {
|
|
185
|
+
export { stringBreak };
|
|
186
|
+
}
|
|
187
|
+
import stringBreak = require("./utils/string-break");
|
|
188
|
+
export { parseMarkdown, blockTransformer, processFile };
|
|
189
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":";;;yBAkDa,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM;;;;+BAK5B,MAAM,GAAC,KAAK,CAAC,MAAM,CAAC;iCAIpB,OAAO,wBAAwB,EAAE,kBAAkB;;;;;;;;;;YASlD,gBAAgB;;;;;;;;aAEhB,YAAY;;;;aACZ,UAAU;;;;WACV,MAAM;;;;YACN,MAAM;;;;UACN,MAAM;;;;oBACN,OAAO;;;;iBACP,OAAO;;;;aACP,OAAO;;;;YACP,OAAO;;;;aACP,OAAO;;;;8BACP,OAAO;;;;8BACP,OAAO;;;;0BACP,OAAO;;;;;;;;;gBAMP,MAAM;;;;qBACN,OAAO;;;;;;;;8BAEP,OAAO;;;;;;;;;;;;;kBAQP,KAAK,CAAC,MAAM,CAAC;;;;;;AAnD3B;;;GAGG;AAEH;;;GAGG;AAEH;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;GAOG;AAEH;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,2CARW,gBAAgB,GAAC,oBAAoB,YACrC,oBAAoB,GAClB,OAAO,CAAC,mBAAmB,CAAC,CA2lBxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/index.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-contents.d.ts","sourceRoot":"","sources":["../../src/process-contents.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare namespace _exports {
|
|
2
|
+
export { CodeTransformOptions };
|
|
3
|
+
}
|
|
4
|
+
declare function _exports(api: any): Promise<any>;
|
|
5
|
+
export = _exports;
|
|
6
|
+
/**
|
|
7
|
+
* Options for specifying source code to include in documentation.
|
|
8
|
+
*/
|
|
9
|
+
type CodeTransformOptions = {
|
|
10
|
+
/**
|
|
11
|
+
* - The relative path to the code to include, or the URL where the raw code lives.
|
|
12
|
+
*/
|
|
13
|
+
src: string;
|
|
14
|
+
/**
|
|
15
|
+
* - The syntax of the code. If not specified, it will be inferred by fileType.
|
|
16
|
+
*/
|
|
17
|
+
syntax?: string;
|
|
18
|
+
/**
|
|
19
|
+
* - The header comment to add to the code snippet. Useful for pointing to relative source directory or adding live doc links.
|
|
20
|
+
*/
|
|
21
|
+
header?: string;
|
|
22
|
+
/**
|
|
23
|
+
* - A range of lines of code to include from the file. The line range should be defined like "lines=22-44".
|
|
24
|
+
*/
|
|
25
|
+
lines?: string;
|
|
26
|
+
/**
|
|
27
|
+
* - A section of code to include from the file. Defined like "section=SECTION_NAME". The code should have "// SECTION_NAME" surrounding the block of text.
|
|
28
|
+
*/
|
|
29
|
+
section?: string;
|
|
30
|
+
/**
|
|
31
|
+
* - Remove multi-line comments that start with `//` from the code.
|
|
32
|
+
*/
|
|
33
|
+
trimDeadCode?: boolean;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/transforms/code/index.js"],"names":[],"mappings":";;;AA+CiB,kDA8JhB;;;;;;;;;SAxLa,MAAM;;;;aACN,MAAM;;;;aACN,MAAM;;;;YACN,MAAM;;;;cACN,MAAM;;;;mBACN,OAAO"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function isGithubLink(str?: string): boolean;
|
|
2
|
+
export function isGithubRawLink(str?: string): boolean;
|
|
3
|
+
export function getGitHubFileContentsRaw(options: any): Promise<any>;
|
|
4
|
+
export function resolveGithubDetails(repoFilePath: any): {
|
|
5
|
+
repoOwner: any;
|
|
6
|
+
repoName: any;
|
|
7
|
+
filePath: any;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Resolves the contents of a file from a GitHub repository.
|
|
11
|
+
*
|
|
12
|
+
* @param {Object} options - The options for resolving the GitHub contents.
|
|
13
|
+
* @param {string} options.repoFilePath - The file path in the GitHub repository.
|
|
14
|
+
* @param {string} [options.accessToken] - The access token for authenticating with GitHub (optional).
|
|
15
|
+
* @param {boolean} [options.debug = false] - Whether to enable debug logging (optional).
|
|
16
|
+
* @returns {Promise<string>} - A promise that resolves to the contents of the file.
|
|
17
|
+
* @throws {Error} - If the GitHub link is invalid or if the file fetch fails.
|
|
18
|
+
*/
|
|
19
|
+
export function resolveGithubContents({ repoFilePath, accessToken, debug }: {
|
|
20
|
+
repoFilePath: string;
|
|
21
|
+
accessToken?: string;
|
|
22
|
+
debug?: boolean;
|
|
23
|
+
}): Promise<string>;
|
|
24
|
+
//# sourceMappingURL=resolve-github-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-github-file.d.ts","sourceRoot":"","sources":["../../../../src/transforms/code/resolve-github-file.js"],"names":[],"mappings":"AASA,oDAEC;AAMD,uDAEC;AAoOD,qEA8CC;AA3QD;;;;EA8BC;AAED;;;;;;;;;GASG;AACH,4EANG;IAAyB,YAAY,EAA7B,MAAM;IACY,WAAW,GAA7B,MAAM;IACY,KAAK,GAAvB,OAAO;CACf,GAAU,OAAO,CAAC,MAAM,CAAC,CAwD3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-github-file.test.d.ts","sourceRoot":"","sources":["../../../../src/transforms/code/resolve-github-file.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/transforms/file.js"],"names":[],"mappings":"AAKiB,yCA+ChB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare namespace _exports {
|
|
2
|
+
export { FileTreeTransformOptions };
|
|
3
|
+
}
|
|
4
|
+
declare function _exports(api: any): string;
|
|
5
|
+
export = _exports;
|
|
6
|
+
/**
|
|
7
|
+
* Options for configuring the file tree table of contents.
|
|
8
|
+
*/
|
|
9
|
+
type FileTreeTransformOptions = {
|
|
10
|
+
/**
|
|
11
|
+
* - The directory path to generate the file tree for. Default is `.` (current directory).
|
|
12
|
+
*/
|
|
13
|
+
src?: string;
|
|
14
|
+
/**
|
|
15
|
+
* - Maximum depth to traverse in the directory tree. Default is `3`.
|
|
16
|
+
*/
|
|
17
|
+
maxDepth?: number;
|
|
18
|
+
/**
|
|
19
|
+
* - Whether to include files in the tree or just directories. Default is `true`.
|
|
20
|
+
*/
|
|
21
|
+
includeFiles?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* - Array of glob patterns to exclude from the tree.
|
|
24
|
+
*/
|
|
25
|
+
exclude?: string[];
|
|
26
|
+
/**
|
|
27
|
+
* - Whether to show file sizes. Default is `false`.
|
|
28
|
+
*/
|
|
29
|
+
showSize?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* - Output format: "tree" or "list". Default is `"tree"`.
|
|
32
|
+
*/
|
|
33
|
+
format?: string;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=fileTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileTree.d.ts","sourceRoot":"","sources":["../../../src/transforms/fileTree.js"],"names":[],"mappings":";;;AAyBiB,qCAFJ,MAAM,CAoClB;;;;;;;;;UArDa,MAAM;;;;eACN,MAAM;;;;mBACN,OAAO;;;;cACP,MAAM,EAAE;;;;eACR,OAAO;;;;aACP,MAAM"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import toc = require("./toc");
|
|
2
|
+
import sectionToc = require("./sectionToc");
|
|
3
|
+
import code = require("./code");
|
|
4
|
+
import file = require("./file");
|
|
5
|
+
import remoteContent = require("./remote");
|
|
6
|
+
import fileTree = require("./fileTree");
|
|
7
|
+
import install = require("./install");
|
|
8
|
+
export { toc as TOC, sectionToc, code as CODE, file as FILE, remoteContent as REMOTE, fileTree, install };
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transforms/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export = install;
|
|
2
|
+
/**
|
|
3
|
+
* ### > INSTALL
|
|
4
|
+
*
|
|
5
|
+
* Generate installation instructions in a markdown table format
|
|
6
|
+
*
|
|
7
|
+
* **Options:**
|
|
8
|
+
* - `packageName` (optional): The name of the package to install. If not provided, will try to read from package.json
|
|
9
|
+
*
|
|
10
|
+
* **Example:**
|
|
11
|
+
* ```md
|
|
12
|
+
* <!-- doc-gen INSTALL packageName=my-package -->
|
|
13
|
+
* Installation instructions will be generated here
|
|
14
|
+
* <!-- end-doc-gen -->
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* Default `matchWord` is `doc-gen`
|
|
18
|
+
*
|
|
19
|
+
* ---
|
|
20
|
+
* @param {string} content The current content of the comment block
|
|
21
|
+
* @param {object} options The options passed in from the comment declaration
|
|
22
|
+
* @return {string} Updated content to place in the content block
|
|
23
|
+
*/
|
|
24
|
+
declare function install(api: any): string;
|
|
25
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/transforms/install.js"],"names":[],"mappings":";AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,oCAFY,MAAM,CAqDjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../../src/transforms/remote.js"],"names":[],"mappings":"AAIiB,kDAyBhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sectionToc.d.ts","sourceRoot":"","sources":["../../../src/transforms/sectionToc.js"],"names":[],"mappings":"AAMiB,kDA8BhB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare namespace _exports {
|
|
2
|
+
export { ToCTransformOptions };
|
|
3
|
+
}
|
|
4
|
+
declare function _exports(api: any): Promise<any>;
|
|
5
|
+
export = _exports;
|
|
6
|
+
/**
|
|
7
|
+
* Options for configuring the table of contents.
|
|
8
|
+
*/
|
|
9
|
+
type ToCTransformOptions = {
|
|
10
|
+
/**
|
|
11
|
+
* - Show the first h1 of the document in the table of contents. Default is `false`.
|
|
12
|
+
*/
|
|
13
|
+
firsth1?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* - Collapse the table of contents in a detail accordion. Default is `false`.
|
|
16
|
+
*/
|
|
17
|
+
collapse?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* - Text for the summary of the table of contents accordion.
|
|
20
|
+
*/
|
|
21
|
+
collapseText?: string;
|
|
22
|
+
/**
|
|
23
|
+
* - Text to exclude in the table of contents. Default is `Table of Contents`.
|
|
24
|
+
*/
|
|
25
|
+
excludeText?: string;
|
|
26
|
+
/**
|
|
27
|
+
* - Maximum depth of headings to include in the table of contents. Default is `4`.
|
|
28
|
+
*/
|
|
29
|
+
maxDepth?: number;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=toc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toc.d.ts","sourceRoot":"","sources":["../../../src/transforms/toc.js"],"names":[],"mappings":";;;AAmBiB,kDAuFhB;;;;;;;;;cApGa,OAAO;;;;eACP,OAAO;;;;mBACP,MAAM;;;;kBACN,MAAM;;;;eACN,MAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wordCount.d.ts","sourceRoot":"","sources":["../../../src/transforms/wordCount.js"],"names":[],"mappings":"AAEiB,4CAGhB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Allowed file syntaxes
|
|
3
|
+
*/
|
|
4
|
+
export type SyntaxType = "md" | "js" | "yml" | "yaml" | "toml" | "sql";
|
|
5
|
+
/**
|
|
6
|
+
* Allowed file syntaxes
|
|
7
|
+
* @typedef {'md' | 'js' | 'yml' | 'yaml' | 'toml' | 'sql'} SyntaxType
|
|
8
|
+
*/
|
|
9
|
+
/** @type {SyntaxType} */
|
|
10
|
+
export const syntaxType: SyntaxType;
|
|
11
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.js"],"names":[],"mappings":";;;yBAEa,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK;AAF1D;;;GAGG;AAEH,yBAAyB;AACzB,yBADW,UAAU,CACE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"details.d.ts","sourceRoot":"","sources":["../../../src/utils/details.js"],"names":[],"mappings":";AAAA,wDAYC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-md.d.ts","sourceRoot":"","sources":["../../../src/utils/format-md.js"],"names":[],"mappings":"AAGA,0DAyBC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if path is local (not remote)
|
|
3
|
+
* @param {string} filePath - File path to check
|
|
4
|
+
* @returns {boolean} True if path is local
|
|
5
|
+
*/
|
|
6
|
+
export function isLocalPath(filePath: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Write file with directory creation if needed
|
|
9
|
+
* @param {string} filePath - File path to write to
|
|
10
|
+
* @param {string} content - Content to write
|
|
11
|
+
* @returns {Promise<void>}
|
|
12
|
+
*/
|
|
13
|
+
export function writeFile(filePath: string, content: string): Promise<void>;
|
|
14
|
+
export const readFile: typeof fs.readFile;
|
|
15
|
+
export function findUp(start: any, fileName: any): Promise<string>;
|
|
16
|
+
export function resolveOutputPath(cwd: any, outputDir: any, file: any): string;
|
|
17
|
+
export function resolveFlatPath(cwd: any, outputDir: any, file: any): string;
|
|
18
|
+
export function resolveCommonParent(mainDir?: string, fileDir?: string): string;
|
|
19
|
+
export function getGitignoreContents(filePath?: string): Promise<string[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Convert absolute path to relative path
|
|
22
|
+
* @param {string} file - Absolute file path
|
|
23
|
+
* @param {string} cwd - Current working directory
|
|
24
|
+
* @returns {string} Relative path
|
|
25
|
+
*/
|
|
26
|
+
export function convertToRelativePath(file: string, cwd: string): string;
|
|
27
|
+
import fs_1 = require("fs");
|
|
28
|
+
import fs = fs_1.promises;
|
|
29
|
+
//# sourceMappingURL=fs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../src/utils/fs.js"],"names":[],"mappings":"AAwLA;;;;GAIG;AACH,sCAHW,MAAM,GACJ,OAAO,CAKnB;AA5KD;;;;;GAKG;AACH,oCAJW,MAAM,WACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAUzB;;AAED,mEAeC;AAsGD,+EAeC;AAED,6EAQC;AAvCD,gFAYC;AA3DD,2EAUC;AApBD;;;;;GAKG;AACH,4CAJW,MAAM,OACN,MAAM,GACJ,MAAM,CAIlB;;iBA1FwB,QAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.test.d.ts","sourceRoot":"","sources":["../../../src/utils/fs.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash-file.d.ts","sourceRoot":"","sources":["../../../src/utils/hash-file.js"],"names":[],"mappings":"AAGA,0EAoBC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pluralize word based on count
|
|
3
|
+
* @param {any[]|number} thing - Array or number to count
|
|
4
|
+
* @param {string} [single=''] - Singular form
|
|
5
|
+
* @param {string} [plural=''] - Plural form
|
|
6
|
+
* @returns {string} Singular or plural form
|
|
7
|
+
*/
|
|
8
|
+
export function pluralize(thing: any[] | number, single?: string, plural?: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Filter function to get only unique values
|
|
11
|
+
* @param {any} value - Current value
|
|
12
|
+
* @param {number} index - Current index
|
|
13
|
+
* @param {any[]} self - Original array
|
|
14
|
+
* @returns {boolean} True if value is unique
|
|
15
|
+
*/
|
|
16
|
+
export function onlyUnique(value: any, index: number, self: any[]): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Get code location string in format path:line:column
|
|
19
|
+
* @param {string} srcPath - Source file path
|
|
20
|
+
* @param {string|number} line - Line number
|
|
21
|
+
* @param {string} [column='0'] - Column number
|
|
22
|
+
* @returns {string} Location string
|
|
23
|
+
*/
|
|
24
|
+
export function getCodeLocation(srcPath: string, line: string | number, column?: string): string;
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.js"],"names":[],"mappings":"AAuBA;;;;;;GAMG;AACH,iCALW,GAAG,EAAE,GAAC,MAAM,WACZ,MAAM,WACN,MAAM,GACJ,MAAM,CAKlB;AAhCD;;;;;;GAMG;AACH,kCALW,GAAG,SACH,MAAM,QACN,GAAG,EAAE,GACH,OAAO,CAInB;AAED;;;;;;GAMG;AACH,yCALW,MAAM,QACN,MAAM,GAAC,MAAM,WACb,MAAM,GACJ,MAAM,CAIlB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../../src/utils/load-config.js"],"names":[],"mappings":"AA6CA,iDAGC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function convertHrtime(hrtime: any): {
|
|
2
|
+
seconds: number;
|
|
3
|
+
milliseconds: number;
|
|
4
|
+
nanoseconds: any;
|
|
5
|
+
};
|
|
6
|
+
export function deepLog(myObject: any, myObjectTwo: any): void;
|
|
7
|
+
export const success: any;
|
|
8
|
+
export const info: any;
|
|
9
|
+
export const warning: any;
|
|
10
|
+
export const error: any;
|
|
11
|
+
//# sourceMappingURL=logs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../../src/utils/logs.js"],"names":[],"mappings":"AAIA;;;;EAWC;AA6DD,+DAOC;AAED,0BAAyC;AACzC,uBAAmC;AACnC,0BAAyC;AACzC,wBAAqC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex-timeout.d.ts","sourceRoot":"","sources":["../../../src/utils/regex-timeout.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const REGEX_REGEX: RegExp;
|
|
2
|
+
export function escapeRegexString(string: any): string;
|
|
3
|
+
export function matchCommentBlock(word: any): RegExp;
|
|
4
|
+
export function matchOpeningCommentTag(word: any): RegExp;
|
|
5
|
+
export function matchClosingCommentTag(word: any): RegExp;
|
|
6
|
+
export const removeLeadingAndTrailingLineBreaks: RegExp;
|
|
7
|
+
//# sourceMappingURL=regex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../../src/utils/regex.js"],"names":[],"mappings":"AAGA,iCAAsD;AAGtD,uDASC;AAED,qDAGC;AAED,0DAGC;AAED,0DAEC;AAED,wDAA2E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remoteRequest.d.ts","sourceRoot":"","sources":["../../../src/utils/remoteRequest.js"],"names":[],"mappings":"AAOA,6EAgBC;AAED,kFAmBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortOrder.d.ts","sourceRoot":"","sources":["../../../src/utils/sortOrder.js"],"names":[],"mappings":"AACiB,kFAuBhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-break.d.ts","sourceRoot":"","sources":["../../../src/utils/string-break.js"],"names":[],"mappings":";AAoHA,0DAqBC"}
|