Fix #2028. Also add synchronization between Iosevka source vs website data
This commit is contained in:
parent
e99567060a
commit
3e513f7740
3 changed files with 27 additions and 2 deletions
22
utility/export-tokenized-sample-code.mjs
Normal file
22
utility/export-tokenized-sample-code.mjs
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import fs from "node:fs";
|
||||||
|
|
||||||
|
import { ssStrings } from "./generate-samples/templates/package-sample.mjs";
|
||||||
|
|
||||||
|
export default main;
|
||||||
|
|
||||||
|
async function main(args) {
|
||||||
|
let out = { tokens: [] };
|
||||||
|
for (const line of ssStrings) {
|
||||||
|
let outLine = [];
|
||||||
|
for (const [id, token] of line.entries()) {
|
||||||
|
if (id > 0) {
|
||||||
|
outLine.push({ text: " ", scopes: [] });
|
||||||
|
}
|
||||||
|
let combined = Array.from(token).join("");
|
||||||
|
outLine.push({ text: combined, scopes: ["dim"] });
|
||||||
|
}
|
||||||
|
out.tokens.push(outLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
await fs.promises.writeFile(args.output, JSON.stringify(out, null, " "));
|
||||||
|
}
|
|
@ -1,11 +1,11 @@
|
||||||
import * as themes from "../themes/index.mjs";
|
import * as themes from "../themes/index.mjs";
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
const ssStrings = [
|
export const ssStrings = [
|
||||||
["ABC.DEF.GHI.JKL.MNO.PQRS.TUV.WXYZ", "abc.def.ghi.jkl.mno.pqrs.tuv.wxyz"],
|
["ABC.DEF.GHI.JKL.MNO.PQRS.TUV.WXYZ", "abc.def.ghi.jkl.mno.pqrs.tuv.wxyz"],
|
||||||
["¢ſßðþ ΓΛΔαδιλμξ КУЗЯЖэльфязычникж", "float il1[]={1-2/3.4,5+6=7/8%90};"],
|
["¢ſßðþ ΓΛΔαδιλμξ КУЗЯЖэльфязычникж", "float il1[]={1-2/3.4,5+6=7/8%90};"],
|
||||||
["1234567890 ,._-+= >< ¯-¬_ >~–÷+×<", "{*}[]()<>`+-=$/#_%^@\\&|~?'\" !,.;:"],
|
["1234567890 ,._-+= >< ¯-¬_ >~–÷+×<", "{*}[]()<>`+-=$/#_%^@\\&|~?'\" !,.;:"],
|
||||||
["!iIlL17|¦ coO08BbDQ $5SZ2zsz 96G&", [..."dbqp E3 g9qCGQ vvwVVW ", "<=", " ", "!="," ","==", " ", ">="]]
|
["!iIlL17|¦ coO08BbDQ $5SZ2zsz 96G&", [..."E3CGQ g9q¶ uvw ", "__", " ", "<=", " ", "!="," ","==", " ", ">=", " ", "->"]]
|
||||||
];
|
];
|
||||||
|
|
||||||
function* makeSample(lbm, hotChars) {
|
function* makeSample(lbm, hotChars) {
|
||||||
|
|
|
@ -856,6 +856,9 @@ const PagesDataExport = task(`pages:data-export`, async t => {
|
||||||
BuildCM("iosevka", "iosevka-italic"),
|
BuildCM("iosevka", "iosevka-italic"),
|
||||||
BuildCM("iosevka", "iosevka-oblique")
|
BuildCM("iosevka", "iosevka-oblique")
|
||||||
);
|
);
|
||||||
|
await node(`utility/export-tokenized-sample-code.mjs`, {
|
||||||
|
output: Path.resolve(pagesDir, "shared/tokenized-sample-code/alphabet.txt.json")
|
||||||
|
});
|
||||||
await node(`utility/export-data/index.mjs`, {
|
await node(`utility/export-data/index.mjs`, {
|
||||||
charMapPath: cm.full,
|
charMapPath: cm.full,
|
||||||
charMapItalicPath: cmi.full,
|
charMapItalicPath: cmi.full,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue