first commit

This commit is contained in:
Longtail committed 2026-10-31 16:15:04 +08:00
commit 1e6504b4a2
41 files changed
+4964

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
"""Build the page-context userscript from reviewed local components; no external assets."""
from pathlib import Path
ROOT = Path(__file__).resolve().parent
header = '''// ==UserScript==
// @name 新闻工作台 · 导入排版与流程
// @namespace local.dww11.auto-news
// @version 0.1.0
// @match https://www.dww11.com/*
// @match https://dww11.com/*
// @match https://house.dww11.com/*
// @grant none
// @run-at document-idle
// @noframes
// ==/UserScript==
'''
parts = []
for name in ('importer.js', 'formatter.js', 'runner.js'):
source = (ROOT / 'browser' / name).read_text()
if '// ==/UserScript==' in source:
source = source.split('// ==/UserScript==', 1)[1]
parts.append(source)
(ROOT / 'browser/auto-news.user.js').write_text(header + '\n'.join(parts))
print('已生成 browser/auto-news.user.js')