目錄表

命名空間 Namespaces

若將頁面比擬成檔案,那麼命名空間就有如資料夾(或目錄)。

在DokuWiki中,可以使用命名空間來歸納頁面。命名空間的名稱限制與頁面名稱相同。

建立命名空間 Creating Namespaces

命名空間毋須事先建立,只要在建立頁面時,頁面名稱裏加上冒號即可,最後一個冒號之後的是頁面名稱,之前的則都是命名空間。若該命名空間尚未建立,系統會自動建立。

(在DokuWiki裏建立頁面的方式與其他wiki一樣,只要建立一個連結指向尚未建立的頁面,然後點擊該連結,再使用「編修頁面」來建立該頁面。) 新增頁面.

範例:
example
.example
.:example
表示當前命名空間裏的”example”頁面。
:examplerefers 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來修改成其他的名稱。)

刪除命名空間 Deleting Namespaces

當某個命名空間裏的頁面都被移除,邏輯上這個命名空間也不復存在。Dokuwiki通常也會刪除這個已被清空的目錄。

如何修改命名空間的名稱? How to rename namespaces?

手動方式

必須完成以下步驟:

例如,在Unix主機上,你可以這樣做:

請注意,若不是拉丁系字碼,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):

DISCLAIMER : 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.

使用外掛 Plugin way

你可以使用第三方開發者所提供的PageMove外掛來將某個命名空間裏的每個頁面搬到新的命名空間裏。請先參閱相關資料以確認是否符合你的需要。

Namespace Default Linking

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.