md2gost 1.3.0 → 1.3.2

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/CHANGELOG.md ADDED
@@ -0,0 +1,225 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
+
7
+ ## [Unreleased]
8
+
9
+ ### Added
10
+ ### Changed
11
+ ### Deprecated
12
+ ### Removed
13
+ ### Fixed
14
+ ### Security
15
+
16
+ ## [1.3.2] - 2026-07-12
17
+ ### Added
18
+ * **Directory Output Support**: `renderMarkdown` now accepts directory paths for `config.output`, auto-generating the filename from the input file with the correct extension (`.pdf`/`.docx`).
19
+ ### Fixed
20
+ * Fixed a bug where intermediate `.docx` path was returned even when `removeIntermediateDocx` was active.
21
+
22
+ ## [1.3.1] - 2026-07-09
23
+ ### Fixed
24
+ - assert that macros are enabled for pdf output format
25
+ - fix import in CLI
26
+
27
+ ## [1.3.0] - 2026-07-09
28
+ ### Added
29
+ - NPM package support alongside the existing VS Code extension (dual distribution).
30
+ - Command Line Interface (CLI) powered by `commander`.
31
+
32
+ ## [1.2.2] - 2026-05-27
33
+ ### Changed
34
+ - allow simple list in "СПИСОК ИСПОЛЬЗОВАННЫХ ИСТОЧНИКОВ"
35
+ ### Fixed
36
+ - fix macros on non-Russian system locales
37
+ - add count of appendices in "РЕФЕРАТ"
38
+
39
+ ## [1.2.1] - 2026-05-23
40
+ ### Fixed
41
+ - fix link parsing
42
+ - fix sources list parsing
43
+ - fix macros for large docs
44
+ - fix AutoListingContinuation
45
+ - fix count of elements in "РЕФЕРАТ"
46
+ - keep table and code caption styles in continuations
47
+
48
+ ## [1.2.0] - 2026-05-21
49
+ ### Added
50
+ - support Appendix section
51
+ - new rules to configure styles
52
+ - support multiline markdown comments
53
+ - `md2gost.completion.tableSeparator` and `md2gost.completion.listItem` options to toggle text suggestions
54
+ - `md2gost.render.removeIntermediateDocx` option to clean up temporary DOCX file after PDF generation
55
+ ### Changed
56
+ - rename option `md2gost.ui.enhancedMarkdownPreview` to `md2gost.ui.enhancedPreview`
57
+ - rename option `md2gost.ui.disableHighlighting` to `md2gost.ui.enhancedHighlighting`
58
+ ### Fixed
59
+ - support for triple-backtick (```) blocks in paragraph text
60
+ - AutoTableContinuation: dont left single row at page
61
+ - fix formatter: skip text inside triple-backtick (```) blocks
62
+ - fix formatter: keep em dashes inside "СПИСОК ИСПОЛЬЗОВАННЫХ ИСТОЧНИКОВ"
63
+ - fix list formatting
64
+ - fix json parsing in rendering to PDF
65
+ - fix macros on non-Russian system locales
66
+ - fix custom md syntax highlighting
67
+
68
+ ## [1.1.1] - 2026-05-10
69
+ ### Fixed
70
+ - fix titles in Markdown preview
71
+
72
+ ## [1.1.0] - 2026-05-09
73
+ ### Added
74
+ - new rules to configure styles
75
+ - echance Markdown preview to support custom syntax
76
+ - show warnings for uncorrect rules
77
+ - add "open readme" button
78
+ ### Fixed
79
+ - fix render of section without page numbers
80
+ - enable table editor for all md files
81
+
82
+ ## [1.0.3] - 2026-04-26
83
+ ### Added
84
+ - html codes: `« » ‹ ›` for `« » ‹ ›`
85
+ ### Fixed
86
+ - fix quote replacement for non‑ASCII characters and punctuation after closing quotes
87
+ - add missing intellisense
88
+ - fix AutoListingContinuation
89
+
90
+ ## [1.0.1] - 2026-04-26
91
+ ### Fixed
92
+ - convert `⋆` to `*`
93
+
94
+ ## [1.0.0] - 2026-04-26
95
+ ### Added
96
+ - intellisense (CompletionItem, InlineCompletionItem, Hover, InlayHints)
97
+ - formatter
98
+ - table editor
99
+ - html codes for ~60 symbol (e.g. `π` to `π`)
100
+ - add AutoTableContinuation
101
+ - feature: sources list
102
+ - allow pdf in doc include
103
+ ### Changed
104
+ - rule `backtick_mono`: `off` - no style now, added `italic` option instead
105
+ ### Fixed
106
+ - fix one-column table parsing
107
+ - allow table title without newline
108
+ - signicantly speed up vba macros (up to 20 times)
109
+ - fix (allow) svg images
110
+ - fix metadata changes lost
111
+
112
+ ## [0.7.0] - 2026-04-07
113
+ ### Added
114
+ - convert `⋆` to `*`
115
+ - table columns alignment with colon
116
+ - parse ``` `abc` ``` as monotext, render as italic if backtick_mono is off (default)
117
+ - new rule: `!!rule backtick_mono <off/on/outline>`
118
+ - new rule: `!!rule numbering lazy <off/on>`
119
+ ### Fixed
120
+ - fix disappearing stars due to text style parsing
121
+ - fix list indent when >= 10 items
122
+ - fix quotes replacing ("a "b" c": «a »b« c» to «a «b» c»)
123
+ - fix docx include when not in the beginning
124
+ - fix `<br>` duplication
125
+
126
+ ## [0.6.1] - 2026-03-10
127
+ ### Added
128
+ - show what's new page on update
129
+
130
+ ## [0.6.0] - 2026-03-07
131
+ ### Added
132
+ - autonumbering by `[#]`, `[ref_id]`
133
+ - refs by `[ref_id]` - allowed chars: a-z A-Z а-я А-Я ёЁ _ 0-9
134
+ - text vars `[!pages]` `[!imgs]` `[!tables]` `[!codes]` `[!sources]`
135
+ - new rules: `!!rule numbering sections <on/off>` `!!rule numbering autoprefix <on/off>`
136
+ - fast render without postprocessing (hold alt when click render button)
137
+ ### Fixed
138
+ - warn message if not win32 instead of error
139
+ - black background with `!!rule rainbow`
140
+ - fix img path from project root: treat `/img.png` as `./img.png`
141
+ - correct work with img path in `<>` like `<img.png>`
142
+
143
+ ## [0.5.2] - 2026-02-27
144
+ ### Fixed
145
+ - detect ru/en language in text for correct markup
146
+ - better error messages
147
+ - stretch tables to full page width
148
+ - dont crash if cant run PS or on PS error
149
+
150
+ ## [0.5.1] - 2026-02-18
151
+ ### Added
152
+ - replacing `---` with page break
153
+ ### Fixed
154
+ - fix using absolute path for images and external doc
155
+ - save .md file before rendering
156
+
157
+ ## [0.5.0] - 2026-02-18
158
+ ### Added
159
+ - insert non-breaking space by `&nbsp;`
160
+ - insert tab by `&Tab;`
161
+ - prevent text stretching due to line breaks
162
+ - new rule rainbow: `!!rule rainbow`
163
+ - set in doc: edit time (random in 30-120), creation time (as in .md), modification time (now)
164
+ - new rules: `!!rule etime <int>`, `!!rule ctime <ISO 8601>`, `!!rule mtime <ISO 8601>`
165
+ ### Fixed
166
+ - fix doc include parsing
167
+ - prevent empty image title
168
+
169
+ ## [0.4.0] - 2026-02-17
170
+ ### Added
171
+ - new rule to set title of document: `!!rule title My great title`
172
+ - new rule to set author of document: `!!rule author My name`
173
+
174
+ ## [0.3.1] - 2026-02-17
175
+ ### Fixed
176
+ - syntax highlighting: remove bold style
177
+
178
+ ## [0.3.0] - 2026-02-17
179
+ ### Added
180
+ - syntax highlighting in code blocks
181
+ - is enabled by adding `!!rule highlight code` anywhere in file
182
+ - suports: html, xml, css, js, ts, jsx, tsx, json, bash, powershell, python, java, c, cpp, csharp, go, rust, php, ruby, swift, kotlin, sql, yaml, markdown, docker, nginx
183
+
184
+ ## [0.2.1] - 2026-02-17
185
+ ### Added
186
+ - replacing quotes: "abc" to «abc»
187
+
188
+ ## [0.2.0] - 2026-02-17
189
+ ### Added
190
+ - break line by `<br>`
191
+ - text decorations parsing: bold, italic, links
192
+ ### Fixed
193
+ - disable row spliting in table
194
+
195
+ ## [0.1.7] - 2026-02-15
196
+ ### Fixed
197
+ - fix AutoListingContinuation
198
+
199
+ ## [0.1.6] - 2026-02-15
200
+ ### Fixed
201
+ - greatly fix PDF render
202
+
203
+ ## [0.1.5] - 2026-02-15
204
+ ### Fixed
205
+ - list: dont auto-lower first char
206
+
207
+ ## [0.1.4] - 2026-02-15
208
+ ### Fixed
209
+ - fix readme
210
+
211
+ ## [0.1.3] - 2026-02-15
212
+ ### Added
213
+ - replacing "ai" dashes with common dash
214
+ ### Fixed
215
+ - list: dont auto-lower first char if second is uppercase
216
+ - ToC title uppercase
217
+ - improve readme
218
+
219
+ ## [0.1.2] - 2026-02-13
220
+ ### Fixed
221
+ - Correct parsing of tables and lists
222
+
223
+ ## [0.1.0] - 2026-02-13
224
+ ### Added
225
+ - basic functionality
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Mike
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mike
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.
package/assets/run.ps1 CHANGED
@@ -1,61 +1,61 @@
1
- param (
2
- [string]$InputDoc,
3
- [string]$OutputDoc,
4
- [string]$MacroTemplate,
5
- [switch]$RenderPDF
6
- )
7
-
8
-
9
- if (-not $InputDoc) { throw "The input file is not defined" }
10
- if (-not $OutputDoc) { throw "The output file is not defined" }
11
- if (-not $MacroTemplate) { throw "The macro template file is not defined" }
12
-
13
- # --- Проверки --------------------------------------------------
14
-
15
- if (-not (Test-Path $InputDoc)) {
16
- throw "The input file was not found: $InputDoc"
17
- }
18
- if (-not (Test-Path $MacroTemplate)) {
19
- throw "The macro file was not found: $MacroTemplate"
20
- }
21
-
22
- $InputDoc = [System.IO.Path]::GetFullPath($InputDoc)
23
- $OutputDoc = [System.IO.Path]::GetFullPath($OutputDoc)
24
- $MacroTemplate = [System.IO.Path]::GetFullPath($MacroTemplate)
25
-
26
- # --- Word ------------------------------------------------------
27
-
28
- [Console]::OutputEncoding = [System.Text.Encoding]::UTF8;
29
-
30
- $word = New-Object -ComObject Word.Application
31
- $word.Visible = $false
32
- $word.DisplayAlerts = 0
33
-
34
- try {
35
- # Подключаем глобальный шаблон
36
- $word.AddIns.Add($MacroTemplate, $true)
37
-
38
- $doc = $word.Documents.Open($InputDoc)
39
-
40
- # --- Generating -------------------------------------------
41
- Write-Host "[*1] Generating continued listings..."
42
- $word.Run("AutoListingContinuation")
43
-
44
- Write-Host "[*2] Generating continued tables..."
45
- $word.Run("AutoTableContinuation")
46
-
47
- # --- Saving -----------------------------------------------
48
- $doc.SaveAs($OutputDoc, 16)
49
-
50
- if ($RenderPDF) {
51
- Write-Host "[*3] Render to PDF..."
52
- $word.Run("RenderSegmentsToPDF")
53
- }
54
-
55
- $doc.Close($false)
56
- Write-Host "Done: $OutputDoc"
57
- }
58
- finally {
59
- $word.Quit()
60
- [System.Runtime.InteropServices.Marshal]::ReleaseComObject($word) | Out-Null
61
- }
1
+ param (
2
+ [string]$InputDoc,
3
+ [string]$OutputDoc,
4
+ [string]$MacroTemplate,
5
+ [switch]$RenderPDF
6
+ )
7
+
8
+
9
+ if (-not $InputDoc) { throw "The input file is not defined" }
10
+ if (-not $OutputDoc) { throw "The output file is not defined" }
11
+ if (-not $MacroTemplate) { throw "The macro template file is not defined" }
12
+
13
+ # --- Проверки --------------------------------------------------
14
+
15
+ if (-not (Test-Path $InputDoc)) {
16
+ throw "The input file was not found: $InputDoc"
17
+ }
18
+ if (-not (Test-Path $MacroTemplate)) {
19
+ throw "The macro file was not found: $MacroTemplate"
20
+ }
21
+
22
+ $InputDoc = [System.IO.Path]::GetFullPath($InputDoc)
23
+ $OutputDoc = [System.IO.Path]::GetFullPath($OutputDoc)
24
+ $MacroTemplate = [System.IO.Path]::GetFullPath($MacroTemplate)
25
+
26
+ # --- Word ------------------------------------------------------
27
+
28
+ [Console]::OutputEncoding = [System.Text.Encoding]::UTF8;
29
+
30
+ $word = New-Object -ComObject Word.Application
31
+ $word.Visible = $false
32
+ $word.DisplayAlerts = 0
33
+
34
+ try {
35
+ # Подключаем глобальный шаблон
36
+ $word.AddIns.Add($MacroTemplate, $true)
37
+
38
+ $doc = $word.Documents.Open($InputDoc)
39
+
40
+ # --- Generating -------------------------------------------
41
+ Write-Host "[*1] Generating continued listings..."
42
+ $word.Run("AutoListingContinuation")
43
+
44
+ Write-Host "[*2] Generating continued tables..."
45
+ $word.Run("AutoTableContinuation")
46
+
47
+ # --- Saving -----------------------------------------------
48
+ $doc.SaveAs($OutputDoc, 16)
49
+
50
+ if ($RenderPDF) {
51
+ Write-Host "[*3] Render to PDF..."
52
+ $word.Run("RenderSegmentsToPDF")
53
+ }
54
+
55
+ $doc.Close($false)
56
+ Write-Host "Done: $OutputDoc"
57
+ }
58
+ finally {
59
+ $word.Quit()
60
+ [System.Runtime.InteropServices.Marshal]::ReleaseComObject($word) | Out-Null
61
+ }