somark-js 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +156 -0
- package/README.md +32 -0
- package/README_CN.md +31 -0
- package/dist/chunk-RWOUZTFQ.mjs +236 -0
- package/dist/cli.mjs +1503 -0
- package/dist/config-GOZJZCRT.mjs +26 -0
- package/dist/index.cjs +1304 -0
- package/dist/index.d.cts +258 -0
- package/dist/index.d.ts +258 -0
- package/dist/index.mjs +1245 -0
- package/package.json +66 -0
- package/vendor/somarkdown-viewer/LICENSE +21 -0
- package/vendor/somarkdown-viewer/README.md +63 -0
- package/vendor/somarkdown-viewer/README_CN.md +63 -0
- package/vendor/somarkdown-viewer/index.html +112 -0
- package/vendor/somarkdown-viewer/lib/bi-direction-jump.js +161 -0
- package/vendor/somarkdown-viewer/lib/deps/highlight.js.default.min.css +11 -0
- package/vendor/somarkdown-viewer/lib/deps/katex.min.css +6 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_AMS-Regular.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Main-Bold.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Main-Bold.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Main-Italic.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Main-Italic.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Main-Regular.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Main-Regular.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Math-Italic.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Math-Italic.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Script-Regular.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Script-Regular.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Size1-Regular.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Size2-Regular.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Size3-Regular.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Size4-Regular.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/vendor/somarkdown-viewer/lib/deps/katex_fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/vendor/somarkdown-viewer/lib/i18n.js +81 -0
- package/vendor/somarkdown-viewer/lib/index.js +299 -0
- package/vendor/somarkdown-viewer/lib/somarkdown/VERSION +1 -0
- package/vendor/somarkdown-viewer/lib/somarkdown/somarkdown.css +591 -0
- package/vendor/somarkdown-viewer/lib/somarkdown/somarkdown.umd.min.js +59 -0
- package/vendor/somarkdown-viewer/lib/sync-scroll.js +147 -0
- package/vendor/somarkdown-viewer/style/index.css +527 -0
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "somark-js",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "SoMark SDK + CLI — Document parsing, PDF processing, and SoMarkDown preview",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"vendor/somarkdown-viewer/index.html",
|
|
12
|
+
"vendor/somarkdown-viewer/lib",
|
|
13
|
+
"vendor/somarkdown-viewer/style",
|
|
14
|
+
"README.md",
|
|
15
|
+
"README_CN.md",
|
|
16
|
+
"LICENSE"
|
|
17
|
+
],
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.mjs",
|
|
22
|
+
"require": "./dist/index.cjs"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"bin": {
|
|
26
|
+
"somark": "./dist/cli.mjs"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsup",
|
|
33
|
+
"test": "npm run build && vitest run",
|
|
34
|
+
"test:watch": "vitest"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"somark",
|
|
38
|
+
"pdf",
|
|
39
|
+
"document",
|
|
40
|
+
"parsing",
|
|
41
|
+
"cli",
|
|
42
|
+
"sdk"
|
|
43
|
+
],
|
|
44
|
+
"author": "SoMark",
|
|
45
|
+
"license": "Apache-2.0",
|
|
46
|
+
"homepage": "https://somark.tech",
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "https://github.com/SoMarkAI/somark-js"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@hyzyla/pdfium": "^2.1.12",
|
|
53
|
+
"@types/pngjs": "^6.0.5",
|
|
54
|
+
"chalk": "^5.3.0",
|
|
55
|
+
"commander": "^12.0.0",
|
|
56
|
+
"open": "^10.1.0",
|
|
57
|
+
"ora": "^8.1.0",
|
|
58
|
+
"pngjs": "^7.0.0"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@types/node": "^20.0.0",
|
|
62
|
+
"tsup": "^8.0.0",
|
|
63
|
+
"typescript": "^5.4.0",
|
|
64
|
+
"vitest": "^1.6.0"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Mathpix
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# SoMarkDown Viewer
|
|
2
|
+
|
|
3
|
+
English | [中文](./README_CN.md)
|
|
4
|
+
|
|
5
|
+
[](https://github.com/SoMarkAI/SoMarkDownViewer/blob/main/LICENSE)
|
|
6
|
+
|
|
7
|
+
SoMarkDown Viewer is a web application of [SoMarkDown](https://github.com/SoMarkAI/SoMarkDown), designed for previewing and rendering SoMarkDown documents.
|
|
8
|
+
|
|
9
|
+
Quick Try: https://somark.tech/smd
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
SoMarkDown is a Markdown superset built upon [markdown-it](https://github.com/markdown-it/markdown-it), providing enhanced support for professional rendering capabilities including mathematical formulas, chemical structures (SMILES), code syntax highlighting, and more. SoMarkDown also serves as the target protocol for parsing results in the [SoMark](https://somark.ai/) document intelligence parsing product.
|
|
14
|
+
|
|
15
|
+
This Viewer project is not only a SoMarkDown preview tool, but also provides interactive professional rendering features, including:
|
|
16
|
+
1. Real-time editing and rendering of SoMarkDown documents.
|
|
17
|
+
2. Bi-directional synchronized scrolling with logical alignment.
|
|
18
|
+
3. Bi-directional click-to-jump position mapping.
|
|
19
|
+
|
|
20
|
+
We also provide the Gradio plugin [gradio-somarkdown](https://github.com/SoMarkAI/gradio_somarkdown), which can replace the Markdown component in Gradio.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
This project is implemented entirely with native HTML, JavaScript, and CSS, and can be launched with a straightforward setup.
|
|
25
|
+
|
|
26
|
+
1. Clone the repository:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git clone https://github.com/SoMarkAI/SoMarkDownViewer.git
|
|
30
|
+
cd SoMarkDownViewer
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
2. Retrieve the latest SoMarkDown JavaScript and CSS files:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# -k runs silently
|
|
37
|
+
./get_latest_smd.sh
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
> If you encounter network issues, you may manually download the latest `somarkdown.umd.min.js` and `somarkdown.css` files from the [SoMarkDown npm package](https://www.jsdelivr.com/package/npm/somarkdown), and place them under `lib/somarkdown`.
|
|
41
|
+
|
|
42
|
+
3. Start the project using an HTTP server (for example, Python 3 HTTPServer):
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Python 3.x
|
|
46
|
+
python3 -m http.server 8000
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
4. Open `http://localhost:8000` in your browser to use SoMarkDown Viewer.
|
|
50
|
+
|
|
51
|
+
## Loading Files
|
|
52
|
+
|
|
53
|
+
The Viewer supports multiple methods to load SoMarkDown files:
|
|
54
|
+
|
|
55
|
+
1. Specify the relative file path directly in the URL (relative to the server root), for example: `http://localhost:8000?file=example.md`.
|
|
56
|
+
2. Click the "Open File" button on the page and select a local file.
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
MIT
|
|
61
|
+
|
|
62
|
+
## SoMarkDown WeChat Group
|
|
63
|
+
<img src="./docs/assets/wechat.png" width="100">
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# SoMarkDown Viewer
|
|
2
|
+
|
|
3
|
+
[English](./README.md) | 中文
|
|
4
|
+
|
|
5
|
+
[](https://github.com/SoMarkAI/SoMarkDownViewer/blob/main/LICENSE)
|
|
6
|
+
|
|
7
|
+
SoMarkDown Viewer 是 [SoMarkDown](https://github.com/SoMarkAI/SoMarkDown) 的一个 Web 应用,用于预览和渲染 SoMarkDown 文档。
|
|
8
|
+
|
|
9
|
+
在线体验:https://somark.tech/smd
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
SoMarkDown 是 Markdown 的超集,基于[markdown-it](https://github.com/markdown-it/markdown-it)开发,添加了对专业渲染方案的支持,如数学公式、化学结构式(SMILES)、代码语法高亮等。SoMarkDown 也是 [SoMark](https://somark.ai/) 文档智能解析产品的解析结果目标协议。
|
|
14
|
+
|
|
15
|
+
本 Viewer 项目不仅仅作为 SoMarkDown 文档预览工具,还提供了专业渲染器的交互功能,包括:
|
|
16
|
+
1. 实时编辑渲染 SoMarkDown 文档。
|
|
17
|
+
2. 逻辑对齐的双向同步滚动。
|
|
18
|
+
3. 双向点击对应位置跳转。
|
|
19
|
+
|
|
20
|
+
我们还提供了 Gradio 插件 [gradio-somarkdown](https://github.com/SoMarkAI/gradio_somarkdown),可以替代 Gradio 中的 Markdown 组件。
|
|
21
|
+
|
|
22
|
+
## 安装
|
|
23
|
+
|
|
24
|
+
本项目采用完全原生的HTML、JS、CSS实现,启动方式简洁。
|
|
25
|
+
|
|
26
|
+
1. 克隆项目到本地:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git clone https://github.com/SoMarkAI/SoMarkDownViewer.git
|
|
30
|
+
cd SoMarkDownViewer
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
2. 获取最新的 SoMarkDown 的js、css文件:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# -k 静默执行
|
|
37
|
+
./get_latest_smd.sh
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
> 如果遇到了网络问题,可以手动到 [SoMarkDown 的 npm 包](https://www.jsdelivr.com/package/npm/somarkdown) 下载最新版本的 somarkdown.umd.min.js 和 somarkdown.css 文件,保存到 lib/somarkdown 目录下。
|
|
41
|
+
|
|
42
|
+
3. 采用一个HTTP服务器(如Python3的HTTPServer)启动项目。
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# python 3.x
|
|
46
|
+
python3 -m http.server 8000
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
4. 在浏览器中打开 `http://localhost:8000` 即可查看和使用 SoMarkDown Viewer。
|
|
50
|
+
|
|
51
|
+
## 载入文件
|
|
52
|
+
|
|
53
|
+
Viewer 提供了多种方式载入 SoMarkDown 文件:
|
|
54
|
+
|
|
55
|
+
1. 直接在 URL 中指定文件的相对路径(相对于服务器启动路径),如 `http://localhost:8000?file=example.md`。
|
|
56
|
+
2. 点击页面上的 "打开文件" 按钮,选择本地文件。
|
|
57
|
+
|
|
58
|
+
## 许可证
|
|
59
|
+
|
|
60
|
+
MIT
|
|
61
|
+
|
|
62
|
+
## SoMarkDown 微信交流群
|
|
63
|
+
<img src="./docs/assets/wechat.png" width="100">
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>SoMarkDown Viewer</title>
|
|
7
|
+
<link rel="stylesheet" href="lib/deps/katex.min.css">
|
|
8
|
+
<link rel="stylesheet" href="lib/deps/highlight.js.default.min.css">
|
|
9
|
+
<link rel="stylesheet" href="lib/somarkdown/somarkdown.css">
|
|
10
|
+
<link rel="stylesheet" href="style/index.css">
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div class="app-container" id="app-container">
|
|
14
|
+
<div class="app-main" id="app-main">
|
|
15
|
+
<header class="app-header">
|
|
16
|
+
<div class="header-left">
|
|
17
|
+
<a href="https://somark.ai" target="_blank" class="logo-text">
|
|
18
|
+
<span style="color: #ef871b;">SoMarkDown</span> Viewer|
|
|
19
|
+
<svg class="header__logo-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 170.82 137.43" width="24" height="24">
|
|
20
|
+
<rect class="header__logo-rect header__logo-rect--top" x="0" width="170.82" height="27.49" fill="#fff"/>
|
|
21
|
+
<rect class="header__logo-rect header__logo-rect--middle" y="54.97" width="170.82" height="27.49" fill="#f39800"/>
|
|
22
|
+
<rect class="header__logo-rect header__logo-rect--bottom-left" x="0" y="109.95" width="71.67" height="27.49" fill="#fff"/>
|
|
23
|
+
<rect class="header__logo-rect header__logo-rect--bottom-right" x="99.15" y="109.95" width="71.67" height="27.49" transform="translate(269.97 247.38) rotate(-180)" fill="#fff"/>
|
|
24
|
+
</svg>
|
|
25
|
+
SoMark
|
|
26
|
+
</a>
|
|
27
|
+
<span class="file-path" id="file-path">docs/example.md</span>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="header-right">
|
|
30
|
+
<button class="icon-btn" id="open-file-btn" type="button" aria-label="Open local file">
|
|
31
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-8l-2-2H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2Z"></path><path d="M2 10h20"></path></svg>
|
|
32
|
+
</button>
|
|
33
|
+
<a class="icon-btn" href="https://github.com/SoMarkAI/SoMarkDown" target="_blank">
|
|
34
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"></path><path d="M9 18c-4.51 2-5-2-7-2"></path></svg>
|
|
35
|
+
</a>
|
|
36
|
+
<button class="icon-btn" id="setting-open-btn" type="button" aria-label="Open settings">
|
|
37
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg>
|
|
38
|
+
</button>
|
|
39
|
+
</div>
|
|
40
|
+
</header>
|
|
41
|
+
<input id="local-file-input" type="file" accept=".md,.smd,.txt,text/markdown,text/plain" hidden>
|
|
42
|
+
<div class="markdown-content">
|
|
43
|
+
<section class="markdown-source">
|
|
44
|
+
<div class="markdown-source-title">
|
|
45
|
+
<span class="panel-title" data-i18n="panel.source">Source</span>
|
|
46
|
+
<span class="line-count" id="line-count-text">1 Lines</span>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="markdown-source-content">
|
|
49
|
+
<div class="editor-container">
|
|
50
|
+
<div class="line-numbers" id="line-numbers">
|
|
51
|
+
<div class="line-numbers-inner" id="line-numbers-inner">
|
|
52
|
+
<div>1</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
<textarea id="markdown-source" class="editor-textarea" spellcheck="false"></textarea>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</section>
|
|
59
|
+
<section class="markdown-preview">
|
|
60
|
+
<div class="markdown-preview-title">
|
|
61
|
+
<span class="panel-title" data-i18n="panel.preview">Preview</span>
|
|
62
|
+
</div>
|
|
63
|
+
<div class="markdown-preview-content" id="preview-viewport">
|
|
64
|
+
<div id="markdown-preview" class="somarkdown-container theme-dark"></div>
|
|
65
|
+
</div>
|
|
66
|
+
</section>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<div class="setting-backdrop" id="setting-backdrop"></div>
|
|
70
|
+
<aside class="setting-panel" id="setting-panel">
|
|
71
|
+
<div class="setting-panel-header">
|
|
72
|
+
<span data-i18n="settings.title">Setting</span>
|
|
73
|
+
<button class="close-btn" id="setting-close-btn" type="button">
|
|
74
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg>
|
|
75
|
+
</button>
|
|
76
|
+
</div>
|
|
77
|
+
<div class="setting-panel-content">
|
|
78
|
+
<label class="setting-item">
|
|
79
|
+
<span data-i18n="settings.colorChemistry">Color Chemistry</span>
|
|
80
|
+
<input type="checkbox" id="color-chemistry-checkbox">
|
|
81
|
+
</label>
|
|
82
|
+
<label class="setting-item">
|
|
83
|
+
<span data-i18n="settings.imageUnderstanding">Image Understanding</span>
|
|
84
|
+
<input type="checkbox" id="image-understanding-checkbox">
|
|
85
|
+
</label>
|
|
86
|
+
<div class="setting-item setting-item-range">
|
|
87
|
+
<div class="setting-item-label-row">
|
|
88
|
+
<span data-i18n="settings.tocMaxLevel">TOC Max Level</span>
|
|
89
|
+
<span id="toc-level-value">3</span>
|
|
90
|
+
</div>
|
|
91
|
+
<input type="range" id="toc-level-slider" min="1" max="6" value="3">
|
|
92
|
+
</div>
|
|
93
|
+
<label class="setting-item setting-item-select">
|
|
94
|
+
<span data-i18n="settings.language">Language</span>
|
|
95
|
+
<select id="language-select">
|
|
96
|
+
<option value="zh-CN">中文</option>
|
|
97
|
+
<option value="en">English</option>
|
|
98
|
+
</select>
|
|
99
|
+
</label>
|
|
100
|
+
<div class="setting-panel-footer">
|
|
101
|
+
<div class="setting-panel-footer-title" data-i18n="settings.about">About</div>
|
|
102
|
+
<div data-i18n="settings.aboutText">
|
|
103
|
+
SoMarkDown was established with the dual objective of delivering a powerful and flexible Markdown rendering solution for professional users while providing LLMs with a concise, unambiguous, and easily parsable Markdown standard. SoMarkDown also serves as the target protocol for parsing results in the SoMark document intelligence parsing product.
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</aside>
|
|
108
|
+
</div>
|
|
109
|
+
<script src="lib/somarkdown/somarkdown.umd.min.js"></script>
|
|
110
|
+
<script type="module" src="lib/index.js"></script>
|
|
111
|
+
</body>
|
|
112
|
+
</html>
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
class BiDirectionJump {
|
|
2
|
+
constructor(options) {
|
|
3
|
+
this.editor = options.editor;
|
|
4
|
+
this.preview = options.preview;
|
|
5
|
+
this.mappedNodes = [];
|
|
6
|
+
this.activeNode = null;
|
|
7
|
+
this.hoverNode = null;
|
|
8
|
+
this.onEditorCursorChange = this.onEditorCursorChange.bind(this);
|
|
9
|
+
this.onPreviewMouseOver = this.onPreviewMouseOver.bind(this);
|
|
10
|
+
this.onPreviewMouseLeave = this.onPreviewMouseLeave.bind(this);
|
|
11
|
+
this.onPreviewDoubleClick = this.onPreviewDoubleClick.bind(this);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
start() {
|
|
15
|
+
this.editor.addEventListener("click", this.onEditorCursorChange);
|
|
16
|
+
this.editor.addEventListener("keyup", this.onEditorCursorChange);
|
|
17
|
+
this.editor.addEventListener("input", this.onEditorCursorChange);
|
|
18
|
+
this.editor.addEventListener("focus", this.onEditorCursorChange);
|
|
19
|
+
this.preview.addEventListener("mouseover", this.onPreviewMouseOver);
|
|
20
|
+
this.preview.addEventListener("mouseleave", this.onPreviewMouseLeave);
|
|
21
|
+
this.preview.addEventListener("dblclick", this.onPreviewDoubleClick);
|
|
22
|
+
this.refreshMap();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
refreshMap() {
|
|
26
|
+
const nodes = Array.from(this.preview.querySelectorAll("[data-line]"));
|
|
27
|
+
this.mappedNodes = nodes
|
|
28
|
+
.map((node) => {
|
|
29
|
+
const line = Number.parseInt(node.getAttribute("data-line"), 10);
|
|
30
|
+
if (Number.isNaN(line)) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
node.classList.add("bi-direction-jump__target");
|
|
34
|
+
return { line, node };
|
|
35
|
+
})
|
|
36
|
+
.filter((entry) => entry !== null)
|
|
37
|
+
.sort((a, b) => a.line - b.line);
|
|
38
|
+
this.activeNode = null;
|
|
39
|
+
this.hoverNode = null;
|
|
40
|
+
this.syncPreviewHighlight();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
onEditorCursorChange() {
|
|
44
|
+
this.syncPreviewHighlight();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
onPreviewMouseOver(event) {
|
|
48
|
+
const target = event.target.closest("[data-line]");
|
|
49
|
+
if (!target || !this.preview.contains(target)) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
this.setHoverNode(target);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
onPreviewMouseLeave() {
|
|
56
|
+
this.setHoverNode(null);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
onPreviewDoubleClick(event) {
|
|
60
|
+
const target = event.target.closest("[data-line]");
|
|
61
|
+
if (!target || !this.preview.contains(target)) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const line = Number.parseInt(target.getAttribute("data-line"), 10);
|
|
65
|
+
if (Number.isNaN(line)) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const cursorPos = this.getLineStartPos(this.editor.value, line);
|
|
69
|
+
this.editor.focus();
|
|
70
|
+
this.editor.setSelectionRange(cursorPos, cursorPos);
|
|
71
|
+
this.scrollEditorToLineIfNeeded(line);
|
|
72
|
+
this.syncPreviewHighlight();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
syncPreviewHighlight() {
|
|
76
|
+
const line = this.getCursorLine(this.editor);
|
|
77
|
+
const target = this.findBestMatchNode(line);
|
|
78
|
+
this.setActiveNode(target);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
getCursorLine(textarea) {
|
|
82
|
+
const cursorPos = textarea.selectionStart;
|
|
83
|
+
const textBeforeCursor = textarea.value.slice(0, cursorPos);
|
|
84
|
+
return textBeforeCursor.split("\n").length - 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
getLineStartPos(text, line) {
|
|
88
|
+
if (line <= 0) {
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
let currentLine = 0;
|
|
92
|
+
let index = 0;
|
|
93
|
+
const textLength = text.length;
|
|
94
|
+
while (index < textLength && currentLine < line) {
|
|
95
|
+
if (text.charCodeAt(index) === 10) {
|
|
96
|
+
currentLine += 1;
|
|
97
|
+
}
|
|
98
|
+
index += 1;
|
|
99
|
+
}
|
|
100
|
+
return index;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
findBestMatchNode(line) {
|
|
104
|
+
if (this.mappedNodes.length === 0) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
let bestNode = null;
|
|
108
|
+
let bestLine = -1;
|
|
109
|
+
for (let index = 0; index < this.mappedNodes.length; index += 1) {
|
|
110
|
+
const entry = this.mappedNodes[index];
|
|
111
|
+
if (entry.line > line) {
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
if (entry.line >= bestLine) {
|
|
115
|
+
bestLine = entry.line;
|
|
116
|
+
bestNode = entry.node;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (bestNode) {
|
|
120
|
+
return bestNode;
|
|
121
|
+
}
|
|
122
|
+
return this.mappedNodes[0].node;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
setActiveNode(node) {
|
|
126
|
+
if (this.activeNode && this.activeNode !== node) {
|
|
127
|
+
this.activeNode.classList.remove("bi-direction-jump__target--active");
|
|
128
|
+
}
|
|
129
|
+
this.activeNode = node;
|
|
130
|
+
if (this.activeNode) {
|
|
131
|
+
this.activeNode.classList.add("bi-direction-jump__target--active");
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
setHoverNode(node) {
|
|
136
|
+
if (this.hoverNode && this.hoverNode !== node) {
|
|
137
|
+
this.hoverNode.classList.remove("bi-direction-jump__target--hover");
|
|
138
|
+
}
|
|
139
|
+
this.hoverNode = node;
|
|
140
|
+
if (this.hoverNode) {
|
|
141
|
+
this.hoverNode.classList.add("bi-direction-jump__target--hover");
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
scrollEditorToLineIfNeeded(line) {
|
|
146
|
+
const lineHeight = Number.parseFloat(window.getComputedStyle(this.editor).lineHeight) || 22;
|
|
147
|
+
const targetTop = line * lineHeight;
|
|
148
|
+
const targetBottom = targetTop + lineHeight;
|
|
149
|
+
const viewportTop = this.editor.scrollTop;
|
|
150
|
+
const viewportBottom = viewportTop + this.editor.clientHeight;
|
|
151
|
+
if (targetTop >= viewportTop && targetBottom <= viewportBottom) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const shouldAlignTop = targetTop < viewportTop;
|
|
155
|
+
const nextTop = shouldAlignTop ? targetTop : targetBottom - this.editor.clientHeight;
|
|
156
|
+
const maxTop = Math.max(this.editor.scrollHeight - this.editor.clientHeight, 0);
|
|
157
|
+
this.editor.scrollTop = Math.min(Math.max(nextTop, 0), maxTop);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export { BiDirectionJump };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
Theme: Default
|
|
3
|
+
Version: 11.9.0
|
|
4
|
+
Description: Original highlight.js style
|
|
5
|
+
Author: (c) Ivan Sagalaev <maniac@softwaremaniacs.org>
|
|
6
|
+
Maintainer: @highlightjs/core-team
|
|
7
|
+
Website: https://highlightjs.org/
|
|
8
|
+
License: see project LICENSE
|
|
9
|
+
Touched: 2021
|
|
10
|
+
URL: https://cdn.jsdelivr.net/npm/highlight.js@11.9.0/styles/default.min.css
|
|
11
|
+
*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#f3f3f3;color:#444}.hljs-comment{color:#697070}.hljs-punctuation,.hljs-tag{color:#444a}.hljs-tag .hljs-attr,.hljs-tag .hljs-name{color:#444}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#800}.hljs-section,.hljs-title{color:#800;font-weight:700}.hljs-link,.hljs-operator,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#ab5656}.hljs-literal{color:#695}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta .hljs-string{color:#38a}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* 0.16.9 */
|
|
2
|
+
/* https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css */
|
|
3
|
+
|
|
4
|
+
@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(katex_fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(katex_fonts/KaTeX_AMS-Regular.woff) format("woff"),url(katex_fonts/KaTeX_AMS-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(katex_fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(katex_fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(katex_fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(katex_fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(katex_fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(katex_fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(katex_fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(katex_fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(katex_fonts/KaTeX_Fraktur-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(katex_fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(katex_fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(katex_fonts/KaTeX_Fraktur-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(katex_fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(katex_fonts/KaTeX_Main-Bold.woff) format("woff"),url(katex_fonts/KaTeX_Main-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(katex_fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(katex_fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(katex_fonts/KaTeX_Main-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(katex_fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(katex_fonts/KaTeX_Main-Italic.woff) format("woff"),url(katex_fonts/KaTeX_Main-Italic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(katex_fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(katex_fonts/KaTeX_Main-Regular.woff) format("woff"),url(katex_fonts/KaTeX_Main-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(katex_fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(katex_fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(katex_fonts/KaTeX_Math-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(katex_fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(katex_fonts/KaTeX_Math-Italic.woff) format("woff"),url(katex_fonts/KaTeX_Math-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(katex_fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(katex_fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(katex_fonts/KaTeX_SansSerif-Bold.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(katex_fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(katex_fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(katex_fonts/KaTeX_SansSerif-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(katex_fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(katex_fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(katex_fonts/KaTeX_SansSerif-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(katex_fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(katex_fonts/KaTeX_Script-Regular.woff) format("woff"),url(katex_fonts/KaTeX_Script-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(katex_fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(katex_fonts/KaTeX_Size1-Regular.woff) format("woff"),url(katex_fonts/KaTeX_Size1-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(katex_fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(katex_fonts/KaTeX_Size2-Regular.woff) format("woff"),url(katex_fonts/KaTeX_Size2-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(katex_fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(katex_fonts/KaTeX_Size3-Regular.woff) format("woff"),url(katex_fonts/KaTeX_Size3-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(katex_fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(katex_fonts/KaTeX_Size4-Regular.woff) format("woff"),url(katex_fonts/KaTeX_Size4-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(katex_fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(katex_fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(katex_fonts/KaTeX_Typewriter-Regular.ttf) format("truetype")}.katex{text-rendering:auto;font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.9"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}
|
|
5
|
+
|
|
6
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|