You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -47,9 +48,40 @@ What happens during conversion:
47
48
- Images are extracted and uploaded to the wiki automatically (duplicates are skipped)
48
49
- The uploaded source file is removed after conversion
49
50
- Temporary files are cleaned up
50
-
51
51
A legacy (non-Codex) form is available at `Special:PandocUltimateConverter?codex=0`.
52
52
53
+
## AI Cleanup (LLM Polish)
54
+
55
+
The extension can optionally run an LLM (OpenAI or Claude) to clean up wikitext after conversion — fixing formatting issues, removing artefacts, and improving readability.
56
+
57
+
### Setup
58
+
59
+
Add to `LocalSettings.php`:
60
+
```php
61
+
$wgPandocUltimateConverter_LlmProvider = 'openai'; // or 'claude'
62
+
$wgPandocUltimateConverter_LlmApiKey = 'sk-...';
63
+
// Optional: override the default model
64
+
// $wgPandocUltimateConverter_LlmModel = 'gpt-5.4-nano'; // OpenAI default; or 'claude-3-5-haiku-20241022' for Claude
65
+
```
66
+
67
+
### Usage
68
+
69
+
There are two ways to use AI cleanup:
70
+
71
+
1.**Batch mode** — check the "Polish with AI" checkbox before clicking **Convert all**. Each item is converted first, then automatically queued for AI cleanup. The conversion queue and the AI cleanup queue run in parallel.
72
+
2.**Per-item** — click the ✨ button on any already-converted item to run AI cleanup on demand.
73
+
74
+
If AI cleanup fails, a per-item error is shown with a **Retry** button.
75
+
76
+
### LLM Configuration
77
+
78
+
| Parameter | Default | Description |
79
+
|-----------|---------|-------------|
80
+
|`PandocUltimateConverter_LlmProvider`|`null`|`"openai"` or `"claude"`. Leave null to disable. |
81
+
|`PandocUltimateConverter_LlmApiKey`|`null`| API key for the configured provider. |
82
+
|`PandocUltimateConverter_LlmModel`|`null`| Model override. Defaults to `gpt-5.4-nano` (OpenAI) or `claude-3-5-haiku-20241022` (Claude). |
83
+
|`PandocUltimateConverter_LlmPrompt`|`null`| Custom system prompt for the cleanup step. |
84
+
53
85
## Export (Special:PandocExport)
54
86
55
87
Export one or more wiki pages to an external document format.
@@ -105,6 +137,10 @@ All parameters are set in `LocalSettings.php` with the `$wg` prefix.
105
137
|`PandocUltimateConverter_FiltersToUse`|`[]`| Custom [Pandoc Lua filters](https://pandoc.org/filters.html) to apply. Must be in the `filters/` folder. |
106
138
|`PandocUltimateConverter_UseColorProcessors`|`false`| Preserve text/background colors from DOCX/ODT files. |
107
139
|`PandocUltimateConverter_ShowExportInPageTools`|`true`| Show "Export" in the page Actions menu. |
140
+
|`PandocUltimateConverter_LlmProvider`|`null`| LLM provider: `"openai"` or `"claude"`. |
141
+
|`PandocUltimateConverter_LlmApiKey`|`null`| API key for the LLM provider. |
142
+
|`PandocUltimateConverter_LlmModel`|`null`| Model name override. |
143
+
|`PandocUltimateConverter_LlmPrompt`|`null`| Custom system prompt for AI cleanup. |
{ "pandocllmpolish": { "result": "success", "pagename": "My Article" } }
256
+
```
257
+
258
+
| Parameter | Required | Description |
259
+
|-----------|----------|-------------|
260
+
|`pagename`| yes | Title of existing wiki page to polish |
261
+
|`token`| yes | CSRF token |
262
+
263
+
### action=pandocurltitle
264
+
265
+
Fetches remote URLs and extracts their HTML `<title>` tags. Used internally by the Codex UI to suggest page names for URL imports. GET request, no token required.
266
+
267
+
```
268
+
GET /api.php?action=pandocurltitle&urls=https://example.com&format=json
Copy file name to clipboardExpand all lines: i18n/de.json
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,8 @@
39
39
"apihelp-pandocconvert-param-forceoverwrite": "Wenn gesetzt, wird die Zielseite überschrieben, falls sie bereits existiert.",
40
40
"apihelp-pandocconvert-example-file": "Eine bereits hochgeladene Datei namens Document.docx in die Seite MyArticle konvertieren.",
41
41
"apihelp-pandocconvert-example-url": "Den Inhalt von https://example.com in die Seite MyArticle konvertieren.",
42
+
"apihelp-pandocllmpolish-summary": "KI-Bereinigung des Wikitexts einer bestehenden Wiki-Seite durchführen.",
43
+
"apihelp-pandocllmpolish-param-pagename": "Titel der bestehenden Wiki-Seite, die bereinigt werden soll.",
42
44
"pandocultimateconverter-codex-description": "Dateien oder URLs hinzufügen, um sie in Wiki-Seiten zu konvertieren. Sie können mehrere Elemente gleichzeitig verarbeiten.",
0 commit comments