prlog plugins are extentions for String
prototype that can be chained together.
NOTE: It is recommended that you prefix your plugin name with
prlog
or any desired identifier to avoid confusion.
example:
// MyPlugin.ts
declare global {
interface String {
prlogMyPlugin(): string;
}
}
String.prototype.prlogMyPlugin = function (): string {
return this.replaceAll("{{ MYTAG }}", "Best Plugin Ever!");
};
export {};
To use a plugin, just import the plugin file and it will be globally available on every string
// release.ts
import prlog from "https://deno.land/x/prlog/mod.ts";
import "./MyPlugin.ts";
const template: string = `
{{ MYTAG }}
{{ CHANGELOG }}
`;
console.log((await prlog(template, "username/repo")).prlogMyPlugin());
/*
Best Plugin Ever!
- pull request 1 (#1)
- pull request 2 (#2)
*/
import "https://deno.land/x/prlog/plugins/Version.ts";
String().prlogVersion(version: string, tag?: string): string
tag: {{ VERSION }}
paremeters:
version
- Version to usetag?
- Optional custom tag
import "https://deno.land/x/prlog/plugins/SetDate.ts";
String().prlogSetDate(date?: string, format?: string, tag?: string): string
tag: {{ DATE }}
paremeters:
date?
- Optional date. Defauts to current dateformat?
- Optional date format. Defaults todd MM yyyy
. more infotag?
- Optional custom tag
import "https://deno.land/x/prlog/plugins/CodeName.ts";
String().prlogCodeName(codename: string, tag?: string): string
tag: {{ CODENAME }}
paremeters:
codename
- Release codenametag?
- Optional custom tag