aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-09-23 23:17:06 +0900
committerYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-09-23 23:17:06 +0900
commit464e651652710fab87f95984017bb15129ab1087 (patch)
tree3595edc46df0f7bfa7f8b509de7fc3b8922a02fc /scripts
parenteb4f1dadc124a591d68a3e1ace3477282692da62 (diff)
FlowLicense.astro ほか: フロー図のライセンスをAI・検索向けに明示する
AIに図を読み込ませて作り直す場合に、出典が失われないようにするため、機械可読の表示を追加した。 SVGにRDFのメタデータ(dc:creator・cc:license・dc:source)を入れ、SVGの中身を読むツールやAIが利用条件を把握できるようにした。 PDFのメタデータ(title・author・subject・keywords)にも、ライセンスと出典、公立版・私立版とも同じライセンスであることを入れた。 ページには、schema.org の CreativeWork による構造化データと rel="license" を追加した。hasPart で公立学校版・私立学校版の両方を同じライセンスとして示している。 「AIで作り直す場合」の節を設け、出典の表示をお願いするとともに、作り直すと内容が変わり得るため原本のSVG・PDFの利用を勧める旨を書いた。
Diffstat (limited to 'scripts')
-rw-r--r--scripts/make-flow-pdfs.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/scripts/make-flow-pdfs.py b/scripts/make-flow-pdfs.py
index 24d8f18..5c9e840 100644
--- a/scripts/make-flow-pdfs.py
+++ b/scripts/make-flow-pdfs.py
@@ -49,12 +49,12 @@ LIC_PUBLIC = ("© 安竹洋平(小平市議会議員)/公立版・私立ç‰
LIC_PRIVATE = ("© 安竹洋平(小平市議会議員)/公立版・私立版とも CC BY-ND 4.0"
"(無保証)/yasutakeyohei.com/ijime-judai-jitai/flow/")
-# (SVGファイル名, 出力の6ページ版, 出力の1ページ版, SVGの元の高さ, フッターのライセンス)
+# (SVGファイル名, 出力の6ページ版, 出力の1ページ版, SVGの元の高さ, フッターのライセンス, 版の名前)
JOBS = [
("ijime-judai-flow.svg", "ijime-judai-flow-a4-6p.pdf",
- "ijime-judai-flow-a4-1p.pdf", 4034, LIC_PUBLIC),
+ "ijime-judai-flow-a4-1p.pdf", 4034, LIC_PUBLIC, "公立学校版"),
("ijime-judai-flow-private.svg", "ijime-judai-flow-private-a4-6p.pdf",
- "ijime-judai-flow-private-a4-1p.pdf", 3624, LIC_PRIVATE),
+ "ijime-judai-flow-private-a4-1p.pdf", 3624, LIC_PRIVATE, "私立学校版"),
]
@@ -96,7 +96,7 @@ def add_footer(page, text, license_text):
})
-def build(svg_name, out_6p, out_1p, base_h, license_text):
+def build(svg_name, out_6p, out_1p, base_h, license_text, label):
path = IMAGES / svg_name
svg = pymupdf.open("svg", strip_anchors(path.read_text(encoding="utf-8")).encode("utf-8"))
# show_pdf_page は PDF しか受け付けないため、いったんベクターPDFに変換する
@@ -122,6 +122,15 @@ def build(svg_name, out_6p, out_1p, base_h, license_text):
dest = DEST if i < 6 else one_page_rect(base_h)
page.show_pdf_page(dest, src, 0, clip=clip)
add_footer(page, footer, license_text)
+ # PDFのメタデータにも、出典とライセンスを入れる(AIや検索が読むため)
+ out.set_metadata({
+ "title": f"{TITLE}({label})",
+ "author": "安竹洋平(小平市議会議員)",
+ "subject": ("CC BY-ND 4.0(表示—改変禁止)。公立学校版・私立学校版とも同じライセンス。"
+ "出典 https://yasutakeyohei.com/ijime-judai-jitai/flow/"),
+ "keywords": f"いじめ重大事態, フロー図, {label}, CC BY-ND 4.0, 安竹洋平, 小平市",
+ "creator": "https://yasutakeyohei.com/ijime-judai-jitai/flow/",
+ })
out.subset_fonts()
tmp = path.with_suffix(".tmp.pdf")
out.save(tmp, garbage=4, deflate=True, clean=True)
@@ -135,5 +144,5 @@ def build(svg_name, out_6p, out_1p, base_h, license_text):
src.close()
-for svg_name, out_6p, out_1p, base_h, license_text in JOBS:
- build(svg_name, out_6p, out_1p, base_h, license_text)
+for svg_name, out_6p, out_1p, base_h, license_text, label in JOBS:
+ build(svg_name, out_6p, out_1p, base_h, license_text, label)