From 8aa022feffe2502d57247a4d473e91250ace393e Mon Sep 17 00:00:00 2001 From: luxick Date: Mon, 19 Jan 2026 09:16:02 +0100 Subject: [PATCH] Add single image display. --- README.md | 33 +++++- admin/main.php | 15 ++- conf/default.php | 2 +- lang/de/lang.php | 1 - lang/de/settings.php | 1 - lang/en/lang.php | 2 +- lang/en/settings.php | 1 - src/Output.php | 54 +++++---- style.css | 62 ++++++++++ syntax/AbstractSyntax.php | 17 ++- syntax/directory.php | 6 +- syntax/files.php | 6 +- syntax/image.php | 242 ++++++++++++++++++++++++++++++++++++++ syntax/scratchpad.php | 7 -- 14 files changed, 390 insertions(+), 59 deletions(-) create mode 100644 syntax/image.php diff --git a/README.md b/README.md index daafad0..1649907 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,25 @@ This always renders as a table. It includes an "Open Location" link above the ta Clicking a thumbnail opens a lightbox viewer. Thumbnails are generated and cached via the plugin endpoint. -### 4) Open a local path/folder (best-effort) +### 4) Single image with caption (imagebox) + +``` +{{image>/Scape/photos/picture.jpg|This is the caption}} +{{image>/Scape/photos/picture.jpg?400|Resized to 400px width}} +{{image>/Scape/photos/picture.jpg?400x300|Fixed dimensions}} +{{image>/Scape/photos/picture.jpg?left|Float left}} +{{image>/Scape/photos/picture.jpg?400¢er|Resized and centered}} +``` + +Renders a Wikipedia-style image box with optional caption. Parameters after `?` are separated by `&`: + +- Size: `?200` (width) or `?200x150` (width × height) +- Alignment: `?left`, `?right` (default), or `?center` +- Combined: `?400&left` or `?400x300¢er` + +The image links to the full-size version when clicked. + +### 5) Open a local path/folder (best-effort) ``` {{open>/Scape/projects|Open projects folder}} @@ -186,7 +204,7 @@ Behaviour: - Prefer calling the configured local client service (open_service_url). - Fall back to opening a file:// URL in a new tab (often blocked by browsers). -### 5) Scratchpads (shared, file-backed, no page revisions) +### 6) Scratchpads (shared, file-backed, no page revisions) ``` {{scratchpad>start}} @@ -221,6 +239,17 @@ Additionally for `{{files>...}}`: | tableheader | 0\|1 | Render table header row. | +## Admin settings + +The admin settings page includes a **default_tablecolumns** option that lets you specify which columns are displayed by default in table-style listings. This is a comma-separated list of column names: + +- `name` – File/folder name (always shown) +- `size` – File size +- `date` – Last modified date + +Example: `name,size,date` shows all columns by default. + + ## Credits / upstream luxtools is a fork of the [DokuWiki Filelist plugin](https://www.dokuwiki.org/plugin:filelist). diff --git a/admin/main.php b/admin/main.php index cf1ef2c..baeca73 100644 --- a/admin/main.php +++ b/admin/main.php @@ -12,7 +12,6 @@ class admin_plugin_luxtools_main extends DokuWiki_Admin_Plugin protected $configKeys = [ 'paths', 'scratchpad_paths', - 'allow_in_comments', 'extensions', 'default_sort', 'default_order', @@ -25,6 +24,7 @@ class admin_plugin_luxtools_main extends DokuWiki_Admin_Plugin 'default_randlinks', 'default_showsize', 'default_showdate', + 'default_tablecolumns', 'default_listsep', 'default_maxheight', 'thumb_placeholder', @@ -69,7 +69,6 @@ class admin_plugin_luxtools_main extends DokuWiki_Admin_Plugin $scratchpadPaths = str_replace(["\r\n", "\r"], "\n", $scratchpadPaths); $newConf['scratchpad_paths'] = $scratchpadPaths; - $newConf['allow_in_comments'] = (int)$INPUT->bool('allow_in_comments'); $newConf['extensions'] = $INPUT->str('extensions'); $newConf['default_sort'] = $INPUT->str('default_sort'); @@ -83,6 +82,7 @@ class admin_plugin_luxtools_main extends DokuWiki_Admin_Plugin $newConf['default_randlinks'] = (int)$INPUT->bool('default_randlinks'); $newConf['default_showsize'] = (int)$INPUT->bool('default_showsize'); $newConf['default_showdate'] = (int)$INPUT->bool('default_showdate'); + $newConf['default_tablecolumns'] = $INPUT->str('default_tablecolumns'); $newConf['default_listsep'] = $INPUT->str('default_listsep'); $newConf['default_maxheight'] = $INPUT->str('default_maxheight'); @@ -126,12 +126,6 @@ class admin_plugin_luxtools_main extends DokuWiki_Admin_Plugin echo ''; echo '
'; - // allow_in_comments - $checked = $this->getConf('allow_in_comments') ? ' checked="checked"' : ''; - echo '
'; - // extensions echo '
'; + // default_tablecolumns + echo '
'; + // default_listsep echo '