若將頁面比擬成檔案,那麼命名空間就有如資料夾(或目錄)。
在DokuWiki中,可以使用命名空間來歸納頁面。命名空間的名稱限制與頁面名稱相同。
命名空間毋須事先建立,只要在建立頁面時,頁面名稱裏加上冒號即可,最後一個冒號之後的是頁面名稱,之前的則都是命名空間。若該命名空間尚未建立,系統會自動建立。
(在DokuWiki裏建立頁面的方式與其他wiki一樣,只要建立一個連結指向尚未建立的頁面,然後點擊該連結,再使用「編修頁面」來建立該頁面。) 新增頁面.
| 範例: | |
|---|---|
| example .example .:example | 表示當前命名空間裏的”example”頁面。 |
| :example | refers to the page “表示根部命名空間裏的”example”頁面。 |
| ..example ..:example .:..:example | 表示上層命名空間裏的”example”頁面。 |
| wiki:example | 表示位於”wiki”命名空間裏的”example”頁面。而”wiki”為位於根部之下的命名空間。 |
| ns1:ns2:example :ns1:ns2:example | 表示在命名空間”ns2”裏的”example”頁面;而”ns2”為位於命名空間”ns1”之下的命名空間,”ns1”為位於根部之下的命名空間。 |
| .ns1:ns2:example .:ns1:ns2:example | 表示位於命名空間”ns2”裏的”example”頁面;而”ns2”為位於命名空間”ns1”之下的命名空間,”ns1”為位於當前命名空間之下的命名空間。 |
| ..ns1:ns2:example ..:ns1:ns2:example | 表示位於命名空間”ns2”裏的”example”頁面;而”ns2”為位於命名空間”ns1”之下的命名空間,”ns1”為位於與當前命名空間平行的命名空間。(當前的命名空間與ns1都同樣位於某個上層命名空間裏) |
| .ns1:ns2: | 表示位於命名空間”ns2”裏的”start”頁面;而”ns2”為位於命名空間”ns1”之下的命名空間,”ns1”為位於當前命名空間之下的命名空間。 (start為初始頁面,可以利用configuration setting裏的startpage來修改成其他的名稱。) |
當某個命名空間裏的頁面都被移除,邏輯上這個命名空間也不復存在。Dokuwiki通常也會刪除這個已被清空的目錄。
必須完成以下步驟:
data/pagesdata/media (如果有的話)data/meta內的資料原資料data/attic內的歷史紀錄資料(如果你想保留舊版紀錄,也可以把它們移到別的地方)例如,在Unix主機上,你可以這樣做:
mv /dokuwiki_base/data/pages/old_namespace /dokuwiki_base/data/pages/new_namespacemv /dokuwiki_base/data/media/old_namespace /dokuwiki_base/data/media/new_namespacerm -Rf /dokuwiki_base/data/meta/old_namespacerm -Rf /dokuwiki_base/data/attic/old_namespace
請注意,若不是拉丁系字碼,old_namespace以及/或是new_namespace要先編碼過。(如希臘文、俄文等等)
However, you will still have lots of junk left around. For example in data/changes.log, various files under cache (including the .idx files etc). If possible you could just start from a blank state as follows (again under Unix) but be warned that this will mean losing all your historical information (ie recent changes):
cat /dev/null > /dokuwiki_base/data/changes.logrm -Rf /dokuwiki_base/data/attic/*rm -Rf /dokuwiki_base/data/cache/?rm -Rf /dokuwiki_base/data/cache/*.idxrm -Rf /dokuwiki_base/data/cache/purgefileDISCLAIMER : I understand this is convoluted (and maybe I missed/messed a couple of things you should also do). All in all this is a PITA. You may also use a couple of plugins that are available for (re)building the searchindex for the complete wiki, erasing entire cache and/or old wiki revisions thus avoiding to do this manually.
你可以使用第三方開發者所提供的PageMove外掛來將某個命名空間裏的每個頁面搬到新的命名空間裏。請先參閱相關資料以確認是否符合你的需要。
It is possible to link to a default file of a namespace ending the linkid with a colon: [[foo:bar:]]. To which page the link links is dependent on the existence of certain named files. For [[foo:bar:]] the following pages are checked:
foo:bar:$conf['start'] foo:bar:bar foo:bar
The pages are checked in that order and whatever page is found first will be linked to. Autoplural linking is not done for those links
This feature is only available in 2006-09-28 RC1 version and above.