markdown-magic 4.0.0 → 4.0.2
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/package.json +20 -17
- package/src/index.js +3 -2
- 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
|
@@ -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"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export function getSyntaxInfo(syntax?: string): any;
|
|
2
|
+
export namespace syntaxMap {
|
|
3
|
+
export { html as md };
|
|
4
|
+
export { html as markdown };
|
|
5
|
+
export { html };
|
|
6
|
+
export { js };
|
|
7
|
+
export { js as json };
|
|
8
|
+
export { jsx };
|
|
9
|
+
export { jsx as mdx };
|
|
10
|
+
export { yaml as yml };
|
|
11
|
+
export { yaml };
|
|
12
|
+
export { sql };
|
|
13
|
+
export { toml };
|
|
14
|
+
}
|
|
15
|
+
declare namespace html {
|
|
16
|
+
let tags: string[];
|
|
17
|
+
let pattern: string[];
|
|
18
|
+
}
|
|
19
|
+
declare namespace js {
|
|
20
|
+
let tags_1: string[];
|
|
21
|
+
export { tags_1 as tags };
|
|
22
|
+
let pattern_1: string[];
|
|
23
|
+
export { pattern_1 as pattern };
|
|
24
|
+
export let singleLineTag: string;
|
|
25
|
+
export let singleLinePattern: string;
|
|
26
|
+
export let singleLine: string;
|
|
27
|
+
}
|
|
28
|
+
declare namespace jsx {
|
|
29
|
+
let tags_2: string[];
|
|
30
|
+
export { tags_2 as tags };
|
|
31
|
+
let pattern_2: string[];
|
|
32
|
+
export { pattern_2 as pattern };
|
|
33
|
+
}
|
|
34
|
+
declare namespace yaml {
|
|
35
|
+
let tags_3: string[];
|
|
36
|
+
export { tags_3 as tags };
|
|
37
|
+
let pattern_3: string[];
|
|
38
|
+
export { pattern_3 as pattern };
|
|
39
|
+
let singleLineTag_1: string;
|
|
40
|
+
export { singleLineTag_1 as singleLineTag };
|
|
41
|
+
let singleLinePattern_1: string;
|
|
42
|
+
export { singleLinePattern_1 as singleLinePattern };
|
|
43
|
+
let singleLine_1: string;
|
|
44
|
+
export { singleLine_1 as singleLine };
|
|
45
|
+
export let content: string;
|
|
46
|
+
export function converter(str?: string): string;
|
|
47
|
+
}
|
|
48
|
+
declare namespace sql {
|
|
49
|
+
let tags_4: string[];
|
|
50
|
+
export { tags_4 as tags };
|
|
51
|
+
let pattern_4: string[];
|
|
52
|
+
export { pattern_4 as pattern };
|
|
53
|
+
let singleLineTag_2: string;
|
|
54
|
+
export { singleLineTag_2 as singleLineTag };
|
|
55
|
+
let singleLinePattern_2: string;
|
|
56
|
+
export { singleLinePattern_2 as singleLinePattern };
|
|
57
|
+
let singleLine_2: string;
|
|
58
|
+
export { singleLine_2 as singleLine };
|
|
59
|
+
let content_1: string;
|
|
60
|
+
export { content_1 as content };
|
|
61
|
+
}
|
|
62
|
+
declare namespace toml {
|
|
63
|
+
let tags_5: string[];
|
|
64
|
+
export { tags_5 as tags };
|
|
65
|
+
let pattern_5: string[];
|
|
66
|
+
export { pattern_5 as pattern };
|
|
67
|
+
let singleLineTag_3: string;
|
|
68
|
+
export { singleLineTag_3 as singleLineTag };
|
|
69
|
+
let singleLinePattern_3: string;
|
|
70
|
+
export { singleLinePattern_3 as singleLinePattern };
|
|
71
|
+
let singleLine_3: string;
|
|
72
|
+
export { singleLine_3 as singleLine };
|
|
73
|
+
let content_2: string;
|
|
74
|
+
export { content_2 as content };
|
|
75
|
+
}
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=syntax.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syntax.d.ts","sourceRoot":"","sources":["../../../src/utils/syntax.js"],"names":[],"mappings":"AAuGA,oDAEC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAzDY,gDAIV"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert string to Title Case
|
|
3
|
+
* @param {string} str - Input string
|
|
4
|
+
* @returns {string} Title Case string
|
|
5
|
+
*/
|
|
6
|
+
export function toTitleCase(str?: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Split string into lines
|
|
9
|
+
* @param {string} str - Input string
|
|
10
|
+
* @returns {string[]} Array of lines
|
|
11
|
+
*/
|
|
12
|
+
export function getLines(str?: string): string[];
|
|
13
|
+
/**
|
|
14
|
+
* Get line count from string
|
|
15
|
+
* @param {string} str - Input string
|
|
16
|
+
* @returns {number} Number of lines
|
|
17
|
+
*/
|
|
18
|
+
export function getLineCount(str?: string): number;
|
|
19
|
+
/**
|
|
20
|
+
* Get word count from string
|
|
21
|
+
* @param {string} str - Input string
|
|
22
|
+
* @returns {number} Word count
|
|
23
|
+
*/
|
|
24
|
+
export function getWordCount(str?: string): number;
|
|
25
|
+
/**
|
|
26
|
+
* Get leading spaces from text
|
|
27
|
+
* @param {string} text - Input text
|
|
28
|
+
* @returns {string} Leading spaces
|
|
29
|
+
*/
|
|
30
|
+
export function getLeadingSpaces(text: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Get first character from string
|
|
33
|
+
* @param {string} str - Input string
|
|
34
|
+
* @returns {string} First character
|
|
35
|
+
*/
|
|
36
|
+
export function getFirstCharacter(str: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Get last character from string
|
|
39
|
+
* @param {string} str - Input string
|
|
40
|
+
* @returns {string} Last character
|
|
41
|
+
*/
|
|
42
|
+
export function getLastCharacter(str: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Get row and column position from character index
|
|
45
|
+
* @param {string} input - Input string
|
|
46
|
+
* @param {number} indexToFind - Character index to find
|
|
47
|
+
* @returns {{row: number, col: number}} Row and column position
|
|
48
|
+
*/
|
|
49
|
+
export function getRowAndColumnFromCharPos(input: string, indexToFind: number): {
|
|
50
|
+
row: number;
|
|
51
|
+
col: number;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Get text between character positions
|
|
55
|
+
* @param {string} text - Input text
|
|
56
|
+
* @param {number} start - Start position
|
|
57
|
+
* @param {number} end - End position
|
|
58
|
+
* @returns {string} Text between positions
|
|
59
|
+
*/
|
|
60
|
+
export function getTextBetweenChars(text: string, start: number, end: number): string;
|
|
61
|
+
/**
|
|
62
|
+
* Get text between two words
|
|
63
|
+
* @param {string} s
|
|
64
|
+
* @param {string} prefix
|
|
65
|
+
* @param {string} suffix
|
|
66
|
+
* @returns {string}
|
|
67
|
+
*/
|
|
68
|
+
export function getTextBetweenWords(s: string, prefix: string, suffix: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* Retrieves the text content between the specified start and end lines.
|
|
71
|
+
*
|
|
72
|
+
* @param {string} content - The content to extract text from.
|
|
73
|
+
* @param {number} startLine - The line number where the extraction should start.
|
|
74
|
+
* @param {number} endLine - The line number where the extraction should end.
|
|
75
|
+
* @returns {string|undefined} - The extracted text content, or undefined if both startLine and endLine are not defined.
|
|
76
|
+
*/
|
|
77
|
+
export function getTextBetweenLines(content: string, startLine: number, endLine: number): string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Replace text between character positions
|
|
80
|
+
* @param {string} str - Input string
|
|
81
|
+
* @param {number} start - Start position
|
|
82
|
+
* @param {number} end - End position
|
|
83
|
+
* @param {string} newStr - Replacement string
|
|
84
|
+
* @returns {string} Modified string
|
|
85
|
+
*/
|
|
86
|
+
export function replaceTextBetweenChars(str: string, start: number, end: number, newStr: string): string;
|
|
87
|
+
/**
|
|
88
|
+
* Strip indentation from string
|
|
89
|
+
* @param {string} string - Input string
|
|
90
|
+
* @param {number} [indentation] - Indentation level to strip
|
|
91
|
+
* @returns {string} String with indentation stripped
|
|
92
|
+
*/
|
|
93
|
+
export function stripIndent(string: string, indentation?: number): string;
|
|
94
|
+
/**
|
|
95
|
+
* Add indentation to string
|
|
96
|
+
* @param {string} string - Input string
|
|
97
|
+
* @param {number} [count=1] - Number of indentations to add
|
|
98
|
+
* @param {object} [options={}] - Options for indentation
|
|
99
|
+
* @param {string} [options.indent=' '] - Character(s) to use for indentation
|
|
100
|
+
* @param {boolean} [options.includeEmptyLines=false] - Whether to indent empty lines
|
|
101
|
+
* @returns {string} Indented string
|
|
102
|
+
*/
|
|
103
|
+
export function indentString(string: string, count?: number, options?: {
|
|
104
|
+
indent?: string;
|
|
105
|
+
includeEmptyLines?: boolean;
|
|
106
|
+
}): string;
|
|
107
|
+
/**
|
|
108
|
+
* Removes the indentation of multiline strings
|
|
109
|
+
* @link https://github.com/victornpb/tiny-dedent/
|
|
110
|
+
* @param {string} str - A template literal string
|
|
111
|
+
* @returns {string} A string without the indentation
|
|
112
|
+
*/
|
|
113
|
+
export function dedentString(str: string): string;
|
|
114
|
+
/**
|
|
115
|
+
* Strip out comment blocks
|
|
116
|
+
* @param {string} str
|
|
117
|
+
* @param {import('../types').SyntaxType} syntax
|
|
118
|
+
* @returns {string} clean comment-less string
|
|
119
|
+
*/
|
|
120
|
+
export function stripComments(str: string, syntax?: import("../types").SyntaxType): string;
|
|
121
|
+
export function convertCommentSyntax(str: any, { from, to }: {
|
|
122
|
+
from: any;
|
|
123
|
+
to: any;
|
|
124
|
+
}): any;
|
|
125
|
+
export function stripSingleLineDoubleSlashComments(str?: string): string;
|
|
126
|
+
export function stripMultiLineDoubleSlashComments(str?: string): string;
|
|
127
|
+
export function stripHTMLComments(block: any, opts: any): any;
|
|
128
|
+
/**
|
|
129
|
+
* Trim leading & trailing spaces/line breaks in code and keeps the indentation of the first non-empty line
|
|
130
|
+
* @param {string|number} str
|
|
131
|
+
* @returns {string}
|
|
132
|
+
*/
|
|
133
|
+
export function trimString(str?: string | number): string;
|
|
134
|
+
/**
|
|
135
|
+
* Find minimum indentation in string
|
|
136
|
+
* @param {string} string - Input string
|
|
137
|
+
* @returns {number} Minimum indentation level
|
|
138
|
+
*/
|
|
139
|
+
export function findMinIndent(string: string): number;
|
|
140
|
+
/**
|
|
141
|
+
* Check if string is uppercase
|
|
142
|
+
* @param {string} str - Input string
|
|
143
|
+
* @returns {boolean} True if uppercase
|
|
144
|
+
*/
|
|
145
|
+
export function isUpperCase(str: string): boolean;
|
|
146
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/utils/text.js"],"names":[],"mappings":"AAgaA;;;;GAIG;AACH,kCAHW,MAAM,GACJ,MAAM,CAmBlB;AApbD;;;;GAIG;AACH,+BAHW,MAAM,GACJ,MAAM,EAAE,CAIpB;AAED;;;;GAIG;AACH,mCAHW,MAAM,GACJ,MAAM,CAIlB;AAgBD;;;;GAIG;AACH,mCAHW,MAAM,GACJ,MAAM,CAIlB;AAoBD;;;;GAIG;AACH,uCAHW,MAAM,GACJ,MAAM,CAKlB;AA1BD;;;;GAIG;AACH,uCAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;GAIG;AACH,sCAHW,MAAM,GACJ,MAAM,CAIlB;AAvCD;;;;;GAKG;AACH,kDAJW,MAAM,eACN,MAAM,GACJ;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,CAQtC;AAuCD;;;;;;GAMG;AACH,0CALW,MAAM,SACN,MAAM,OACN,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;;GAMG;AACH,uCALW,MAAM,UACN,MAAM,UACN,MAAM,GACJ,MAAM,CAYlB;AAcD;;;;;;;GAOG;AACH,6CALW,MAAM,aACN,MAAM,WACN,MAAM,GACJ,MAAM,GAAC,SAAS,CAiB5B;AAnCD;;;;;;;GAOG;AACH,6CANW,MAAM,SACN,MAAM,OACN,MAAM,UACN,MAAM,GACJ,MAAM,CAIlB;AAgDD;;;;;GAKG;AACH,oCAJW,MAAM,gBACN,MAAM,GACJ,MAAM,CASlB;AAaD;;;;;;;;GAQG;AACH,qCAPW,MAAM,UACN,MAAM,YAEd;IAAyB,MAAM,GAAvB,MAAM;IACY,iBAAiB,GAAnC,OAAO;CACf,GAAU,MAAM,CAclB;AAED;;;;;GAKG;AACH,kCAHW,MAAM,GACJ,MAAM,CAOlB;AAuCD;;;;;GAKG;AACH,mCAJW,MAAM,WACN,OAAO,UAAU,EAAE,UAAU,GAC3B,MAAM,CAmBlB;AA4DD;;;QAmCC;AAvFD,yEAEC;AAND,wEAEC;AAeD,8DAqCC;AArKD;;;;GAIG;AACF,iCAHU,MAAM,GAAC,MAAM,GACX,MAAM,CAMlB;AAnCD;;;;GAIG;AACH,sCAHW,MAAM,GACJ,MAAM,CAMlB;AAnBD;;;;GAIG;AACH,iCAHW,MAAM,GACJ,OAAO,CAInB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.test.d.ts","sourceRoot":"","sources":["../../../src/utils/text.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export type TocOptions = {
|
|
2
|
+
/**
|
|
3
|
+
* - Collapse toc in <details> pane
|
|
4
|
+
*/
|
|
5
|
+
collapse?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* - Text in expand pane
|
|
8
|
+
*/
|
|
9
|
+
collapseText?: string;
|
|
10
|
+
/**
|
|
11
|
+
* - Text to exclude from toc
|
|
12
|
+
*/
|
|
13
|
+
excludeText?: string;
|
|
14
|
+
/**
|
|
15
|
+
* - Exclude first heading from toc
|
|
16
|
+
*/
|
|
17
|
+
firsth1?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* - Mark as sub section table of contents
|
|
20
|
+
*/
|
|
21
|
+
sub?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* - Max depth of headings to add to toc.
|
|
24
|
+
*/
|
|
25
|
+
maxDepth?: number;
|
|
26
|
+
};
|
|
27
|
+
export type TocAPI = {
|
|
28
|
+
/**
|
|
29
|
+
* - Toc generation options
|
|
30
|
+
*/
|
|
31
|
+
options: TocOptions;
|
|
32
|
+
/**
|
|
33
|
+
* - Markdown contents
|
|
34
|
+
*/
|
|
35
|
+
fileContent: string;
|
|
36
|
+
/**
|
|
37
|
+
* - Path to markdown file
|
|
38
|
+
*/
|
|
39
|
+
srcPath: string;
|
|
40
|
+
/**
|
|
41
|
+
* - Get block details for sub tables
|
|
42
|
+
*/
|
|
43
|
+
getBlockDetails: Function;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* @typedef {object} TocOptions
|
|
47
|
+
* @property {boolean} [collapse = false] - Collapse toc in <details> pane
|
|
48
|
+
* @property {string} [collapseText] - Text in expand pane
|
|
49
|
+
* @property {string} [excludeText] - Text to exclude from toc
|
|
50
|
+
* @property {boolean} [firsth1 = true] - Exclude first heading from toc
|
|
51
|
+
* @property {boolean} [sub = false] - Mark as sub section table of contents
|
|
52
|
+
* @property {number} [maxDepth = 4] - Max depth of headings to add to toc.
|
|
53
|
+
*/
|
|
54
|
+
/**
|
|
55
|
+
* @typedef {object} TocAPI
|
|
56
|
+
* @property {TocOptions} options - Toc generation options
|
|
57
|
+
* @property {string} fileContent - Markdown contents
|
|
58
|
+
* @property {string} srcPath - Path to markdown file
|
|
59
|
+
* @property {function} getBlockDetails - Get block details for sub tables
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* Generate a table of contents
|
|
63
|
+
* @param {TocAPI} api
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
export function odlGenerateToc({ options, fileContent, srcPath, getBlockDetails }: TocAPI): Promise<any>;
|
|
67
|
+
//# sourceMappingURL=toc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toc.d.ts","sourceRoot":"","sources":["../../../src/utils/toc.js"],"names":[],"mappings":";;;;eASc,OAAO;;;;mBACP,MAAM;;;;kBACN,MAAM;;;;cACN,OAAO;;;;UACP,OAAO;;;;eACP,MAAM;;;;;;aAKN,UAAU;;;;iBACV,MAAM;;;;aACN,MAAM;;;;;;AAdpB;;;;;;;;GAQG;AAEH;;;;;;GAMG;AAEH;;;;GAIG;AACH,mFAHW,MAAM,gBA4RhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toposort.d.ts","sourceRoot":"","sources":["../../../src/utils/toposort.js"],"names":[],"mappings":"AASiB,+CAEhB;;;;;AAID,yDAsDC"}
|