synology:dokuwiki
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| synology:dokuwiki [2021/11/03 12:54] – Wuff | synology:dokuwiki [2026/07/26 13:57] (current) – Wuff | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== DokuWiki | + | ====== DokuWiki |
| Admin, extensions: | Admin, extensions: | ||
| Line 51: | Line 51: | ||
| {{: | {{: | ||
| - | < | + | < |
| [replacements] | [replacements] | ||
| ; | ; | ||
| Line 88: | Line 88: | ||
| Hack for edittable with dark theme: | Hack for edittable with dark theme: | ||
| - | < | + | < |
| .handsontable td { | .handsontable td { | ||
| color: #222; | color: #222; | ||
| Line 95: | Line 95: | ||
| Remove footer buttons and license: | Remove footer buttons and license: | ||
| - | < | + | < |
| #remove everything between | #remove everything between | ||
| <!-- ********** FOOTER ********** --> | <!-- ********** FOOTER ********** --> | ||
| Line 104: | Line 104: | ||
| Remove Media Manager link for non-logged-in/ | Remove Media Manager link for non-logged-in/ | ||
| - | < | + | < |
| #surround: | #surround: | ||
| tpl_action(' | tpl_action(' | ||
| Line 117: | Line 117: | ||
| </ | </ | ||
| For 2020 Hogfather templates should be updated to replace the 4 tpl_action lines with: | For 2020 Hogfather templates should be updated to replace the 4 tpl_action lines with: | ||
| - | < | + | < |
| echo (new \dokuwiki\Menu\UserMenu())-> | echo (new \dokuwiki\Menu\UserMenu())-> | ||
| </ | </ | ||
| and the similar action line in site-tools under the search form should contain: | and the similar action line in site-tools under the search form should contain: | ||
| - | < | + | < |
| <? | <? | ||
| if (!empty($_SERVER[' | if (!empty($_SERVER[' | ||
| Line 129: | Line 129: | ||
| </ | </ | ||
| + | Geshi Syntax Highlight changes for dark theme: | ||
| + | add file / | ||
| + | <code css / | ||
| + | /** | ||
| + | * This file provides styles for syntax highlighting in dark mode | ||
| + | * Syntax highlighting is done by GeShi | ||
| + | * It doesn' | ||
| + | */ | ||
| + | |||
| + | @brackets: #bfbfbf; | ||
| + | @comments: #7a7a75; | ||
| + | @strings: #ff4444; | ||
| + | @methods: #ffffff; | ||
| + | @methods2: #ffcc66; | ||
| + | @keyword1: #99ee00; | ||
| + | @keyword2: #eeaa22; | ||
| + | @keyword3: #dd88ff; | ||
| + | @keyword4: #ff7744; | ||
| + | @operators: #44ffbb; | ||
| + | @numbers: #ff2288; | ||
| + | @variables: #88c0ff; | ||
| + | @variables2: | ||
| + | @variables5: | ||
| + | @lines: #252525; | ||
| + | @lines2: #272727; | ||
| + | @lines3: var(--background_site); | ||
| + | @lines-xtra: | ||
| + | |||
| + | .dokuwiki{ | ||
| + | |||
| + | /* lines */ | ||
| + | .li1 { | ||
| + | background: @lines; | ||
| + | } | ||
| + | .li2 { | ||
| + | background: @lines2; | ||
| + | } | ||
| + | .li1 .de1 { | ||
| + | background: @lines3; | ||
| + | } | ||
| + | .li1.ln-xtra .de1, .ln-xtra{ | ||
| + | background: @lines-xtra; | ||
| + | } | ||
| + | |||
| + | /* brackets | ||
| + | .br0 { | ||
| + | color: @brackets; | ||
| + | } | ||
| + | /* comments | ||
| + | .co0, .co1, .coMULTI { | ||
| + | color: @comments; | ||
| + | } | ||
| + | |||
| + | /* strings | ||
| + | .st0, .st_h { | ||
| + | color: @strings; | ||
| + | } | ||
| + | |||
| + | /* methods | ||
| + | .me0, .me1 { | ||
| + | color: @methods; | ||
| + | } | ||
| + | .me2 { | ||
| + | color: @methods2; | ||
| + | } | ||
| + | |||
| + | /* keywords | ||
| + | .kw1 { | ||
| + | color: @keyword1; | ||
| + | } | ||
| + | .kw2 { | ||
| + | color: @keyword2; | ||
| + | } | ||
| + | .kw3 { | ||
| + | color: @keyword3; | ||
| + | } | ||
| + | .kw4 { | ||
| + | color: @keyword4; | ||
| + | } | ||
| + | |||
| + | /* operators | ||
| + | .sy0 { | ||
| + | color: @operators; | ||
| + | } | ||
| + | |||
| + | /* numbers | ||
| + | .nu0 { | ||
| + | color: @numbers; | ||
| + | } | ||
| + | |||
| + | /* variables | ||
| + | .re0, .re1, .re3, .re4 { | ||
| + | color: @variables; | ||
| + | } | ||
| + | .re2 { | ||
| + | color: @variables2; | ||
| + | } | ||
| + | .re5 { | ||
| + | color: @variables5; | ||
| + | } | ||
| + | |||
| + | |||
| + | } | ||
| + | |||
| + | /* dark theme and automatic is switched off*/ | ||
| + | &: | ||
| + | .dokuwiki(); | ||
| + | } | ||
| + | |||
| + | /* User prefers dark theme and automatic is switched on*/ | ||
| + | @media (prefers-color-scheme: | ||
| + | &: | ||
| + | .dokuwiki(); | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | edit / | ||
| + | <code ini / | ||
| + | css/ | ||
| + | </ | ||
| ===== Add icon for Shortcut on Homescreen on Android ===== | ===== Add icon for Shortcut on Homescreen on Android ===== | ||
| < | < | ||
| Line 134: | Line 255: | ||
| </ | </ | ||
| insert after line 23 relating to favicon: | insert after line 23 relating to favicon: | ||
| - | < | + | < |
| <?php | <?php | ||
| $look = array(': | $look = array(': | ||
| Line 143: | Line 264: | ||
| ===== Allow additional file types ===== | ===== Allow additional file types ===== | ||
| - | Log into synology via ssh or access the dokuwiki folder.\\ | ||
| < | < | ||
| - | cd / | + | cd dokuwiki/ |
| - | sudo cp mime.conf mime.local.conf | + | cp mime.conf mime.local.conf |
| - | sudo vi mime.local.conf | + | vi mime.local.conf |
| #delete all but the text files towards the end of the file and enable them | #delete all but the text files towards the end of the file and enable them | ||
| #add json text/json | #add json text/json | ||
| Line 164: | Line 284: | ||
| Adjustment hack to show parent namespace: | Adjustment hack to show parent namespace: | ||
| - | dokuwiki/ | + | dokuwiki/ |
| - | < | + | < |
| - | // produce output | + | // produce output |
| - | $parentnamespace = noNS(getNS($id)); | + | $parentnamespace = getNS($id); |
| + | if(useHeading(' | ||
| + | // get page title | ||
| + | $parenttitle = p_get_first_heading($parentnamespace.": | ||
| + | if($parenttitle) { | ||
| + | $parentnamespace = $parenttitle; | ||
| + | } | ||
| + | } | ||
| if($parentnamespace!="" | if($parentnamespace!="" | ||
| $parentnamespace.=' | $parentnamespace.=' | ||
| } | } | ||
| - | $content | + | $section |
| - | | + | $content = '<a href="' |
| + | if ($this-> | ||
| + | $content = '< | ||
| + | } | ||
| + | return $this-> | ||
| + | } | ||
| </ | </ | ||
| Line 182: | Line 313: | ||
| php bin/ | php bin/ | ||
| php bin/ | php bin/ | ||
| + | </ | ||
| + | |||
| + | ===== Fix code copy ===== | ||
| + | |||
| + | The code copying replaces empty new lines with space (nbsp;) which are copied via selection or using the copy button. To replace the spaces with actual newlines, create conf/ | ||
| + | <code javascript conf/ | ||
| + | jQuery(function() { | ||
| + | // Helper function to sanitize text formatting | ||
| + | function cleanDokuWikiCodeSpaces(text) { | ||
| + | return text | ||
| + | .replace(/ | ||
| + | .replace(/ | ||
| + | .replace(/ | ||
| + | .replace(/ | ||
| + | } | ||
| + | |||
| + | // FIX 1: Handle standard user manual mouse selections (Ctrl+C) | ||
| + | document.addEventListener(' | ||
| + | const selection = window.getSelection(); | ||
| + | if (selection.rangeCount > 0 && selection.anchorNode.parentElement.closest(' | ||
| + | let cleanedText = cleanDokuWikiCodeSpaces(selection.toString()); | ||
| + | e.clipboardData.setData(' | ||
| + | e.preventDefault(); | ||
| + | } | ||
| + | }); | ||
| + | |||
| + | // FIX 2: Handle DokuWiki Core's Native Async Copy Button | ||
| + | document.addEventListener(' | ||
| + | // Targets DokuWiki' | ||
| + | const btn = e.target.closest(' | ||
| + | if (!btn) return; | ||
| + | |||
| + | // Force monitor the system clipboard immediately following the click | ||
| + | let attempts = 0; | ||
| + | const maxAttempts = 10; | ||
| + | |||
| + | const checkAndCleanClipboard = setInterval(async () => { | ||
| + | attempts++; | ||
| + | try { | ||
| + | let currentText = await navigator.clipboard.readText(); | ||
| + | |||
| + | // If clipboard contains data and has the raw space error, rewrite it immediately | ||
| + | if (currentText && (currentText.includes(' | ||
| + | let cleanedText = cleanDokuWikiCodeSpaces(currentText); | ||
| + | await navigator.clipboard.writeText(cleanedText); | ||
| + | clearInterval(checkAndCleanClipboard); | ||
| + | } | ||
| + | } catch (err) { | ||
| + | // Clipboard permissions might delay slightly, keep trying | ||
| + | } | ||
| + | |||
| + | if (attempts >= maxAttempts) { | ||
| + | clearInterval(checkAndCleanClipboard); | ||
| + | } | ||
| + | }, 30); // Check every 30ms for immediate execution | ||
| + | }); | ||
| + | }); | ||
| + | |||
| </ | </ | ||
synology/dokuwiki.1635944072.txt.gz · Last modified: (external edit)