Table of Contents

DokuWiki Consolidation Feasibility

DokuWiki Consolidation Feasibility looks at reinstalling vanilla DokuWiki and splitting the current core patches and custom plugins into a set of independent plugins, some site-specific and some reusable, plus moving all styling into a single yanevskiv template. Short version: the template side is basically already done, most core patches can move into plugins, a small unavoidable cluster can't, and digging into this surfaced both a chunk of dead code and an undisclosed fork that changed the plan.

Verdict up front

A literally vanilla core is not achievable — the .md extension change has no plugin hook anywhere in DokuWiki's API, full stop. Everything else currently patched into core either has a real event to hook (move it to a plugin) or turns out to be unused code that should just be deleted on reinstall rather than carried forward at all. The original framing of this report — “one yanevskiv plugin holding everything” — also changed shape: most of what was headed there splits out into small, independent, individually reusable plugins instead, with yanevskiv left as the site-specific leftover, not the main event.

Template: nothing to do

lib/tpl/yanevskiv/ is already a single template with its own git repo, and every styling change made so far (_links.css link colors, WIP CSS, favicon-lookup-in-template question from earlier) already lives there. “Consolidate styling into one template” is already the current state — a fresh install just needs this directory copied over wholesale.

Core patches that can become plugin hooks

Core patches that have to stay core

Dead code found along the way: `math`/`eqn`/`latex_figure`

Worth flagging before migrating anything: the math(), eqn(), latex_figure() methods added to inc/parser/renderer.php and inc/parser/xhtml.php (commit fb8ba4b) are never called by anything — grepping the whole plugin tree turns up zero callers. What actually renders math today:

Net effect: the three custom renderer methods do nothing today. Don't migrate them to a plugin, delete them on reinstall.

Correction: `markdowku` is not untouched upstream

The first pass of this report said markdowku was pristine upstream and shouldn't be forked. That was wrong. lib/plugins/markdowku/ has its own git repo with two commits: a vendored “Initial commit” of the real upstream plugin (Julian Fagir / Raphael Wimmer), then a local commit, e0413df (“Add: math, eqn, latex_figure support”), which adds syntax/mathinline.php, syntax/mathblock.php, and syntax/latexfigure.php wholesale — none of those three files exist in upstream markdowku — and appends a copyright line to LICENSE. So this plugin is already a fork, and has been since before this report's first draft.

Of the three added files, two (mathinline.php, mathblock.php) are the dead-code-shadowed-by-katex components from the section above — dead, but your dead code sitting in someone else's plugin directory. latexfigure.php is the one live, load-bearing addition: nothing else handles the \documentclass{standalone}...\end{document} pattern.

This changes the recommendation: pull latexfigure.php out into its own plugin (see below), drop the two dead math files, revert LICENSE, and markdowku goes back to genuinely pristine upstream — restoring the “don't touch third-party code” property the first draft incorrectly assumed was already true.

`katex` itself: untouched

Unlike markdowku, katex really is pristine upstream (H.-H. Peng), no local commits, no .git divergence found. Reinstall fetches it fresh, unmodified, as originally stated.

The original framing — one yanevskiv plugin holding everything — gives way to a split between plugins that are genuinely reusable by anyone running DokuWiki + KaTeX, and a thin site-specific plugin for logic that's technically generic but currently has exactly one consumer.

Reusable, standalone, no site-specific assumptions:

Genuinely could go either way, currently recommended to stay in yanevskiv:

Putting these three in yanevskiv isn't a compromise — it's the honest home for logic that's technically generic but has no second consumer yet. Nothing stops extracting any of them later if that changes.

Not a plugin at all:

Resulting core patch surface, if you do all of the above

Down from the current spread across Save.php, template.php (three separate patches), Ui/Index.php, Ui/Editor.php, parser/renderer.php, parser/xhtml.php (two patches), Menu/Item/Index.php, Menu/Item/Media.php, plus the .md cluster, to just:

Everything else moves to a plugin (yanevskiv, ace, texfigure) or the template, socialicons folds into the template directly, markdowku reverts to pristine upstream, and the math/eqn/latex_figure core patch disappears outright as dead code.