释出修订版

This commit is contained in:
:NoBody: committed 2026-06-14 22:50:32 +08:00
1 parent 6ec5e1404f
commit d382ea563f
5 files changed
+29 -15

No files matched your search

+4 -8
View File
@@ -3,9 +3,8 @@ import { OpenPGPSigner } from "../pdf_builder/utils.ts";
import { DocuBuilder } from "../pdf_builder/docu_builder.ts";
import { IndexBuilder } from "../pdf_builder/index_builder.ts";
//import TurndownService from "turndown";
import { cfg } from "../main.ts";
export async function generate_pdf() {
const cfg = JSON.parse(await Deno.readTextFile("config.json"));
for (const config of cfg.settings) {
const builder = new DocuBuilder(config);
@@ -22,7 +21,6 @@ export async function generate_pdf() {
}
export async function generate_md() {
const cfg = JSON.parse(await Deno.readTextFile("config.json"));
try {
for (const config of cfg.settings) {
const builder = new DocuBuilder(config);
@@ -42,8 +40,6 @@ export async function generate_md() {
}
export async function generate_txt() {
const cfg = JSON.parse(await Deno.readTextFile("config.json"));
try {
for (const config of cfg.settings) {
const builder = new DocuBuilder(config);
@@ -65,7 +61,7 @@ export async function generate_txt() {
}
export async function add_index_to_pdf(insert_index_after_page: number = 1) {
const config = JSON.parse(await Deno.readTextFile("config.json"));
const config = cfg;
for (const cfg of config.settings) {
console.log(`Adding index to PDF ${cfg.playwright.path}...`);
@@ -104,7 +100,7 @@ export async function add_index_to_pdf(insert_index_after_page: number = 1) {
}
export async function use_qpdf() {
const config = JSON.parse(await Deno.readTextFile("config.json"));
const config = cfg;
for (const cfg of config.settings) {
if (cfg.pdf.use_qpdf?.enabled) {
console.log(`Using qpdf to linearize PDF ${cfg.playwright.path}...`);
@@ -148,7 +144,7 @@ export async function use_qpdf() {
}
export async function sign_pdf(passphrase?: string) {
const config = JSON.parse(await Deno.readTextFile("config.json"));
const config = cfg;
for (const cfg of config.settings) {
if (cfg.pdf.signing?.enabled) {
console.log(`Signing PDF ${cfg.playwright.path}...`);