Add fictioneer multisrc (#1468)

* Add fictioneer multisrc, auto source req labeling for it, move daoistquest to it, add novelib

* fictioneer pagination, fix author, add status
This commit is contained in:
Adam Kemish
2025-01-30 11:17:58 +08:00
committed by GitHub
parent bd2d3fdd60
commit 09a0bfb489
6 changed files with 122 additions and 18 deletions
+33
View File
@@ -0,0 +1,33 @@
import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
const folder = dirname(fileURLToPath(import.meta.url));
import list from './sources.json' with { type: 'json' };
export const generateAll = function () {
return list.map(source => {
console.log(
`[fictioneer] Generating: ${source.id}${' '.repeat(20 - source.id.length)}`,
);
return generator(source);
});
};
const generator = function generator(source) {
const readNovelFullTemplate = readFileSync(join(folder, 'template.ts'), {
encoding: 'utf-8',
});
const pluginScript = `
${readNovelFullTemplate}
const plugin = new FictioneerPlugin(${JSON.stringify(source)});
export default plugin;
`.trim();
return {
lang: source.options?.lang || 'English',
filename: source.sourceName,
pluginScript,
};
};