mirror of
https://github.com/jaywcjlove/wxmp.git
synced 2026-04-05 20:20:13 +08:00
Compare commits
11 Commits
renovate/r
...
fd4a7deed7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd4a7deed7 | ||
|
|
11ed1f3b2c | ||
|
|
5a67d0785d | ||
|
|
49bf21de71 | ||
|
|
15723a08c9 | ||
|
|
4fd4f3644d | ||
|
|
7969fb28a4 | ||
|
|
1955ec9cbd | ||
|
|
54e4188eb0 | ||
|
|
6fe79146d3 | ||
|
|
e7b52e0ebe |
7
.github/FUNDING.yml
vendored
7
.github/FUNDING.yml
vendored
@@ -1,3 +1,4 @@
|
|||||||
ko_fi: jaywcjlove
|
github: [jaywcjlove]
|
||||||
buy_me_a_coffee: jaywcjlove
|
#ko_fi: jaywcjlove
|
||||||
custom: ["https://www.paypal.me/kennyiseeyou", "https://jaywcjlove.github.io/#/sponsor"]
|
#buy_me_a_coffee: jaywcjlove
|
||||||
|
# custom: ["https://wangchujiang.com/#/sponsor"]
|
||||||
|
|||||||
85
.github/workflows/ci.yml
vendored
85
.github/workflows/ci.yml
vendored
@@ -8,10 +8,10 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 24
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
- run: npm install
|
- run: npm install
|
||||||
@@ -67,8 +67,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build]
|
needs: [build]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: webiste
|
name: webiste
|
||||||
path: website/build
|
path: website/build
|
||||||
@@ -78,26 +78,34 @@ jobs:
|
|||||||
- run: echo "outputs.create_tag_versionNumber - ${{ needs.build.outputs.create_tag_versionNumber }}"
|
- run: echo "outputs.create_tag_versionNumber - ${{ needs.build.outputs.create_tag_versionNumber }}"
|
||||||
- run: echo "outputs.tag - ${{ needs.build.outputs.tag }}"
|
- run: echo "outputs.tag - ${{ needs.build.outputs.tag }}"
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
# Create Docker Image
|
# Create Docker Image
|
||||||
- name: Docker login
|
- name: Docker login
|
||||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
|
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Build wxmp image
|
# - name: Build wxmp image
|
||||||
|
# working-directory: website
|
||||||
|
# run: docker image build -t wxmp .
|
||||||
|
|
||||||
|
- name: Build and push multi-platform image
|
||||||
working-directory: website
|
working-directory: website
|
||||||
run: docker image build -t wxmp .
|
|
||||||
|
|
||||||
- name: Tags & Push image (latest)
|
|
||||||
run: |
|
run: |
|
||||||
echo "outputs.tag - ${{ needs.build.outputs.version }}"
|
docker buildx build \
|
||||||
docker tag wxmp ${{ secrets.DOCKER_USER }}/wxmp:latest
|
--platform linux/amd64,linux/arm64 \
|
||||||
docker push ${{ secrets.DOCKER_USER }}/wxmp:latest
|
-t ${{ secrets.DOCKER_USER }}/wxmp:latest \
|
||||||
|
--push .
|
||||||
|
|
||||||
|
|
||||||
- name: Tags & Push image
|
- name: Build and push multi-platform image (with tag)
|
||||||
if: needs.build.outputs.successful
|
if: needs.build.outputs.successful
|
||||||
|
working-directory: website
|
||||||
run: |
|
run: |
|
||||||
echo "outputs.tag - ${{ needs.build.outputs.version }}"
|
docker buildx build \
|
||||||
docker tag wxmp ${{ secrets.DOCKER_USER }}/wxmp:${{needs.build.outputs.version}}
|
--platform linux/amd64,linux/arm64 \
|
||||||
docker push ${{ secrets.DOCKER_USER }}/wxmp:${{needs.build.outputs.version}}
|
-t ${{ secrets.DOCKER_USER }}/wxmp:${{ needs.build.outputs.version }} \
|
||||||
|
--push .
|
||||||
|
|
||||||
# # Create Docker Image in GitHub
|
# # Create Docker Image in GitHub
|
||||||
# - name: Login to GitHub registry
|
# - name: Login to GitHub registry
|
||||||
@@ -122,10 +130,11 @@ jobs:
|
|||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 24
|
||||||
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
- name: Install
|
- name: Install
|
||||||
run: npm install --build-from-source
|
run: npm install --build-from-source
|
||||||
@@ -134,7 +143,7 @@ jobs:
|
|||||||
- run: npm run build
|
- run: npm run build
|
||||||
# - run: npm run electron
|
# - run: npm run electron
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: webiste
|
name: webiste
|
||||||
path: website/build
|
path: website/build
|
||||||
@@ -159,16 +168,17 @@ jobs:
|
|||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 24
|
||||||
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: npm run hoist
|
- run: npm run hoist
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: webiste
|
name: webiste
|
||||||
path: website/build
|
path: website/build
|
||||||
@@ -193,16 +203,18 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 24
|
||||||
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: npm run hoist
|
- run: npm run hoist
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
# - run: npm run electron
|
# - run: npm run electron
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: webiste
|
name: webiste
|
||||||
path: website/build
|
path: website/build
|
||||||
@@ -215,7 +227,7 @@ jobs:
|
|||||||
- working-directory: electron/app/dist
|
- working-directory: electron/app/dist
|
||||||
run: ls -R
|
run: ls -R
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
if: needs.build.outputs.successful == 'true'
|
if: needs.build.outputs.successful == 'true'
|
||||||
with:
|
with:
|
||||||
name: wxmp-linux
|
name: wxmp-linux
|
||||||
@@ -230,22 +242,23 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 24
|
||||||
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: wxmp-linux
|
name: wxmp-linux
|
||||||
path: dist/linux
|
path: dist/linux
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: wxmp-macos
|
name: wxmp-macos
|
||||||
path: dist/macos
|
path: dist/macos
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: wxmp-windows
|
name: wxmp-windows
|
||||||
path: dist/windows
|
path: dist/windows
|
||||||
@@ -299,7 +312,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 4
|
timeout-minutes: 4
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.head_ref }}
|
ref: ${{ github.head_ref }}
|
||||||
|
|
||||||
|
|||||||
52
README.md
52
README.md
@@ -1,9 +1,51 @@
|
|||||||
|
<div markdown="1">
|
||||||
|
<sup>使用<a href="https://wangchujiang.com/#/app" target="_blank">我的应用</a>也是一种<a href="https://wangchujiang.com/#/sponsor" target="_blank">支持</a>我的方式:</sup>
|
||||||
|
<br>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6758053530" title="Scap: Screenshot & Markup Edit for macOS"><img alt="Scap: Screenshot & Markup Edit" height="52" width="52" src="https://wangchujiang.com/appicon/scap.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6757317079" title="Screen Test for macOS"><img alt="Screen Test" height="52" width="52" src="https://wangchujiang.com/appicon/screen-test.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/Deskmark/6755948110" title="Deskmark for macOS"><img alt="Deskmark" height="52" width="52" src="https://wangchujiang.com/appicon/deskmark.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/Keyzer/6500434773" title="Keyzer for macOS"><img alt="Keyzer" height="52" width="52" src="https://wangchujiang.com/appicon/keyzer.png"></a>
|
||||||
|
<a target="_blank" href="https://github.com/jaywcjlove/vidwall-hub" title="Vidwall Hub for macOS"><img alt="Vidwall Hub" height="52" width="52" src="https://wangchujiang.com/appicon/vidwall-hub.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/VidCrop/6752624705" title="VidCrop for macOS"><img alt="VidCrop" height="52" width="52" src="https://wangchujiang.com/appicon/vidcrop.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/Vidwall/6747587746" title="Vidwall for macOS"><img alt="Vidwall" height="52" width="52" src="https://wangchujiang.com/appicon/vidwall.png"></a>
|
||||||
|
<a target="_blank" href="https://wangchujiang.com/mousio-hint/" title="Mousio Hint for macOS"><img alt="Mousio Hint" height="52" width="52" src="https://wangchujiang.com/appicon/mousio-hint.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6746747327" title="Mousio for macOS"><img alt="Mousio" height="52" width="52" src="https://wangchujiang.com/appicon/mousio.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6745227444" title="Musicer for macOS"><img alt="Musicer" height="52" width="52" src="https://wangchujiang.com/appicon/musicer.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6743841447" title="Audioer for macOS"><img alt="Audioer" height="52" width="52" src="https://wangchujiang.com/appicon/audioer.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6744690194" title="FileSentinel for macOS"><img alt="FileSentinel" height="52" width="52" src="https://wangchujiang.com/appicon/file-sentinel.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6743495172" title="FocusCursor for macOS"><img alt="FocusCursor" height="52" width="52" src="https://wangchujiang.com/appicon/focus-cursor.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6742680573" title="Videoer for macOS"><img alt="Videoer" height="52" width="52" src="https://wangchujiang.com/appicon/videoer.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6740425504" title="KeyClicker for macOS"><img alt="KeyClicker" height="52" width="52" src="https://wangchujiang.com/appicon/key-clicker.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6739052447" title="DayBar for macOS"><img alt="DayBar" height="52" width="52" src="https://wangchujiang.com/appicon/daybar.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6739444407" title="Iconed for macOS"><img alt="Iconed" height="52" width="52" src="https://wangchujiang.com/appicon/iconed.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6737160756" title="Mousio for macOS"><img alt="Mousio" height="52" width="52" src="https://wangchujiang.com/appicon/rightmenu-master.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6723903021" title="Paste Quick for macOS"><img alt="Quick RSS" height="52" width="52" src="https://wangchujiang.com/appicon/paste-quick.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6670696072" title="Quick RSS for macOS/iOS"><img alt="Quick RSS" height="52" width="52" src="https://wangchujiang.com/appicon/quick-rss.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6670167443" title="Web Serve for macOS"><img alt="Web Serve" height="52" width="52" src="https://wangchujiang.com/appicon/web-serve.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6503953628" title="Copybook Generator for macOS/iOS"><img alt="Copybook Generator" height="52" width="52" src="https://wangchujiang.com/appicon/copybook-generator.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6471227008" title="DevTutor for macOS/iOS"><img alt="DevTutor for SwiftUI" height="52" width="52" src="https://wangchujiang.com/appicon/devtutor.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6479819388" title="RegexMate for macOS/iOS"><img alt="RegexMate" height="52" width="52" src="https://wangchujiang.com/appicon/regex-mate.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6479194014" title="Time Passage for macOS/iOS"><img alt="Time Passage" height="52" width="52" src="https://wangchujiang.com/appicon/time-passage.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6478772538" title="IconizeFolder for macOS"><img alt="Iconize Folder" height="52" width="52" src="https://wangchujiang.com/appicon/iconize-folder.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6478511402" title="Textsound Saver for macOS/iOS"><img alt="Textsound Saver" height="52" width="52" src="https://wangchujiang.com/appicon/textsound-saver.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6476924627" title="Create Custom Symbols for macOS"><img alt="Create Custom Symbols" height="52" width="52" src="https://wangchujiang.com/appicon/create-custom-symbols.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6476452351" title="DevHub for macOS"><img alt="DevHub" height="52" width="52" src="https://wangchujiang.com/appicon/devhub.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6476400184" title="Resume Revise for macOS"><img alt="Resume Revise" height="52" width="52" src="https://wangchujiang.com/appicon/resume-revise.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6472593276" title="Palette Genius for macOS"><img alt="Palette Genius" height="52" width="52" src="https://wangchujiang.com/appicon/palette-genius.png"></a>
|
||||||
|
<a target="_blank" href="https://apps.apple.com/app/6470879005" title="Symbol Scribe for macOS"><img alt="Symbol Scribe" height="52" width="52" src="https://wangchujiang.com/appicon/symbol-scribe.png"></a>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<h1 align="center">微信公众号 Markdown 编辑器</h1>
|
<h1 align="center">微信公众号 Markdown 编辑器</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
[](https://jaywcjlove.github.io/#/sponsor)
|
[](https://jaywcjlove.github.io/#/sponsor)
|
||||||
|
[](https://x.com/jaywcjlove)
|
||||||
[](https://github.com/jaywcjlove/wxmp/actions/workflows/ci.yml)
|
[](https://github.com/jaywcjlove/wxmp/actions/workflows/ci.yml)
|
||||||
|
[](https://hub.docker.com/r/wcjiang/wxmp)
|
||||||
|
[](https://hub.docker.com/r/wcjiang/wxmp)
|
||||||
|
[](https://hub.docker.com/r/wcjiang/wxmp)
|
||||||
|
|
||||||
[](https://jaywcjlove.github.io/wxmp)
|
[](https://jaywcjlove.github.io/wxmp)
|
||||||
|
|
||||||
@@ -26,6 +68,14 @@
|
|||||||
- [x] CI 自动生成 Electron 桌面应用。
|
- [x] CI 自动生成 Electron 桌面应用。
|
||||||
- [ ] ~~支持全局字号大小选择。~~
|
- [ ] ~~支持全局字号大小选择。~~
|
||||||
|
|
||||||
|
### 数学公式
|
||||||
|
|
||||||
|
$\\c = \pm\sqrt{a^2 + b^2}$ 和 $C_L$ 数学公式行内显示
|
||||||
|
|
||||||
|
```math
|
||||||
|
L = \frac{1}{2} \rho v^2 S C_L
|
||||||
|
```
|
||||||
|
|
||||||
### 支持代码块样式
|
### 支持代码块样式
|
||||||
|
|
||||||
下面是 `jsx` 代码块展示示例,并高亮代码,用于 web 应用中效果展示。
|
下面是 `jsx` 代码块展示示例,并高亮代码,用于 web 应用中效果展示。
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "wxmp",
|
"name": "wxmp",
|
||||||
"description": "微信公众号 Markdown 编辑器",
|
"description": "微信公众号 Markdown 编辑器",
|
||||||
"homepage": "https://github.com/jaywcjlove/wxmp.git",
|
"homepage": "https://github.com/jaywcjlove/wxmp.git",
|
||||||
"version": "2.4.0",
|
"version": "2.4.1",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"author": "Kenny Wong <398188662@qq.com>",
|
"author": "Kenny Wong <398188662@qq.com>",
|
||||||
"private": true,
|
"private": true,
|
||||||
@@ -18,13 +18,13 @@
|
|||||||
"build": "npm run copy && cross-env NODE_ENV=production electron-builder build --publish=never --config config.json"
|
"build": "npm run copy && cross-env NODE_ENV=production electron-builder build --publish=never --config config.json"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wcj/wxmp-main": "2.4.0"
|
"@wcj/wxmp-main": "2.4.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@wcj/wxmp-preload": "2.4.0",
|
"@wcj/wxmp-preload": "2.4.1",
|
||||||
"cpy-cli": "^5.0.0",
|
"cpy-cli": "^5.0.0",
|
||||||
"electron": "20.1.3",
|
"electron": "20.1.3",
|
||||||
"electron-builder": "23.3.3",
|
"electron-builder": "23.3.3",
|
||||||
"website": "2.4.0"
|
"website": "2.4.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wcj/wxmp-main",
|
"name": "@wcj/wxmp-main",
|
||||||
"version": "2.4.0",
|
"version": "2.4.1",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wcj/wxmp-preload",
|
"name": "@wcj/wxmp-preload",
|
||||||
"version": "2.4.0",
|
"version": "2.4.1",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"version": "2.4.0",
|
"version": "2.4.1",
|
||||||
"packages": ["website", "electron/*"]
|
"packages": ["website", "electron/*"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "website",
|
"name": "website",
|
||||||
"version": "2.4.0",
|
"version": "2.4.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "kkt start",
|
"start": "kkt start",
|
||||||
@@ -34,10 +34,12 @@
|
|||||||
"react-router-dom": "^6.3.0",
|
"react-router-dom": "^6.3.0",
|
||||||
"rehype-attr": "^3.0.0",
|
"rehype-attr": "^3.0.0",
|
||||||
"rehype-ignore": "^2.0.0",
|
"rehype-ignore": "^2.0.0",
|
||||||
|
"rehype-katex": "^7.0.1",
|
||||||
"rehype-prism-plus": "^2.0.0",
|
"rehype-prism-plus": "^2.0.0",
|
||||||
"rehype-raw": "^7.0.0",
|
"rehype-raw": "^7.0.0",
|
||||||
"rehype-stringify": "^10.0.0",
|
"rehype-stringify": "^10.0.0",
|
||||||
"remark-gfm": "^4.0.0",
|
"remark-gfm": "^4.0.0",
|
||||||
|
"remark-math": "^6.0.0",
|
||||||
"remark-parse": "^11.0.0",
|
"remark-parse": "^11.0.0",
|
||||||
"remark-rehype": "^11.0.0",
|
"remark-rehype": "^11.0.0",
|
||||||
"styled-components": "~6.1.0",
|
"styled-components": "~6.1.0",
|
||||||
|
|||||||
@@ -5,7 +5,10 @@ import { Element } from 'hast';
|
|||||||
import remarkParse from 'remark-parse';
|
import remarkParse from 'remark-parse';
|
||||||
import remarkGfm from 'remark-gfm';
|
import remarkGfm from 'remark-gfm';
|
||||||
import remarkRehype from 'remark-rehype';
|
import remarkRehype from 'remark-rehype';
|
||||||
|
import remarkMath from 'remark-math';
|
||||||
import rehypePrism from 'rehype-prism-plus';
|
import rehypePrism from 'rehype-prism-plus';
|
||||||
|
import rehypeKatex from 'rehype-katex';
|
||||||
|
import 'katex/dist/katex.min.css'; // Ensure KaTeX styles are included
|
||||||
import rehypeRaw from 'rehype-raw';
|
import rehypeRaw from 'rehype-raw';
|
||||||
import rehypeAttrs from 'rehype-attr';
|
import rehypeAttrs from 'rehype-attr';
|
||||||
import rehypeIgnore from 'rehype-ignore';
|
import rehypeIgnore from 'rehype-ignore';
|
||||||
@@ -32,8 +35,10 @@ export function markdownToHTML(md: string, css: string, opts: MarkdownToHTMLOpti
|
|||||||
const processor = unified()
|
const processor = unified()
|
||||||
.use(remarkParse)
|
.use(remarkParse)
|
||||||
.use(remarkGfm)
|
.use(remarkGfm)
|
||||||
|
.use(remarkMath)
|
||||||
.use(remarkRehype, { allowDangerousHtml: true })
|
.use(remarkRehype, { allowDangerousHtml: true })
|
||||||
.use(rehypeRaw)
|
.use(rehypeRaw)
|
||||||
|
.use(rehypeKatex)
|
||||||
.use(rehypePrism, {
|
.use(rehypePrism, {
|
||||||
ignoreMissing: true,
|
ignoreMissing: true,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user