small fix

This commit is contained in:
xunbu
2025-09-22 17:32:47 +08:00
parent 24ee919531
commit f88a7657b9
4 changed files with 680 additions and 562 deletions

View File

@@ -28,11 +28,11 @@ from docutranslate.agents.glossary_agent import GlossaryAgentConfig
from docutranslate.exporter.md.types import ConvertEngineType
# --- 核心代码 Imports ---
from docutranslate.global_values.conditional_import import DOCLING_EXIST
from docutranslate.workflow.ass_workflow import AssWorkflow, AssWorkflowConfig
from docutranslate.workflow.base import Workflow
from docutranslate.workflow.docx_workflow import DocxWorkflow, DocxWorkflowConfig
from docutranslate.workflow.epub_workflow import EpubWorkflow, EpubWorkflowConfig
from docutranslate.workflow.html_workflow import HtmlWorkflow, HtmlWorkflowConfig
from docutranslate.workflow.ass_workflow import AssWorkflow, AssWorkflowConfig
from docutranslate.workflow.interfaces import DocxExportable, EpubExportable
from docutranslate.workflow.interfaces import HTMLExportable, MDFormatsExportable, TXTExportable, JsonExportable, \
XlsxExportable, SrtExportable, CsvExportable, AssExportable
@@ -218,7 +218,7 @@ DocuTranslate 后端服务 API提供文档翻译、状态查询、结果下
version=__version__,
openapi_tags=tags_metadata,
)
# mimetypes.add_type("application/wasm", ".wasm")
service_router = APIRouter(prefix="/service", tags=["Service API"])
STATIC_DIR = resource_path("static")
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
@@ -1648,4 +1648,4 @@ def run_app(port: int | None = None):
if __name__ == "__main__":
run_app()
run_app()

File diff suppressed because one or more lines are too long

View File

@@ -2,15 +2,65 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ass subtitle</title>
<title>ASS Subtitle Preview</title>
<style>
html {
padding: 2vh 10vw;
font-size: 15px;
html, body {
margin: 0;
padding: 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
background-color: #f0f0f0;
font-family: sans-serif;
}
#subtitle-container {
position: relative;
width: 80vw;
/* Using a 16:9 aspect ratio for the canvas */
aspect-ratio: 16 / 9;
margin-top: 2vh;
background-color: #333;
border: 1px solid #555;
}
#subtitle-canvas {
width: 100%;
height: 100%;
display: block;
}
#controls {
margin-top: 20px;
display: flex;
align-items: center;
gap: 10px;
}
#time-slider {
width: 50vw;
}
#current-time {
min-width: 70px;
text-align: center;
font-family: monospace;
background: #fff;
padding: 5px;
border-radius: 3px;
border: 1px solid #ccc;
}
pre {
white-space: pre-wrap;
word-wrap: break-word;
background-color: #fff;
padding: 1em;
margin-top: 2vh;
width: 80vw;
border: 1px solid #ccc;
}
</style>
</head>
<body>
<div><pre>{{ ass_data }}</pre></div>
<div><pre>{{ ass_data }}</pre></div>
</body>
</html>

1174
uv.lock generated

File diff suppressed because it is too large Load Diff