-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
infra: deleted Remark-GFM
- Loading branch information
Showing
21 changed files
with
1,787 additions
and
8,889 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: santi100a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
{ | ||
"plugins": [ | ||
"gfm", | ||
"validate-links" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,57 @@ | ||
module.exports = require('./cjs/colorize-template'); | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports.colorizeTemplate = void 0; | ||
var assertion_lib_1 = require("@santi100/assertion-lib"); | ||
var core_1 = require("./core"); | ||
/** | ||
* Fills `str`, given that it is a template like this: | ||
* ```colortemp | ||
* text %color,effect(more text) and more text | ||
* ``` | ||
* | ||
* @param template The template string to fill. | ||
* @returns The template string with all placeholders replaced with the correct colors or effects. | ||
*/ | ||
function colorizeTemplate(template) { | ||
(0, assertion_lib_1.assertTypeOf)(template, 'string', 'str'); | ||
var output = ''; | ||
var i = 0; | ||
while (i < template.length) { | ||
if (template[i] === '%') { | ||
if (template[i + 1] === '%') { | ||
output += '%'; | ||
i += 2; | ||
continue; | ||
} | ||
var j = template.indexOf('(', i); | ||
if (j === -1) { | ||
throw new SyntaxError('Invalid template: missing opening parenthesis'); | ||
} | ||
var k = template.indexOf(')', j); | ||
if (k === -1) { | ||
throw new SyntaxError('Invalid template: missing closing parenthesis'); | ||
} | ||
var directive = template.slice(i + 1, j); | ||
var _a = directive.split(/,\s*/), color = _a[0], effects = _a.slice(1); | ||
if (!core_1.COLORS[color]) { | ||
throw new Error("Invalid color: ".concat(color)); | ||
} | ||
var colorCode = core_1.COLORS[color]; | ||
for (var _i = 0, effects_1 = effects; _i < effects_1.length; _i++) { | ||
var effect = effects_1[_i]; | ||
var trimmedEffect = effect.trim(); | ||
if (!core_1.EFFECTS[trimmedEffect]) { | ||
throw new Error("Invalid effect: ".concat(trimmedEffect)); | ||
} | ||
colorCode += core_1.EFFECTS[trimmedEffect]; | ||
} | ||
output += "".concat(colorCode).concat(template.slice(j + 1, k), "\u001B[0m"); | ||
i = k + 1; | ||
continue; | ||
} | ||
output += template[i]; | ||
i++; | ||
} | ||
return output; | ||
} | ||
exports.colorizeTemplate = colorizeTemplate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,60 @@ | ||
module.exports = require('./cjs/colorize'); | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports.colorize = exports.coloring = void 0; | ||
var assertion_lib_1 = require("@santi100/assertion-lib"); | ||
var core_1 = require("./core"); | ||
var warn = typeof console === 'undefined' ? function () { return void 0; } : console.warn; | ||
var log = typeof console === 'undefined' ? function () { return void 0; } : console.log; | ||
var warnOrLog = warn !== null && warn !== void 0 ? warn : log; | ||
function __keys(o) { | ||
if (Object === null || Object === void 0 ? void 0 : Object.keys) | ||
return Object.keys(o); | ||
else { | ||
var keys = []; | ||
for (var key in o) { | ||
keys.push(key); | ||
} | ||
return keys; | ||
} | ||
} | ||
/** | ||
* Color `str` with color(s) `color`. | ||
* | ||
* @param str The string to paint in color! | ||
* @param color The color(s) to paint the string in. | ||
*/ | ||
function colorize(str, color) { | ||
(0, assertion_lib_1.assertTypeOf)(str, 'string', 'str'); | ||
if (!(color instanceof Array)) { | ||
(0, assertion_lib_1.assertTypeOf)(color, 'string', 'color'); | ||
(0, assertion_lib_1.assertOneOf)(color, 'color', __keys(core_1.COLORS_AND_EFFECTS)); | ||
} | ||
function generateFromArray(color) { | ||
var j = ''; | ||
for (var _i = 0, color_1 = color; _i < color_1.length; _i++) { | ||
var item = color_1[_i]; | ||
j += core_1.COLORS_AND_EFFECTS[item]; | ||
} | ||
j += "".concat(str, "\u001B[0m"); | ||
return j; | ||
} | ||
return typeof color === 'string' | ||
? "".concat(core_1.COLORS_AND_EFFECTS[color]).concat(str, "\u001B[0m") | ||
: generateFromArray(color); | ||
} | ||
exports["default"] = colorize; | ||
exports.colorize = colorize; | ||
/** | ||
* @deprecated This is a deprecated alias for the main `colorize` function. Use {@link colorize} instead. | ||
*/ | ||
function coloring() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
warnOrLog('coloring() is deprecated. Use colorize() instead.'); | ||
return typeof args[1] !== 'string' | ||
? colorize(args[0], args[1]) | ||
: colorize(args[0], args[1]); | ||
} | ||
exports.coloring = coloring; |
Oops, something went wrong.