Fix #2028. Also add synchronization between Iosevka source vs website data

This commit is contained in:
be5invis 2023-10-08 13:18:07 -07:00
parent e99567060a
commit 3e513f7740
3 changed files with 27 additions and 2 deletions

View 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, " "));
}

View file

@ -1,11 +1,11 @@
import * as themes from "../themes/index.mjs";
// prettier-ignore
const ssStrings = [
export const ssStrings = [
["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};"],
["1234567890 ,._-+= >< ¯-¬_ >~–÷+×<", "{*}[]()<>`+-=$/#_%^@\\&|~?'\" !,.;:"],
["!iIlL17|¦ coO08BbDQ $5SZ2zsz 96G&", [..."dbqp E3 g9qCGQ vvwVVW ", "<=", " ", "!="," ","==", " ", ">="]]
["!iIlL17|¦ coO08BbDQ $5SZ2zsz 96G&", [..."E3CGQ g9q¶ uvw ", "__", " ", "<=", " ", "!="," ","==", " ", ">=", " ", "->"]]
];
function* makeSample(lbm, hotChars) {

View file

@ -856,6 +856,9 @@ const PagesDataExport = task(`pages:data-export`, async t => {
BuildCM("iosevka", "iosevka-italic"),
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`, {
charMapPath: cm.full,
charMapItalicPath: cmi.full,