Skip to content

Commit c841bbe

Browse files
chore: change const variable name
1 parent ee89751 commit c841bbe

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/constant.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
export const OPENING_COMMENT = '<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n' +
1+
export const OPENING_COMMENT = '<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n' +
22
'<!-- DON\'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->';
3-
export const CLOSING_COMMENT = '<!-- END doctoc generated TOC please keep comment here to allow auto update -->';
4-
export const CHECK_OPENING_COMMENT = '<!-- START doctoc ';
5-
export const CHECK_CLOSING_COMMENT = '<!-- END doctoc ';
6-
export const DEFAULT_TITLE = '**Table of Contents** *generated with [DocToc](https://github.com/technote-space/doctoc)*';
7-
export const MARKDOWN_EXTENSIONS = ['.md', '.markdown'];
8-
export const IGNORED_DIRS = ['.', '..', '.git', 'node_modules'];
9-
export const DEFAULT_HTML_TEMPLATE = '<p align="center">${ITEMS}</p>';
10-
export const DEFAULT_ITEM_TEMPLATE = '<a href="${LINK}">${TEXT}</a>';
11-
export const DEFAULT_SEPARATOR = '<span>|</span>';
3+
export const CLOSING_COMMENT = '<!-- END doctoc generated TOC please keep comment here to allow auto update -->';
4+
export const CHECK_OPENING_COMMENT = '<!-- START doctoc ';
5+
export const CHECK_CLOSING_COMMENT = '<!-- END doctoc ';
6+
export const DEFAULT_TITLE = '**Table of Contents** *generated with [DocToc](https://github.com/technote-space/doctoc)*';
7+
export const MARKDOWN_EXTENSIONS = ['.md', '.markdown'];
8+
export const IGNORED_DIRS = ['.', '..', '.git', 'node_modules'];
9+
export const DEFAULT_CUSTOM_TEMPLATE = '<p align="center">${ITEMS}</p>';
10+
export const DEFAULT_ITEM_TEMPLATE = '<a href="${LINK}">${TEXT}</a>';
11+
export const DEFAULT_SEPARATOR = '<span>|</span>';

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export {
88
DEFAULT_TITLE,
99
MARKDOWN_EXTENSIONS,
1010
IGNORED_DIRS,
11-
DEFAULT_HTML_TEMPLATE,
11+
DEFAULT_CUSTOM_TEMPLATE,
1212
DEFAULT_ITEM_TEMPLATE,
1313
DEFAULT_SEPARATOR,
1414
} from './constant';

src/lib/transform.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
CHECK_OPENING_COMMENT,
1111
CHECK_CLOSING_COMMENT,
1212
DEFAULT_TITLE,
13-
DEFAULT_HTML_TEMPLATE,
13+
DEFAULT_CUSTOM_TEMPLATE,
1414
DEFAULT_ITEM_TEMPLATE,
1515
DEFAULT_SEPARATOR,
1616
} from '..';
@@ -126,7 +126,7 @@ const getHeaderItem = (header: HeaderWithAnchor, indentation: string, lowestRank
126126
return `${indentation.repeat(header.rank - lowestRank)}${entryPrefix} ${header.anchor}`;
127127
};
128128

129-
const getHtmlHeaderContents = (headers: Array<HeaderWithAnchor>, lowestRank: number, customTemplate: string | undefined, itemTemplate: string | undefined, separator: string | undefined): string => replaceVariables(customTemplate ?? DEFAULT_HTML_TEMPLATE, [{
129+
const getHtmlHeaderContents = (headers: Array<HeaderWithAnchor>, lowestRank: number, customTemplate: string | undefined, itemTemplate: string | undefined, separator: string | undefined): string => replaceVariables(customTemplate ?? DEFAULT_CUSTOM_TEMPLATE, [{
130130
key: 'ITEMS',
131131
replace: `\n${headers.filter(header => header.rank === lowestRank).map(header => getHeaderItemHtml(header, itemTemplate)).join(`\n${separator ?? DEFAULT_SEPARATOR}\n`)}\n`,
132132
}]);

0 commit comments

Comments
 (0)