diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index aff4e90..400a685 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -6,7 +6,8 @@
-
+
+
@@ -37,62 +38,62 @@
- {
+ "keyToString": {
+ "DefaultHtmlFileTemplate": "HTML File",
+ "JavaScript 调试.output.html (1).executor": "Run",
+ "JavaScript 调试.output.html.executor": "Run",
+ "JavaScript 调试.regex.md_中文.html.executor": "Run",
+ "JavaScript 调试.regex_中文.html.executor": "Run",
+ "JavaScript 调试.test.html.executor": "Run",
+ "JavaScript 调试.test2.html.executor": "Run",
+ "JavaScript 调试.test2_英文.html.executor": "Run",
+ "JavaScript 调试.test4-1_中文.html.executor": "Run",
+ "JavaScript 调试.互联网认证授权机制.html.executor": "Run",
+ "JavaScript 调试.互联网认证授权机制_英文.html.executor": "Run",
+ "JavaScript 调试.毕业论文_英文.html.executor": "Run",
+ "ModuleVcsDetector.initialDetectionPerformed": "true",
+ "Python 测试.Python 测试 (markdown_mask.py 内).executor": "Run",
+ "Python 测试.markdown_mask.Test.test_basic_link_masking 的 Python 测试.executor": "Run",
+ "Python 测试.pytest (test_html.py 内).executor": "Run",
+ "Python.1test.executor": "Run",
+ "Python.2test2 (1).executor": "Run",
+ "Python.PDFtranslater (1).executor": "Run",
+ "Python.PDFtranslater (2).executor": "Run",
+ "Python.agent.executor": "Debug",
+ "Python.agent_utils.executor": "Run",
+ "Python.app (1).executor": "Run",
+ "Python.app.executor": "Run",
+ "Python.app2.executor": "Run",
+ "Python.app_test (1).executor": "Run",
+ "Python.convert.executor": "Run",
+ "Python.converter_docling.executor": "Run",
+ "Python.converter_mineru.executor": "Run",
+ "Python.markdown_splitter.executor": "Debug",
+ "Python.markdown_utils.executor": "Run",
+ "Python.test.executor": "Run",
+ "Python.test1.executor": "Run",
+ "Python.test2.executor": "Run",
+ "Python.test3.executor": "Run",
+ "Python.test4.executor": "Run",
+ "Python.testhtml.executor": "Run",
+ "Python.translater.executor": "Run",
+ "Python.切分测试.executor": "Run",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager": "true",
+ "RunOnceActivity.git.unshallow": "true",
+ "git-widget-placeholder": "main",
+ "last_opened_file_path": "C:/Users/jxgm/Desktop/translate/docutranslate",
+ "list.type.of.created.stylesheet": "CSS",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "settings.editor.selected.configurable": "preferences.pluginManager",
+ "vue.rearranger.settings.migration": "true"
}
-}]]>
+}
@@ -109,7 +110,7 @@
-
+
@@ -509,8 +510,8 @@
-
+
@@ -610,6 +611,7 @@
+
@@ -632,14 +634,14 @@
file://$PROJECT_DIR$/docutranslate/translater.py
- 240
+ 241
-
+
@@ -658,7 +660,7 @@
-
+
diff --git a/docutranslate/__init__.py b/docutranslate/__init__.py
index 933f19a..d6b6710 100644
--- a/docutranslate/__init__.py
+++ b/docutranslate/__init__.py
@@ -1,4 +1,4 @@
-__version__="0.2.26"
+__version__="0.2.27"
diff --git a/docutranslate/translater.py b/docutranslate/translater.py
index 3f32d63..e819e91 100644
--- a/docutranslate/translater.py
+++ b/docutranslate/translater.py
@@ -10,6 +10,7 @@ from docutranslate.utils.markdown_splitter import split_markdown_text, join_mark
from docutranslate.utils.markdown_utils import uris2placeholder, placeholder2_uris, MaskDict
from docutranslate.logger import translater_logger
from docutranslate.global_values import available_packages
+from docutranslate.utils.resource_utils import resource_path
DOCLING_FLAG = True if available_packages.get("docling") else False
if DOCLING_FLAG:
@@ -296,10 +297,10 @@ class FileTranslater:
def export_to_html(self, title="title") -> str:
markdowner = markdown2.Markdown(extras=['tables', 'fenced-code-blocks', 'mermaid', "code-friendly"])
# language=html
- pico=Path(__file__).parent / "static" / "pico.css"
- html = Path(__file__).parent / "template" / "markdown.html"
- MathJax=Path(__file__).parent / "static" / "MathJax.js"
- mermaid=Path(__file__).parent / "static" / "mermaid.js"
+ pico=resource_path("static/pico.css")
+ html = resource_path("template/markdown.html")
+ MathJax=resource_path( "static/MathJax.js")
+ mermaid=resource_path( "static/mermaid.js")
#TODO:实现MathJax本地化
render = jinja2.Template(html.read_text()).render(
title=title,