Documentation!
This commit is contained in:
parent
4e81b0be9b
commit
fbbf424cb5
|
@ -67,6 +67,7 @@ async function main(): Promise<void> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Customizable options for the GEGL graph. */
|
||||||
type GraphOptions = {
|
type GraphOptions = {
|
||||||
fontSize: number;
|
fontSize: number;
|
||||||
height: number;
|
height: number;
|
||||||
|
@ -74,6 +75,7 @@ type GraphOptions = {
|
||||||
width: number;
|
width: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Create the GEGL graph for the project avatar image. */
|
||||||
function geglGraph({ fontSize, height, text, width }: GraphOptions): string[] {
|
function geglGraph({ fontSize, height, text, width }: GraphOptions): string[] {
|
||||||
const graph = `
|
const graph = `
|
||||||
gegl:text
|
gegl:text
|
||||||
|
@ -97,6 +99,7 @@ function geglGraph({ fontSize, height, text, width }: GraphOptions): string[] {
|
||||||
color=black
|
color=black
|
||||||
length=20`;
|
length=20`;
|
||||||
|
|
||||||
|
// Replace duplicate whitespace with newlines and then split by those newlines.
|
||||||
return graph.replace(/\s\s+/g, "\n").trim().split("\n");
|
return graph.replace(/\s\s+/g, "\n").trim().split("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue