regen.mde 0.2.2 → 0.7.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/README.md +409 -295
- package/bin/build-corpus-editor.js +5 -3
- package/bin/postinstall.js +259 -187
- package/bin/regen-mdeditor-install.js +1 -1
- package/bin/regen-mdeditor-uninstall.js +1 -1
- package/desktop/BuildCorpusEditor/BuildCorpusBridge.cs +493 -270
- package/desktop/BuildCorpusEditor/EditorForm.cs +853 -540
- package/desktop/BuildCorpusEditor/Program.cs +85 -81
- package/dist/release/regen-mde-0.3.0-win-x64-setup.exe +0 -0
- package/dist/release/{regen.mde-0.2.2-win-x64.zip → regen-mde-0.3.0-win-x64.zip} +0 -0
- package/dist/release/regen-mde-0.7.0-win-x64-setup.exe +0 -0
- package/dist/release/regen-mde-0.7.0-win-x64.zip +0 -0
- package/dist/windows-editor/BuildCorpusEditor.dll +0 -0
- package/dist/windows-editor/BuildCorpusEditor.exe +0 -0
- package/dist/windows-editor/BuildCorpusEditor.pdb +0 -0
- package/dist/windows-editor/wwwroot/assets/index-C_VxJk4k.js +375 -0
- package/dist/windows-editor/wwwroot/assets/index-Wt9zSjIw.css +1 -0
- package/dist/windows-editor/wwwroot/index.html +3 -3
- package/editor-web/index.html +1 -1
- package/editor-web/src/main.jsx +1044 -399
- package/editor-web/src/styles.css +846 -602
- package/installer/install-regen-mde.ps1 +49 -10
- package/installer/regen-mde.nsi +16 -16
- package/package.json +90 -86
- package/pyproject.toml +35 -33
- package/requirements.txt +6 -4
- package/scripts/package-windows-editor.ps1 +8 -8
- package/scripts/release-dual.mjs +105 -0
- package/scripts/run-editor-implementation-plane.ps1 +29 -6
- package/src/build_corpus/docx_exporter.py +1055 -798
- package/src/build_corpus/equations.py +80 -0
- package/src/build_corpus/exporter.py +1488 -1195
- package/src/build_corpus/frontmatter.py +302 -0
- package/src/build_corpus/ppt_exporter.py +543 -532
- package/dist/release/regen.mde-0.2.2-win-x64-setup.exe +0 -0
- package/dist/windows-editor/wwwroot/assets/index-DjJ6xmhy.js +0 -326
- package/dist/windows-editor/wwwroot/assets/index-_dwMNNsm.css +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[CmdletBinding()]
|
|
2
2
|
param(
|
|
3
3
|
[string]$PackageRoot = "",
|
|
4
|
-
[string]$InstallDir = "$env:LOCALAPPDATA\Programs\regen
|
|
4
|
+
[string]$InstallDir = "$env:LOCALAPPDATA\Programs\regen-mde"
|
|
5
5
|
)
|
|
6
6
|
|
|
7
7
|
$ErrorActionPreference = "Stop"
|
|
@@ -15,7 +15,7 @@ if ([string]::IsNullOrWhiteSpace($PackageRoot)) {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
$ProductName = "regen
|
|
18
|
+
$ProductName = "regen-mde"
|
|
19
19
|
$LegacyProductNames = @("Manuscript Forge", "Regen.MDeditor")
|
|
20
20
|
$AppSource = if (Test-Path -LiteralPath (Join-Path $PackageRoot "BuildCorpusEditor.exe")) {
|
|
21
21
|
$PackageRoot
|
|
@@ -48,11 +48,12 @@ foreach ($legacyProductName in $LegacyProductNames) {
|
|
|
48
48
|
}
|
|
49
49
|
Remove-Item -LiteralPath $ShortcutPath -Force -ErrorAction SilentlyContinue
|
|
50
50
|
Remove-Item -LiteralPath $UninstallShortcutPath -Force -ErrorAction SilentlyContinue
|
|
51
|
-
foreach ($ext in @(".md", ".docx")) {
|
|
52
|
-
foreach ($verb in @("ManuscriptForgeOpen", "BuildCorpusOpenEditor", "RegenMDEditorOpen")) {
|
|
51
|
+
foreach ($ext in @(".md", ".docx", ".pptx", ".ppt")) {
|
|
52
|
+
foreach ($verb in @("ManuscriptForgeOpen", "BuildCorpusOpenEditor", "RegenMDEditorOpen", "BuildCorpusToMarkdown", "BuildCorpusToWord", "BuildCorpusInlineImages")) {
|
|
53
53
|
Remove-FileVerb -Extension $ext -Verb $verb
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
+
Remove-Item -LiteralPath "Registry::HKEY_CURRENT_USER\Software\Classes\Directory\shell\BuildCorpusFolderToMarkdown" -Recurse -Force -ErrorAction SilentlyContinue
|
|
56
57
|
if ((Test-Path -LiteralPath $LegacyInstallDir) -and ($LegacyInstallDir -ne $InstallDir)) {
|
|
57
58
|
Remove-Item -LiteralPath $LegacyInstallDir -Recurse -Force -ErrorAction SilentlyContinue
|
|
58
59
|
}
|
|
@@ -61,11 +62,19 @@ if ((Test-Path -LiteralPath $LegacyInstallDir2) -and ($LegacyInstallDir2 -ne $In
|
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null
|
|
65
|
+
foreach ($item in @("wwwroot", "runtimes")) {
|
|
66
|
+
Remove-Item -LiteralPath (Join-Path $InstallDir $item) -Recurse -Force -ErrorAction SilentlyContinue
|
|
67
|
+
}
|
|
68
|
+
foreach ($pattern in @("BuildCorpusEditor.*", "Microsoft.Web.WebView2.*", "WebView2Loader.dll")) {
|
|
69
|
+
Get-ChildItem -LiteralPath $InstallDir -Filter $pattern -ErrorAction SilentlyContinue | Remove-Item -Force -ErrorAction SilentlyContinue
|
|
70
|
+
}
|
|
64
71
|
Copy-Item -Path (Join-Path $AppSource "*") -Destination $InstallDir -Recurse -Force
|
|
65
72
|
foreach ($item in @("bin", "src")) {
|
|
66
73
|
$sourcePath = Join-Path $PackageRoot $item
|
|
67
74
|
if (Test-Path -LiteralPath $sourcePath) {
|
|
68
|
-
|
|
75
|
+
$destinationPath = Join-Path $InstallDir $item
|
|
76
|
+
Remove-Item -LiteralPath $destinationPath -Recurse -Force -ErrorAction SilentlyContinue
|
|
77
|
+
Copy-Item -LiteralPath $sourcePath -Destination $InstallDir -Recurse -Force
|
|
69
78
|
}
|
|
70
79
|
}
|
|
71
80
|
foreach ($item in @("requirements.txt", "pyproject.toml", "package.json", "package-lock.json")) {
|
|
@@ -81,6 +90,7 @@ $UninstallScript = Join-Path $InstallDir "uninstall-regen-mde.ps1"
|
|
|
81
90
|
if (-not (Get-Command node -ErrorAction SilentlyContinue)) {
|
|
82
91
|
throw "Node.js is required on PATH for DOCX/Markdown conversion."
|
|
83
92
|
}
|
|
93
|
+
$NodeExe = (Get-Command node -ErrorAction Stop).Source
|
|
84
94
|
|
|
85
95
|
$requirements = Join-Path $InstallDir "requirements.txt"
|
|
86
96
|
$pythonReady = $false
|
|
@@ -129,12 +139,39 @@ function Set-FileVerb {
|
|
|
129
139
|
[Microsoft.Win32.RegistryValueKind]::String)
|
|
130
140
|
}
|
|
131
141
|
|
|
132
|
-
Set-
|
|
133
|
-
|
|
142
|
+
function Set-FolderVerb {
|
|
143
|
+
param(
|
|
144
|
+
[string]$Verb,
|
|
145
|
+
[string]$Label,
|
|
146
|
+
[string]$Command
|
|
147
|
+
)
|
|
148
|
+
$key = "Registry::HKEY_CURRENT_USER\Software\Classes\Directory\shell\$Verb"
|
|
149
|
+
$commandKey = Join-Path $key "command"
|
|
150
|
+
New-Item -Path $commandKey -Force | Out-Null
|
|
151
|
+
New-ItemProperty -Path $key -Name "MUIVerb" -Value $Label -PropertyType String -Force | Out-Null
|
|
152
|
+
New-ItemProperty -Path $key -Name "Icon" -Value $InstalledExe -PropertyType ExpandString -Force | Out-Null
|
|
153
|
+
[Microsoft.Win32.Registry]::SetValue(
|
|
154
|
+
"HKEY_CURRENT_USER\Software\Classes\Directory\shell\$Verb\command",
|
|
155
|
+
"",
|
|
156
|
+
$Command,
|
|
157
|
+
[Microsoft.Win32.RegistryValueKind]::String)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
Set-FileVerb -Extension ".md" -Verb "RegenMDEditorOpen" -Label "Open in regen-mde" -Command "`"$InstalledExe`" `"%1`""
|
|
161
|
+
Set-FileVerb -Extension ".docx" -Verb "RegenMDEditorOpen" -Label "Open in regen-mde" -Command "`"$InstalledExe`" `"%1`""
|
|
162
|
+
Set-FileVerb -Extension ".docx" -Verb "BuildCorpusToMarkdown" -Label "Convert to Markdown" -Command "`"$NodeExe`" `"$InstallDir\bin\build-corpus.js`" `"%1`" --out-same-dir"
|
|
163
|
+
Set-FileVerb -Extension ".pptx" -Verb "BuildCorpusToMarkdown" -Label "Convert to Markdown" -Command "`"$NodeExe`" `"$InstallDir\bin\build-corpus.js`" `"%1`" --out-same-dir"
|
|
164
|
+
Set-FileVerb -Extension ".ppt" -Verb "BuildCorpusToMarkdown" -Label "Convert to Markdown" -Command "`"$NodeExe`" `"$InstallDir\bin\build-corpus.js`" `"%1`" --out-same-dir"
|
|
165
|
+
Set-FileVerb -Extension ".md" -Verb "BuildCorpusToWord" -Label "Convert to Word" -Command "`"$NodeExe`" `"$InstallDir\bin\build-corpus.js`" `"%1`" --to word --out-same-dir"
|
|
166
|
+
Set-FileVerb -Extension ".md" -Verb "BuildCorpusInlineImages" -Label "Inline Markdown Images" -Command "`"$NodeExe`" `"$InstallDir\bin\build-corpus.js`" `"%1`" --inline-images"
|
|
167
|
+
Set-FolderVerb -Verb "BuildCorpusFolderToMarkdown" -Label "Convert Documents to Markdown" -Command "`"$NodeExe`" `"$InstallDir\bin\build-corpus.js`" `"%V`" --out-same-dir"
|
|
168
|
+
New-Item -Path "Registry::HKEY_CURRENT_USER\Software\Classes\.md\ShellNew" -Force | Out-Null
|
|
169
|
+
New-ItemProperty -Path "Registry::HKEY_CURRENT_USER\Software\Classes\.md" -Name "Content Type" -Value "text/markdown" -PropertyType String -Force | Out-Null
|
|
170
|
+
New-ItemProperty -Path "Registry::HKEY_CURRENT_USER\Software\Classes\.md\ShellNew" -Name "NullFile" -Value "" -PropertyType String -Force | Out-Null
|
|
134
171
|
|
|
135
172
|
$uninstall = @"
|
|
136
173
|
`$ErrorActionPreference = "Stop"
|
|
137
|
-
`$ProductName = "regen
|
|
174
|
+
`$ProductName = "regen-mde"
|
|
138
175
|
`$InstallDir = Split-Path -Parent `$MyInvocation.MyCommand.Path
|
|
139
176
|
`$StartMenuDir = Join-Path `$env:APPDATA "Microsoft\Windows\Start Menu\Programs\LIFE AI"
|
|
140
177
|
Get-Process BuildCorpusEditor -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
|
|
@@ -143,11 +180,13 @@ Remove-Item -LiteralPath (Join-Path `$StartMenuDir "Uninstall `$ProductName.lnk"
|
|
|
143
180
|
Remove-Item -LiteralPath (Join-Path `$StartMenuDir "Regen.MDeditor.lnk") -Force -ErrorAction SilentlyContinue
|
|
144
181
|
Remove-Item -LiteralPath (Join-Path `$StartMenuDir "Manuscript Forge.lnk") -Force -ErrorAction SilentlyContinue
|
|
145
182
|
Remove-Item -LiteralPath (Join-Path `$StartMenuDir "Uninstall Regen.MDeditor.lnk") -Force -ErrorAction SilentlyContinue
|
|
146
|
-
foreach (`$ext in @(".md", ".docx")) {
|
|
147
|
-
foreach (`$verb in @("RegenMDEditorOpen", "ManuscriptForgeOpen", "BuildCorpusOpenEditor")) {
|
|
183
|
+
foreach (`$ext in @(".md", ".docx", ".pptx", ".ppt")) {
|
|
184
|
+
foreach (`$verb in @("RegenMDEditorOpen", "BuildCorpusToMarkdown", "BuildCorpusToWord", "BuildCorpusInlineImages", "ManuscriptForgeOpen", "BuildCorpusOpenEditor")) {
|
|
148
185
|
Remove-Item -LiteralPath "Registry::HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\`$ext\shell\`$verb" -Recurse -Force -ErrorAction SilentlyContinue
|
|
149
186
|
}
|
|
150
187
|
}
|
|
188
|
+
Remove-Item -LiteralPath "Registry::HKEY_CURRENT_USER\Software\Classes\Directory\shell\BuildCorpusFolderToMarkdown" -Recurse -Force -ErrorAction SilentlyContinue
|
|
189
|
+
Remove-Item -LiteralPath "Registry::HKEY_CURRENT_USER\Software\Classes\.md\ShellNew" -Recurse -Force -ErrorAction SilentlyContinue
|
|
151
190
|
for (`$i = 0; `$i -lt 10; `$i++) {
|
|
152
191
|
Start-Sleep -Milliseconds 250
|
|
153
192
|
try {
|
package/installer/regen-mde.nsi
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
!error "APP_SOURCE must point to the staged app directory"
|
|
6
6
|
!endif
|
|
7
7
|
!ifndef OUT_FILE
|
|
8
|
-
!define OUT_FILE "regen
|
|
8
|
+
!define OUT_FILE "regen-mde-${VERSION}-win-x64-setup.exe"
|
|
9
9
|
!endif
|
|
10
10
|
|
|
11
11
|
Unicode true
|
|
12
|
-
Name "regen
|
|
12
|
+
Name "regen-mde"
|
|
13
13
|
OutFile "${OUT_FILE}"
|
|
14
|
-
InstallDir "$LOCALAPPDATA\Programs\regen
|
|
14
|
+
InstallDir "$LOCALAPPDATA\Programs\regen-mde"
|
|
15
15
|
RequestExecutionLevel user
|
|
16
16
|
SetCompressor /SOLID lzma
|
|
17
17
|
|
|
@@ -44,29 +44,29 @@ Section "Install"
|
|
|
44
44
|
|
|
45
45
|
WriteUninstaller "$INSTDIR\uninstall.exe"
|
|
46
46
|
CreateDirectory "$StartMenuDir"
|
|
47
|
-
CreateShortcut "$StartMenuDir\regen
|
|
48
|
-
CreateShortcut "$StartMenuDir\Uninstall regen
|
|
47
|
+
CreateShortcut "$StartMenuDir\regen-mde.lnk" "$INSTDIR\BuildCorpusEditor.exe" "" "$INSTDIR\BuildCorpusEditor.exe" 0
|
|
48
|
+
CreateShortcut "$StartMenuDir\Uninstall regen-mde.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\BuildCorpusEditor.exe" 0
|
|
49
49
|
|
|
50
|
-
WriteRegStr HKCU "Software\Classes\SystemFileAssociations\.md\shell\RegenMDEditorOpen" "MUIVerb" "Open in regen
|
|
50
|
+
WriteRegStr HKCU "Software\Classes\SystemFileAssociations\.md\shell\RegenMDEditorOpen" "MUIVerb" "Open in regen-mde"
|
|
51
51
|
WriteRegStr HKCU "Software\Classes\SystemFileAssociations\.md\shell\RegenMDEditorOpen" "Icon" "$INSTDIR\BuildCorpusEditor.exe"
|
|
52
52
|
WriteRegStr HKCU "Software\Classes\SystemFileAssociations\.md\shell\RegenMDEditorOpen\command" "" '"$INSTDIR\BuildCorpusEditor.exe" "%1"'
|
|
53
53
|
|
|
54
|
-
WriteRegStr HKCU "Software\Classes\SystemFileAssociations\.docx\shell\RegenMDEditorOpen" "MUIVerb" "Open in regen
|
|
54
|
+
WriteRegStr HKCU "Software\Classes\SystemFileAssociations\.docx\shell\RegenMDEditorOpen" "MUIVerb" "Open in regen-mde"
|
|
55
55
|
WriteRegStr HKCU "Software\Classes\SystemFileAssociations\.docx\shell\RegenMDEditorOpen" "Icon" "$INSTDIR\BuildCorpusEditor.exe"
|
|
56
56
|
WriteRegStr HKCU "Software\Classes\SystemFileAssociations\.docx\shell\RegenMDEditorOpen\command" "" '"$INSTDIR\BuildCorpusEditor.exe" "%1"'
|
|
57
57
|
|
|
58
|
-
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\regen
|
|
59
|
-
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\regen
|
|
60
|
-
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\regen
|
|
61
|
-
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\regen
|
|
62
|
-
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\regen
|
|
63
|
-
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\regen
|
|
58
|
+
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\regen-mde" "DisplayName" "regen-mde"
|
|
59
|
+
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\regen-mde" "DisplayVersion" "${VERSION}"
|
|
60
|
+
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\regen-mde" "Publisher" "LIFE AI"
|
|
61
|
+
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\regen-mde" "InstallLocation" "$INSTDIR"
|
|
62
|
+
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\regen-mde" "DisplayIcon" "$INSTDIR\BuildCorpusEditor.exe"
|
|
63
|
+
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\regen-mde" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
|
64
64
|
SectionEnd
|
|
65
65
|
|
|
66
66
|
Section "Uninstall"
|
|
67
67
|
SetShellVarContext current
|
|
68
|
-
Delete "$SMPROGRAMS\LIFE AI\regen
|
|
69
|
-
Delete "$SMPROGRAMS\LIFE AI\Uninstall regen
|
|
68
|
+
Delete "$SMPROGRAMS\LIFE AI\regen-mde.lnk"
|
|
69
|
+
Delete "$SMPROGRAMS\LIFE AI\Uninstall regen-mde.lnk"
|
|
70
70
|
RMDir "$SMPROGRAMS\LIFE AI"
|
|
71
71
|
|
|
72
72
|
DeleteRegKey HKCU "Software\Classes\SystemFileAssociations\.md\shell\RegenMDEditorOpen"
|
|
@@ -75,7 +75,7 @@ Section "Uninstall"
|
|
|
75
75
|
DeleteRegKey HKCU "Software\Classes\SystemFileAssociations\.docx\shell\ManuscriptForgeOpen"
|
|
76
76
|
DeleteRegKey HKCU "Software\Classes\SystemFileAssociations\.md\shell\BuildCorpusOpenEditor"
|
|
77
77
|
DeleteRegKey HKCU "Software\Classes\SystemFileAssociations\.docx\shell\BuildCorpusOpenEditor"
|
|
78
|
-
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\regen
|
|
78
|
+
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\regen-mde"
|
|
79
79
|
|
|
80
80
|
RMDir /r "$INSTDIR"
|
|
81
81
|
SectionEnd
|
package/package.json
CHANGED
|
@@ -1,86 +1,90 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "regen.mde",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Convert DOCX
|
|
5
|
-
"bin": {
|
|
6
|
-
"build-corpus": "bin/build-corpus.js",
|
|
7
|
-
"build-corpus-editor": "bin/build-corpus-editor.js",
|
|
8
|
-
"
|
|
9
|
-
"regen
|
|
10
|
-
"regen-mdeditor": "bin/build-corpus-editor.js",
|
|
11
|
-
"regen-mdeditor-install": "bin/regen-mdeditor-install.js",
|
|
12
|
-
"regen-mdeditor-uninstall": "bin/regen-mdeditor-uninstall.js",
|
|
13
|
-
"build-corpus-katex": "bin/validate-katex.js"
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"bin/",
|
|
17
|
-
"desktop/BuildCorpusEditor/*.cs",
|
|
18
|
-
"desktop/BuildCorpusEditor/*.csproj",
|
|
19
|
-
"desktop/BuildCorpusEditor/*.manifest",
|
|
20
|
-
"dist/release/regen
|
|
21
|
-
"dist/release/regen
|
|
22
|
-
"dist/windows-editor/",
|
|
23
|
-
"editor-web/",
|
|
24
|
-
"installer/",
|
|
25
|
-
"src/build_corpus/*.py",
|
|
26
|
-
"src/build_corpus/templates/*.py",
|
|
27
|
-
"src/build_corpus/templates/*.dotx",
|
|
28
|
-
"examples/",
|
|
29
|
-
"scripts/",
|
|
30
|
-
"tools/*.py",
|
|
31
|
-
"pyproject.toml",
|
|
32
|
-
"requirements.txt",
|
|
33
|
-
"README.md",
|
|
34
|
-
"LICENSE"
|
|
35
|
-
],
|
|
36
|
-
"scripts": {
|
|
37
|
-
"editor:build": "vite build --config editor-web/vite.config.js",
|
|
38
|
-
"editor:windows": "powershell.exe -ExecutionPolicy Bypass -File scripts/build-windows-editor.ps1",
|
|
39
|
-
"editor:package": "powershell.exe -ExecutionPolicy Bypass -File scripts/package-windows-editor.ps1",
|
|
40
|
-
"test:conversion": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/run-required-tests.ps1 -Suite Conversion",
|
|
41
|
-
"test:editor": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/run-required-tests.ps1 -Suite Editor",
|
|
42
|
-
"test:required": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/run-required-tests.ps1 -Suite Auto",
|
|
43
|
-
"test:all": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/run-required-tests.ps1 -Suite All",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@tiptap/extension-
|
|
54
|
-
"@tiptap/extension-
|
|
55
|
-
"@tiptap/extension-
|
|
56
|
-
"@tiptap/extension-
|
|
57
|
-
"@tiptap/extension-
|
|
58
|
-
"@tiptap/extension-table
|
|
59
|
-
"@tiptap/extension-
|
|
60
|
-
"@tiptap/extension-
|
|
61
|
-
"@tiptap/
|
|
62
|
-
"@tiptap/
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"react-
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
}
|
|
86
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "regen.mde",
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "Convert between DOCX/PPTX and Markdown — Word OMML equations to KaTeX TeX on the way in, LaTeX to native OMML on the way out.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"build-corpus": "bin/build-corpus.js",
|
|
7
|
+
"build-corpus-editor": "bin/build-corpus-editor.js",
|
|
8
|
+
"mdeditor": "bin/build-corpus-editor.js",
|
|
9
|
+
"regen-mde": "bin/build-corpus-editor.js",
|
|
10
|
+
"regen-mdeditor": "bin/build-corpus-editor.js",
|
|
11
|
+
"regen-mdeditor-install": "bin/regen-mdeditor-install.js",
|
|
12
|
+
"regen-mdeditor-uninstall": "bin/regen-mdeditor-uninstall.js",
|
|
13
|
+
"build-corpus-katex": "bin/validate-katex.js"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"bin/",
|
|
17
|
+
"desktop/BuildCorpusEditor/*.cs",
|
|
18
|
+
"desktop/BuildCorpusEditor/*.csproj",
|
|
19
|
+
"desktop/BuildCorpusEditor/*.manifest",
|
|
20
|
+
"dist/release/regen-mde-*-win-x64-setup.exe",
|
|
21
|
+
"dist/release/regen-mde-*-win-x64.zip",
|
|
22
|
+
"dist/windows-editor/",
|
|
23
|
+
"editor-web/",
|
|
24
|
+
"installer/",
|
|
25
|
+
"src/build_corpus/*.py",
|
|
26
|
+
"src/build_corpus/templates/*.py",
|
|
27
|
+
"src/build_corpus/templates/*.dotx",
|
|
28
|
+
"examples/",
|
|
29
|
+
"scripts/",
|
|
30
|
+
"tools/*.py",
|
|
31
|
+
"pyproject.toml",
|
|
32
|
+
"requirements.txt",
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"editor:build": "vite build --config editor-web/vite.config.js",
|
|
38
|
+
"editor:windows": "powershell.exe -ExecutionPolicy Bypass -File scripts/build-windows-editor.ps1",
|
|
39
|
+
"editor:package": "powershell.exe -ExecutionPolicy Bypass -File scripts/package-windows-editor.ps1",
|
|
40
|
+
"test:conversion": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/run-required-tests.ps1 -Suite Conversion",
|
|
41
|
+
"test:editor": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/run-required-tests.ps1 -Suite Editor",
|
|
42
|
+
"test:required": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/run-required-tests.ps1 -Suite Auto",
|
|
43
|
+
"test:all": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/run-required-tests.ps1 -Suite All",
|
|
44
|
+
"release": "node scripts/release-dual.mjs",
|
|
45
|
+
"prepack": "npm run editor:windows && npm run editor:package",
|
|
46
|
+
"postinstall": "node bin/postinstall.js",
|
|
47
|
+
"preuninstall": "node bin/postinstall.js --uninstall",
|
|
48
|
+
"test": "node bin/build-corpus.js --help && node bin/validate-katex.js README.md"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@codemirror/lang-markdown": "^6.5.0",
|
|
52
|
+
"@codemirror/theme-one-dark": "^6.1.3",
|
|
53
|
+
"@tiptap/extension-bubble-menu": "^3.23.1",
|
|
54
|
+
"@tiptap/extension-floating-menu": "^3.23.1",
|
|
55
|
+
"@tiptap/extension-image": "^3.23.1",
|
|
56
|
+
"@tiptap/extension-link": "^3.23.1",
|
|
57
|
+
"@tiptap/extension-placeholder": "^3.23.1",
|
|
58
|
+
"@tiptap/extension-table": "^3.23.1",
|
|
59
|
+
"@tiptap/extension-table-cell": "^3.23.1",
|
|
60
|
+
"@tiptap/extension-table-header": "^3.23.1",
|
|
61
|
+
"@tiptap/extension-table-row": "^3.23.1",
|
|
62
|
+
"@tiptap/extension-task-item": "^3.23.1",
|
|
63
|
+
"@tiptap/extension-task-list": "^3.23.1",
|
|
64
|
+
"@tiptap/react": "^3.23.1",
|
|
65
|
+
"@tiptap/starter-kit": "^3.23.1",
|
|
66
|
+
"@uiw/react-codemirror": "^4.25.9",
|
|
67
|
+
"katex": "^0.16.22",
|
|
68
|
+
"marked": "^15.0.12",
|
|
69
|
+
"react": "^19.2.6",
|
|
70
|
+
"react-dom": "^19.2.6",
|
|
71
|
+
"turndown": "^7.2.4"
|
|
72
|
+
},
|
|
73
|
+
"keywords": [
|
|
74
|
+
"docx",
|
|
75
|
+
"markdown",
|
|
76
|
+
"word",
|
|
77
|
+
"omml",
|
|
78
|
+
"katex",
|
|
79
|
+
"converter"
|
|
80
|
+
],
|
|
81
|
+
"author": "LIFE AI",
|
|
82
|
+
"license": "Apache-2.0",
|
|
83
|
+
"engines": {
|
|
84
|
+
"node": ">=18"
|
|
85
|
+
},
|
|
86
|
+
"devDependencies": {
|
|
87
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
88
|
+
"vite": "^6.4.2"
|
|
89
|
+
}
|
|
90
|
+
}
|
package/pyproject.toml
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools>=69", "wheel"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "build-corpus"
|
|
7
|
-
version = "0.
|
|
8
|
-
description = "Convert DOCX
|
|
9
|
-
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.10"
|
|
11
|
-
license = "Apache-2.0"
|
|
12
|
-
authors = [
|
|
13
|
-
{ name = "LIFE AI" }
|
|
14
|
-
]
|
|
15
|
-
keywords = ["docx", "markdown", "omml", "katex", "word", "converter"]
|
|
16
|
-
dependencies = [
|
|
17
|
-
"omml2latex>=0.1.1",
|
|
18
|
-
"Pillow>=10.0.0",
|
|
19
|
-
"python-docx>=1.1.2"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
[
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
[
|
|
33
|
-
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=69", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "build-corpus"
|
|
7
|
+
version = "0.7.0"
|
|
8
|
+
description = "Convert between DOCX/PPTX and Markdown — Word OMML equations to KaTeX TeX inbound, LaTeX to native OMML outbound."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "LIFE AI" }
|
|
14
|
+
]
|
|
15
|
+
keywords = ["docx", "markdown", "omml", "katex", "word", "converter"]
|
|
16
|
+
dependencies = [
|
|
17
|
+
"omml2latex>=0.1.1",
|
|
18
|
+
"Pillow>=10.0.0",
|
|
19
|
+
"python-docx>=1.1.2",
|
|
20
|
+
"latex2mathml>=3.77",
|
|
21
|
+
"mathml2omml>=0.0.2"
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.optional-dependencies]
|
|
25
|
+
s3 = ["boto3>=1.34"]
|
|
26
|
+
dev = ["build>=1.2", "twine>=5.0"]
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
"build-corpus" = "build_corpus.exporter:main"
|
|
30
|
+
|
|
31
|
+
[tool.setuptools.packages.find]
|
|
32
|
+
where = ["src"]
|
|
33
|
+
|
|
34
|
+
[tool.setuptools.package-data]
|
|
35
|
+
build_corpus = ["templates/*.dotx"]
|
package/requirements.txt
CHANGED
|
@@ -16,10 +16,10 @@ if ([string]::IsNullOrWhiteSpace($Version)) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
$releaseRoot = Join-Path $Root "dist\release"
|
|
19
|
-
$stage = Join-Path $releaseRoot "regen
|
|
19
|
+
$stage = Join-Path $releaseRoot "regen-mde-$Version-win-x64"
|
|
20
20
|
$app = Join-Path $stage "app"
|
|
21
|
-
$zip = Join-Path $releaseRoot "regen
|
|
22
|
-
$setupExe = Join-Path $releaseRoot "regen
|
|
21
|
+
$zip = Join-Path $releaseRoot "regen-mde-$Version-win-x64.zip"
|
|
22
|
+
$setupExe = Join-Path $releaseRoot "regen-mde-$Version-win-x64-setup.exe"
|
|
23
23
|
|
|
24
24
|
Remove-Item -LiteralPath $stage -Recurse -Force -ErrorAction SilentlyContinue
|
|
25
25
|
Remove-Item -LiteralPath $zip -Force -ErrorAction SilentlyContinue
|
|
@@ -38,16 +38,16 @@ Copy-Item -LiteralPath (Join-Path $Root "package-lock.json") -Destination $app -
|
|
|
38
38
|
Copy-Item -LiteralPath (Join-Path $Root "installer\install-regen-mde.ps1") -Destination $stage -Force
|
|
39
39
|
|
|
40
40
|
$readme = @"
|
|
41
|
-
regen
|
|
41
|
+
regen-mde for Windows
|
|
42
42
|
=====================
|
|
43
43
|
|
|
44
44
|
Install:
|
|
45
45
|
Right-click install-regen-mde.ps1 and choose "Run with PowerShell"
|
|
46
46
|
|
|
47
47
|
After install:
|
|
48
|
-
Open the Windows Start menu and search for "regen
|
|
49
|
-
Right-click .md or .docx files and choose "Open in regen
|
|
50
|
-
Use "Uninstall regen
|
|
48
|
+
Open the Windows Start menu and search for "regen-mde".
|
|
49
|
+
Right-click .md or .docx files and choose "Open in regen-mde".
|
|
50
|
+
Use "Uninstall regen-mde" from the Start menu to remove the app and shell verbs.
|
|
51
51
|
|
|
52
52
|
Requirements:
|
|
53
53
|
Windows with Microsoft Edge WebView2 runtime
|
|
@@ -55,7 +55,7 @@ Requirements:
|
|
|
55
55
|
Python 3 on PATH with the Build Corpus Python requirements installed
|
|
56
56
|
|
|
57
57
|
The installer copies the app to:
|
|
58
|
-
%LOCALAPPDATA%\Programs\regen
|
|
58
|
+
%LOCALAPPDATA%\Programs\regen-mde
|
|
59
59
|
"@
|
|
60
60
|
Set-Content -LiteralPath (Join-Path $stage "README-INSTALL.txt") -Value $readme -Encoding UTF8
|
|
61
61
|
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Dual-channel release for build-corpus: keep the npm package (package.json)
|
|
3
|
+
// and the PyPI package (pyproject.toml) on the SAME version, then optionally
|
|
4
|
+
// publish both and tag once.
|
|
5
|
+
//
|
|
6
|
+
// Usage:
|
|
7
|
+
// node scripts/release-dual.mjs <version|--patch|--minor|--major> [--publish] [--dry-run]
|
|
8
|
+
//
|
|
9
|
+
// node scripts/release-dual.mjs 0.3.1 # set both manifests to 0.3.1 (no publish)
|
|
10
|
+
// node scripts/release-dual.mjs --patch # bump patch in both
|
|
11
|
+
// node scripts/release-dual.mjs --minor --publish# bump, build, publish npm + PyPI, tag
|
|
12
|
+
// node scripts/release-dual.mjs --patch --dry-run# show what would change, touch nothing
|
|
13
|
+
//
|
|
14
|
+
// Publishing requires credentials in the environment / config:
|
|
15
|
+
// - npm: a logged-in npm (npm whoami) or NPM_TOKEN in ~/.npmrc
|
|
16
|
+
// - PyPI: TWINE_USERNAME=__token__ and TWINE_PASSWORD=<pypi-token>, or ~/.pypirc
|
|
17
|
+
// The script never reads secrets itself — it defers to npm/twine.
|
|
18
|
+
|
|
19
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
20
|
+
import { spawnSync } from "node:child_process";
|
|
21
|
+
import { fileURLToPath } from "node:url";
|
|
22
|
+
import path from "node:path";
|
|
23
|
+
|
|
24
|
+
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
25
|
+
const pkgPath = path.join(root, "package.json");
|
|
26
|
+
const pyPath = path.join(root, "pyproject.toml");
|
|
27
|
+
|
|
28
|
+
const args = process.argv.slice(2);
|
|
29
|
+
const dryRun = args.includes("--dry-run");
|
|
30
|
+
const publish = args.includes("--publish");
|
|
31
|
+
const versionArg = args.find((a) => !a.startsWith("--"));
|
|
32
|
+
const bumpFlag = ["--patch", "--minor", "--major"].find((f) => args.includes(f));
|
|
33
|
+
|
|
34
|
+
function die(message) {
|
|
35
|
+
console.error(`release-dual: ${message}`);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function run(command, commandArgs, opts = {}) {
|
|
40
|
+
console.log(`$ ${command} ${commandArgs.join(" ")}`);
|
|
41
|
+
if (dryRun) return 0;
|
|
42
|
+
const result = spawnSync(command, commandArgs, { stdio: "inherit", cwd: root, shell: false, ...opts });
|
|
43
|
+
if (result.error) die(`${command} failed: ${result.error.message}`);
|
|
44
|
+
if ((result.status ?? 1) !== 0) die(`${command} exited ${result.status}`);
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function bumpSemver(current, kind) {
|
|
49
|
+
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(current);
|
|
50
|
+
if (!match) die(`current version "${current}" is not plain semver`);
|
|
51
|
+
let [major, minor, patch] = match.slice(1).map(Number);
|
|
52
|
+
if (kind === "--major") { major += 1; minor = 0; patch = 0; }
|
|
53
|
+
else if (kind === "--minor") { minor += 1; patch = 0; }
|
|
54
|
+
else { patch += 1; }
|
|
55
|
+
return `${major}.${minor}.${patch}`;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// --- resolve target version ---
|
|
59
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
60
|
+
const currentVersion = pkg.version;
|
|
61
|
+
|
|
62
|
+
let nextVersion;
|
|
63
|
+
if (versionArg) {
|
|
64
|
+
if (!/^\d+\.\d+\.\d+$/.test(versionArg)) die(`"${versionArg}" is not a valid semver`);
|
|
65
|
+
nextVersion = versionArg;
|
|
66
|
+
} else if (bumpFlag) {
|
|
67
|
+
nextVersion = bumpSemver(currentVersion, bumpFlag);
|
|
68
|
+
} else {
|
|
69
|
+
die("provide a version (e.g. 0.3.1) or a bump flag (--patch/--minor/--major)");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
console.log(`build-corpus: ${currentVersion} -> ${nextVersion}${dryRun ? " (dry-run)" : ""}`);
|
|
73
|
+
|
|
74
|
+
// --- write package.json ---
|
|
75
|
+
pkg.version = nextVersion;
|
|
76
|
+
if (!dryRun) writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
|
|
77
|
+
console.log(` package.json version = ${nextVersion}`);
|
|
78
|
+
|
|
79
|
+
// --- write pyproject.toml (only the [project] version line) ---
|
|
80
|
+
const pyText = readFileSync(pyPath, "utf8");
|
|
81
|
+
const pyNext = pyText.replace(/^(version\s*=\s*)"[^"]+"/m, `$1"${nextVersion}"`);
|
|
82
|
+
if (pyNext === pyText) die("could not find a version line in pyproject.toml");
|
|
83
|
+
if (!dryRun) writeFileSync(pyPath, pyNext);
|
|
84
|
+
console.log(` pyproject.toml version = ${nextVersion}`);
|
|
85
|
+
|
|
86
|
+
if (!publish) {
|
|
87
|
+
console.log("\nVersions synced. Re-run with --publish to build, publish, and tag.");
|
|
88
|
+
process.exit(0);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// --- publish PyPI: build sdist+wheel, upload with twine ---
|
|
92
|
+
console.log("\n== PyPI ==");
|
|
93
|
+
run("python3", ["-m", "build"]);
|
|
94
|
+
run("python3", ["-m", "twine", "upload", "dist/*.whl", "dist/*.tar.gz"]);
|
|
95
|
+
|
|
96
|
+
// --- publish npm ---
|
|
97
|
+
console.log("\n== npm ==");
|
|
98
|
+
run("npm", ["publish"]);
|
|
99
|
+
|
|
100
|
+
// --- tag once ---
|
|
101
|
+
console.log("\n== git ==");
|
|
102
|
+
run("git", ["add", "package.json", "pyproject.toml"]);
|
|
103
|
+
run("git", ["commit", "-m", `release: v${nextVersion} (npm + PyPI)`]);
|
|
104
|
+
run("git", ["tag", `v${nextVersion}`]);
|
|
105
|
+
console.log(`\nDone. Push with: git push && git push origin v${nextVersion}`);
|