# -*- coding: utf-8 -*- """Static HTML for the Space page, in English and Chinese. Every visible string comes in both languages: L(en, zh) gives two spans and the stylesheet shows the one matching . Every number on this page comes from the release README / the release fact sheet; keep it that way. Never promise a detector result. """ from __future__ import annotations import html import json import diffmark from document import MAX_BYTES UPLOAD_MB = MAX_BYTES // (1024 * 1024) GH = "https://github.com/sgaofen/humanizer-local-model" REL = GH + "/releases/latest" APP_DL = GH + "/releases/download/app-v0.3.2/" # direct files; bump with each app release MAC_DMG = APP_DL + "Humanizer-0.3.2-macos-arm64.dmg" WIN_EXE = APP_DL + "Humanizer-0.3.2-windows-x64-setup.exe" BLOB = GH + "/blob/main/" HF_MODEL = "https://huggingface.co/jialinyyzz/humanizer" INSTALL_EN = BLOB + "docs/INSTALL.md#first-launch-warnings" INSTALL_ZH = BLOB + "docs/INSTALL.zh.md#第一次打开被拦" USAGE_EN = BLOB + "docs/USAGE.md" USAGE_ZH = BLOB + "docs/USAGE.zh.md" AGENTS = BLOB + "AGENTS.md" BLADER = "https://github.com/blader/humanizer" MAX_WORDS = 700 # English words per part (one GPU call) MAX_CJK = 1200 # Chinese characters per part PARTS = 3 # a longer draft is split at paragraph breaks and rewritten part by part, at most this many per run def L(en: str, zh: str) -> str: """Inline text in both languages.""" return f'{en}{zh}' def P(en: str, zh: str, cls: str = "", tag: str = "p") -> str: """A block in both languages.""" c = f" {cls}" if cls else "" return f'<{tag} class="l-en{c}">{en}<{tag} class="l-zh{c}" lang="zh-CN">{zh}' def A(href: str, text: str, cls: str = "") -> str: c = f' class="{cls}"' if cls else "" return f'{text}' def icon(name: str, cls: str = "") -> str: c = f' class="{cls}"' if cls else "" return f'