dokuwiki 部署笔记
文章目錄
- dokuwiki 是什么
- dokuwiki 在 Windows 上的安裝
- 方法一:用 XAMPP
- 方法二:用 PHPstudy
- 創(chuàng)建目錄和頁(yè)面
- 修復(fù)不能顯示以中文命名的頁(yè)面
- 如何安裝插件
- 插件推薦
- Add New Page
- indexmenu
- move
- imgpaste
- color
- syntaxhighlighter4
- discussion
- codemirror
- tag
- wrap
- edittable
- filelist
dokuwiki 是什么
任何 wiki 引擎(也稱(chēng)為 wiki 軟件,以下簡(jiǎn)稱(chēng)引擎)都是用來(lái)支持創(chuàng)建、協(xié)同編輯、存儲(chǔ)和使用超鏈接文檔的軟件。編輯通常通過(guò)網(wǎng)頁(yè)瀏覽器進(jìn)行。有時(shí),引擎可以稱(chēng)為知識(shí)管理軟件。
DokuWiki 是一個(gè)開(kāi)源 wiki 引擎,運(yùn)行于PHP環(huán)境下。DokuWiki 程序小巧而功能強(qiáng)大、靈活,適合中小團(tuán)隊(duì)和個(gè)人網(wǎng)站知識(shí)庫(kù)的管理。
dokuwiki 在 Windows 上的安裝
方法一:用 XAMPP
具體方法就不說(shuō)了,網(wǎng)上很多教程
我遇到的麻煩是,網(wǎng)頁(yè)上報(bào)了很多錯(cuò)誤,且布局很奇怪。嘗試各種方法都不行,比如換模板,改配置文件,不管怎么嘗試,都是失敗。
放幾張失敗的圖:
我在想是不是工具的問(wèn)題,能不能換一個(gè)可以代替 XAMPP 的工具?
方法二:用 PHPstudy
官網(wǎng)地址:https://www.xp.cn/
PHPStudy 支持一鍵 LAMP、LNMP、FTP 等 100 多項(xiàng)服務(wù)器管理功能(官網(wǎng)說(shuō)的)。
下載后,傻瓜安裝。
啟動(dòng) Apache 或者 Nginx
點(diǎn)擊左邊的【網(wǎng)站】可以看端口,右邊的【管理】–【修改】可以修改端口。
接著,進(jìn)入網(wǎng)站根目錄(WWW目錄)右邊的【管理】–【打開(kāi)根目錄】,把 dokuwiki 拷貝到 WWW 目錄中,解壓。
進(jìn)入 dokuwiki 目錄可以看到有一個(gè) install.php
在瀏覽器中訪問(wèn) localhost:8081/dokuwiki/install.php,進(jìn)行簡(jiǎn)單配置
填寫(xiě)完之后就可以進(jìn)入 wiki 主頁(yè)了
如果前面設(shè)置了中文,大概長(zhǎng)這樣
創(chuàng)建目錄和頁(yè)面
創(chuàng)建目錄和頁(yè)面。有兩種方法,一種是直接在 pages 目錄下創(chuàng)建文件夾和文本文件,一種是借助插件,在網(wǎng)頁(yè)上操作。
我在 page 目錄下創(chuàng)建了文件夾 “車(chē)子”,又在“車(chē)子”里面創(chuàng)建了一個(gè)文本文件:我是車(chē)子.txt
這時(shí)候點(diǎn)擊網(wǎng)站地圖,會(huì)發(fā)現(xiàn)車(chē)子下面什么都沒(méi)有,看不到“我是車(chē)子.txt”
也就是說(shuō),中文命名空間(可以把命名空間理解為文件夾)下不能顯示以中文命名的文本文件。
好在這個(gè)問(wèn)題可以修復(fù)。
修復(fù)不能顯示以中文命名的頁(yè)面
進(jìn)入 dokuwiki 安裝目錄下的 inc文件夾,打開(kāi) pageutils.php
把 utf8_encodeFN 函數(shù)中的 2 行注釋掉
function utf8_encodeFN($file,$safe=true){global $conf;if($conf['fnencode'] == 'utf-8') return $file;if($safe && preg_match('#^[a-zA-Z0-9/_\-\.%]+$#',$file)){return $file;}if($conf['fnencode'] == 'safe'){return SafeFN::encode($file);}// $file = urlencode($file);// $file = str_replace('%2F','/',$file); chezireturn $file; }13-14 注釋掉
修改 utf8_decodeFN 函數(shù)
function utf8_decodeFN($file){global $conf;if($conf['fnencode'] == 'utf-8') return $file;if($conf['fnencode'] == 'safe'){return SafeFN::decode($file);}return $file;//return urldecode($file); cjy }第 9 行注釋掉,添加第 8 行
如何安裝插件
安裝插件的方法有 2 種,一種是在線(xiàn)安裝;一種是先下載插件包,然后在本地安裝。
先說(shuō)第一種方法。
以管理員身份登錄,點(diǎn)擊右上角的管理,再點(diǎn)擊擴(kuò)展管理器。
輸入插件的名字或者關(guān)鍵字,點(diǎn)擊放大鏡按鈕。
如果有匹配的,就會(huì)顯示出來(lái),點(diǎn)擊你要的進(jìn)行安裝。
不管安裝成功與否,都有提示。比如一個(gè)失敗的圖片:
也有可能是下載不了,比如:
遇到這種情況,就要找到下載地址,想辦法下載下來(lái)。
有了安裝包后,手動(dòng)安裝。手動(dòng)安裝有 2 種方法,一種是直接解壓到 dokuwiki\lib\plugins 目錄,如果需要的話(huà)還要修改文件夾的名字(The base name of the plugin can be found in plugin.info.txt);另一種是通過(guò)按鈕來(lái)安裝,如下圖
點(diǎn)擊手動(dòng)安裝,然后選擇下載的安裝包(不用解壓),再點(diǎn)安裝。
插件推薦
根據(jù)網(wǎng)友的推薦,七七八八裝了好多,plugins 目錄如下(里面有好多都是自帶的):
對(duì)于每個(gè)文件夾,你都可以進(jìn)去看看,能獲得不少關(guān)于本插件的信息,比如下載地址,使用說(shuō)明,配置文件等等。
Add New Page
# General Plugin Info base addnewpage author Benjamin Santalucia, Sam Wilson, Michael Braun, Gerrit Uitslag, Albert Chern email date 2015-11-02 name Add New Page desc Adds a "new page form" to any wiki page. url http://www.dokuwiki.org/plugin:addnewpage下載地址:http://www.dokuwiki.org/plugin:addnewpage
安裝了這個(gè)插件后,用戶(hù)可以通過(guò)瀏覽器頁(yè)面創(chuàng)建命名空間和頁(yè)面。
如何設(shè)置呢?
點(diǎn)擊 welcom 界面,再點(diǎn)擊 sidebar
這時(shí)候會(huì)顯示“該主題尚不存在”,點(diǎn)擊右側(cè)的“創(chuàng)建該頁(yè)面”,輸入 {{NEWPAGE}},再保存,就 OK 了。
indexmenu
base indexmenu author Samuele Tognini email samuele@samuele.netsons.org date 2020-07-31 name Indexmenu Plugin desc Show a customizable and sortable index for a namespace url https://www.dokuwiki.org/plugin:indexmenu下載地址: https://www.dokuwiki.org/plugin:indexmenu
此插件允許您插入一個(gè)完全可自定義的索引或從指定命名空間開(kāi)始的頁(yè)面列表。
我覺(jué)得這個(gè)插件最有用的地方是可以在邊欄增加一個(gè)導(dǎo)航列表。
設(shè)置方法:
安裝完之后,在 sidebar 頁(yè)面的尾部添加
{{indexmenu>:}}
效果:
move
base move author Michael Hamann, Gary Owen, Arno Puschmann, Christoph J?hnigen email michael@content-space.de date 2018-04-30 name Move plugin desc Move and rename pages and media files whilst maintaining the links. url http://www.dokuwiki.org/plugin:move下載地址:http://www.dokuwiki.org/plugin:move
這個(gè)插件允許移動(dòng)包含媒體文件的頁(yè)面和名稱(chēng)空間,并自動(dòng)調(diào)整指向這些頁(yè)面的所有鏈接和媒體引用。
注意:這個(gè)插件將文件移動(dòng)到 DokuWiki 數(shù)據(jù)目錄中,并且可以自動(dòng)更改很多頁(yè)面。盡管插件已經(jīng)被成功測(cè)試過(guò),但是在你的情況下總是可能有些東西不能正常工作,而且你的 wiki 可能處于不一致的狀態(tài)。這個(gè)插件還是相當(dāng)新的,在某些情況下可能表現(xiàn)不正確。
Please make a backup before using this plugin, especially if you plan to make larger changes!
警告: 此插件不更新 ACL 規(guī)則。例如,如果您有一個(gè) ACL 規(guī)則,該規(guī)則對(duì)某個(gè) wiki 頁(yè)面進(jìn)行讀保護(hù),那么在移動(dòng)該頁(yè)面之后,該規(guī)則將不再有任何效果。
除了重命名一個(gè)頁(yè)面外,該插件需要管理員特權(quán)才能使用。
使用方法:以管理員身份登錄,點(diǎn)擊右上角的“管理”
點(diǎn)擊【頁(yè)面移動(dòng)/重命名】
點(diǎn)擊樹(shù)形移動(dòng)
直接拖動(dòng)目錄。紅框里的按鈕是為重命名準(zhǔn)備的。
imgpaste
base imgpaste author Andreas Gohr email dokuwiki@cosmocode.de date 2018-05-03 name imgpaste plugin desc Add images via cut'n'paste in Chrome url http://www.dokuwiki.org/plugin:imgpaste下載地址:http://www.dokuwiki.org/plugin:imgpaste
這個(gè)插件允許通過(guò)簡(jiǎn)單的粘貼圖片到編輯器中來(lái)插入圖片。這對(duì)插入截圖特別有用。請(qǐng)注意這個(gè)插件工作在 Chrome 瀏覽器,Opera (從15版本開(kāi)始) ,Firefox 52,Safari (iOS)。
可以指定圖像名稱(chēng)的構(gòu)造方式。您應(yīng)該確保構(gòu)造的名稱(chēng)是唯一的(通過(guò)使用當(dāng)前時(shí)間)。除了 strftime 通配符,還可以使用以下占位符:
color
base color author Harald Hanche-Olsen email harald.hanche-olsen@ntnu.no date 2018-10-12 name color syntax plugin desc Write colored text in DokuWiki. url https://www.dokuwiki.org/plugin:color下載地址:https://www.dokuwiki.org/plugin:color
作用:可以顯示出有顏色的字
例如編輯框輸入:
<color green>text</color> <color blue/lightgrey>text</color> <color #FF0000>text</color> <color /#FFff00>text</color> <color rgb(80%,0%,0%)/rgb(100%,80%,100%)>text</color> <color hsl(120,100%,30%)/hsl(180,50%,90%)>text</color><color #008080>蔥綠色</color>、<color #ED6F00>橘橙色</color>、<color #BFAA15>蕉黃色</color>、 <color #FF00FF>桃紅色</color>、<color #0000FF>藍(lán)色</color>、<color #FF0000>紅色</color>、 <color #008000>綠色</color>、<color #5F00BD>紫色</color>、<color #FF9900>橙黃色</color>、 <color #000000>黑色</color>、<color #808080>銀色</color>、<color #FF8080>蟠桃色</color>、 <color #66CCFF>天藍(lán)色</color>、<color #66FFCC>薄荷綠</color>、<color #BA0033>棗紅色</color>、 <color #000080>海軍藍(lán)</color>、<color #FF4E00>橙紅色</color>、<color #7FB80E>青綠色</color>、 <color #E54C4C>淺胭脂</color>、<color #D6006F>牡丹紅</color>、<color #534948>鴿羽灰</color>、 <color #AE35FF>淺紫色</color>、<color #2A5CAA>琉璃藍(lán)</color>、<color #800080>紫蘿蘭</color>、 <color #8567B6>江戶(hù)紫</color>、<color #700000>棕色</color>、<color #897B52>褐金色</color>、 <color #FFCE00>金黃色</color>。您還可以自行塡入網(wǎng)頁(yè)顏色的十六進(jìn)制代碼(Hex triplet),調(diào)配想要的文字色彩。例如: <color #FF84BA>粉紅色</color>、<color #58C3E0>水藍(lán)色</color>、<color #E85700>大橙色</color>、 <color #EEDD65>奶油黃</color>、<color #983333>深胭脂</color>等。效果:
syntaxhighlighter4
base syntaxhighlighter4 author CrazyMax email contact@crazymax.dev date 2020-05-13 name SyntaxHighlighter4 Plugin desc Alternative to GeSHi server-side code highlighting with client-side SyntaxHighlighter 4 by Alex Gorbatchev url http://www.dokuwiki.org/plugin:syntaxhighlighter4下載地址:https://www.dokuwiki.org/plugin:syntaxhighlighter4
作用:代碼高亮
作者還舉了例子,在編輯欄輸入
<sxh php; highlight: [11-15]>/*** [Custom event handler which performs action]** @param Doku_Event $event event object by reference* @param mixed $param [the parameters passed as fifth argument to register_hook() when this* handler was registered]* @return void*/public function handle_metaheader(Doku_Event &$event, $param) {// Add SyntaxHighlighter theme.$event->data['link'][] = array('rel' => 'stylesheet','type' => 'text/css','href' => DOKU_BASE . 'lib/plugins/syntaxhighlighter4/dist/'.$this->getConf('theme'),);// Register SyntaxHighlighter javascript.$event->data["script"][] = array("type" => "text/javascript","src" => DOKU_BASE . "lib/plugins/syntaxhighlighter4/dist/syntaxhighlighter.js","_data" => "");} </sxh>效果圖:
discussion
base discussionauthor Michael Hamann, Gerrit Uitslag, Gina H?ussge, Christopher Smith, Michael Klier, Esther Brunner, Matthias Schulteemail michael@content-space.dedate 2020-09-24name discussion plugindesc Provides discussion funtionality for wiki pagesurl https://dokuwiki.org/plugin:discussion作用:為你的 Wiki 頁(yè)面增加評(píng)論功能。如果你不想給普通用戶(hù)編輯頁(yè)面的權(quán)利,但仍然希望用戶(hù)提供筆記,那么這樣做可以將頁(yè)面內(nèi)容和討論區(qū)分開(kāi)來(lái)。
下載地址和使用方法: https://www.dokuwiki.org/plugin:discussion
在頁(yè)面的最后,添加 ~~DISCUSSION~~ 來(lái)開(kāi)啟討論。
要關(guān)閉討論,使用 ~~DISCUSSION:off~~
如果你想顯示現(xiàn)有的討論,但不想允許新的評(píng)論/回復(fù),使用 ~~DISCUSSION:closed~~
我們動(dòng)手試試。
保存后會(huì)看到:
使用 ~~DISCUSSION:off~~關(guān)閉后,評(píng)論內(nèi)容和評(píng)論框就不見(jiàn)了,好像什么都沒(méi)有發(fā)生過(guò)。
使用 ~~DISCUSSION:closed~~ 的情況:
codemirror
base codemirrorauthor Albert Gasset (fix by CosmoCode)email albertgasset@fsfe.orgdate 2020-09-05name CodeMirror plugindesc Editor with syntax highlightingurl https://github.com/albertgasset/dokuwiki-plugin-codemirror下載地址:https://github.com/albertgasset/dokuwiki-plugin-codemirror
作用:對(duì)編輯框里面的文本做語(yǔ)法著色
例如:
tag
base tagauthor Michael Hamann, Gina H?ussge, Christopher Smith, Michael Klier, Esther Brunneremail michael@content-space.dedate 2020-12-02name Tag Plugindesc tag wiki pagesurl https://www.dokuwiki.org/plugin:tag作用:給頁(yè)面添加標(biāo)簽。
用法舉例:{{tag>溫柔 美麗 智慧}}
另外還可以搜索標(biāo)簽,計(jì)數(shù)標(biāo)簽,顯示包含某些標(biāo)簽的頁(yè)面列表等等。
參考:https://www.dokuwiki.org/plugin:tag
這里要提醒大家:不推薦將 Tag 作為分類(lèi)使用,而更多當(dāng)做【印象】使用!
wrap
base wrap author Anika Henke email anika@selfthinker.org date 2018-04-22 name Wrap Plugin desc Universal plugin which combines functionalities of many other plugins. Wrap wiki text inside containers (divs or spans) and give them a class (choose from a variety of preset classes), a width and/or a language with its associated text direction. url https://www.dokuwiki.org/plugin:wrap #syntax See example.txt通用插件,它結(jié)合了許多其他插件的功能。在容器中包裝 wiki 文本(div 或 span)并給它們一個(gè)類(lèi)(從各種預(yù)設(shè)類(lèi)中選擇)、一個(gè)寬度和/或一種帶有相關(guān)文本方向的語(yǔ)言。
我看上它是因?yàn)榭梢宰屛谋咀兊没ㄉ谝恍?#xff0c;哈哈哈。
<WRAP tip>tip</WRAP> <WRAP important>important</WRAP> <WRAP alert>alert</WRAP> <WRAP download>download</WRAP> <WRAP todo> todo </WRAP>效果:
edittable
base edittable author Andreas Gohr email dokuwiki@cosmocode.de date 2020-11-09 name EditTable plugin desc Provide a custom editor for tables url https://www.dokuwiki.org/plugin:edittable下載地址:https://www.dokuwiki.org/plugin:edittable
作用:可以在頁(yè)面上友好地編輯表格。
例如:
點(diǎn)擊“編輯”
對(duì)于不熟悉用文本編輯表格的小伙伴,是個(gè)好工具。
filelist
base filelist author Gina H?u?ge, Dokufreaks email gina@foosel.net, freaks@dokuwiki.org date 2020-09-27 name Filelist Plugin desc Lists files matching a given glob pattern. url https://www.dokuwiki.org/plugin:filelist作用:文件列表插件提供了一種語(yǔ)法,可以將基于通配符的 glob 模式選擇的鏈接和排序的文件列表添加到 wiki 頁(yè)面,從而允許動(dòng)態(tài)地包含任意文件系統(tǒng)位置和媒體名稱(chēng)空間的文件列表。使用 additionalfilename 命令,用戶(hù)還可以從文本中的任意位置添加一個(gè)文件鏈接,用于自動(dòng)保存最新上傳的軟件版本的下載鏈接。
舉例:輸入 {{filelist>lib/images/*&style=list&direct=1}}
效果:
【End】
總結(jié)
以上是生活随笔為你收集整理的dokuwiki 部署笔记的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: java数字类
- 下一篇: dokuwiki 的管理和使用