diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4144d09 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "_dokuwiki"] + path = _dokuwiki + url = https://github.com/dokuwiki/dokuwiki.git diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..a6946aa --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,19 @@ +{ + // Developer quality-of-life: + // If you add a DokuWiki checkout as ./_dokuwiki (see README), Intelephense will + // index it and resolve DokuWiki base classes (ActionPlugin, SyntaxPlugin, etc.). + "intelephense.environment.includePaths": [ + "./_dokuwiki", + "./_dokuwiki/inc", + "./_dokuwiki/lib", + "./_dokuwiki/vendor" + ], + + // Keep the file explorer tidy when the optional DokuWiki checkout exists. + "files.exclude": { + "**/_dokuwiki/.git": true, + "**/_dokuwiki/data": true, + "**/_dokuwiki/conf": true, + "**/_dokuwiki/cache": true + } +} diff --git a/README.md b/README.md index d3f35b1..daafad0 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,35 @@ When adding new internal classes under the `dokuwiki\plugin\luxtools\` namespace JavaScript is split into small modules under `js/` and registered via `action.php` so DokuWiki loads them in order. +## IDE support (developer notes) + +This plugin extends and uses DokuWiki core classes (for example `dokuwiki\Extension\ActionPlugin`, `dokuwiki\Extension\SyntaxPlugin`, renderers, handlers). If you only open the plugin folder in your IDE, those types may show as “unknown”. + +DokuWiki does not currently ship an official PHP “SDK”/stub package for IDEs. The most reliable way to get full type navigation and autocomplete is to have the DokuWiki sources available in your workspace. + +Two recommended setups: + +### Option A: Add DokuWiki as a git submodule (recommended for a single-folder workspace) + +From the plugin root: + +```bash +git submodule add https://github.com/dokuwiki/dokuwiki.git _dokuwiki +git submodule update --init --recursive +``` + +The repository includes a VS Code config in `.vscode/settings.json` that points Intelephense at `./_dokuwiki/*` so the classes resolve. + +`deploy.sh` excludes `_dokuwiki/` to avoid deploying the dev-only checkout. + +### Option B: Use a separate DokuWiki checkout next to the plugin (recommended if you don’t want submodules) + +- Clone DokuWiki into a sibling folder (outside this repo) +- Open a multi-root VS Code workspace with both folders + +This avoids changing the git state of the plugin repo, but still gives the IDE access to DokuWiki’s class definitions. + + ## Configuration luxtools is configured via its dedicated admin page: diff --git a/_dokuwiki b/_dokuwiki new file mode 160000 index 0000000..47e4d69 --- /dev/null +++ b/_dokuwiki @@ -0,0 +1 @@ +Subproject commit 47e4d6995f99d0f1bc55b408c8cbc794381d0ebe diff --git a/action.php b/action.php index bf18b06..652de33 100644 --- a/action.php +++ b/action.php @@ -18,7 +18,7 @@ class action_plugin_luxtools extends ActionPlugin /** * Add plugin JavaScript files in a deterministic order. * - * @param Event $event + * @param Event $event * @param mixed $param * @return void */ diff --git a/deploy.sh b/deploy.sh index 729c62f..d181719 100755 --- a/deploy.sh +++ b/deploy.sh @@ -68,6 +68,7 @@ RSYNC_ARGS=( --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r --exclude=deploy.sh --exclude=.git/ + --exclude=_dokuwiki/ --exclude=.github/ --exclude=.vscode/ --exclude=_test/