差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

次のリビジョン
前のリビジョン
dokuwiki:ja:namespaces [2006/11/11] – 作成 admindokuwiki:ja:namespaces [不明な日付] (現在) – 外部編集 (不明な日付) 127.0.0.1
行 1: 行 1:
 +====== 名前空間 ======
  
 +DokuWikiでは、ページをカテゴリに分けるため、"名前空間"と呼ばれるものを使用します。
 +
 +
 +
 +===== 名前空間の作成 =====
 +
 +名前空間を作成する手順が別に用意されているわけではありません。ページ名にコロンを付けてページを作成するだけです。最後のコロンの後ろのものがページの名前そのものになります。その他のものが名前空間です。存在しないページ名に含まれるすべての名前空間は、自動的にDokuWikiによって作成されます。
 +
 +
 +^例:^^
 +|example|現在の名前空間にある"example"ページを参照します。|
 +|:example|ルートの名前空間にある"example"ページを参照します。|
 +|wiki:example|名前空間"wiki"にある"example"ページを参照します。名前空間"wiki"は、ルートの名前空間直下にあります。|
 +|ns1:ns2:example|名前空間ns2にある"example"ページを参照します。名前空間"ns2"は、名前空間ns1にあり、名前空間ns1は、ルートの名前空間直下にあります。|
 +|:ns1:ns2:example|上記と同様です。|
 +|.ns1:ns2:example|名前空間ns2にある"example"ページを参照します。名前空間"ns2"は、名前空間ns1にあり、名前空間ns1は、現在の名前空間の下にあります。|
 +|.ns1:ns2:|名前空間ns2にある"start"ページを参照します。名前空間ns2は、名前空間ns1にあり、名前空間ns1は現在の名前空間の下にあります。|
 +
 +===== 名前空間の削除 =====
 +
 +名前空間内のすべてのページが削除されたとき、名前空間は論理的に存在しなくなります。DokuWikiは通常、同様に空のディレクトリを削除します。
 +
 +======= 名前空間のリネームの仕方 =====
 +
 +[[http://www.isection.co.uk/doku.php|PageMove plugin]]を使うと、古い名前空間から新しい名前空間へページを移動することができます。必要であればドキュメントを参考にしてください。
 +
 +The manual way is more difficult:
 +  * Rename the folders that represent the namespace in:
 +    * ''data/pages''
 +    * ''data/media'' (if this exists)
 +  * Remove metadata for the namespace under ''data/meta''
 +  * Remove attic data for the namespace under ''data/attic''
 +  
 +For example, on a Unix host, you could:
 +  * ''mv /dokuwiki_base/data/pages/old_namespace /dokuwiki_base/data/pages/new_namespace''
 +  * ''mv /dokuwiki_base/data/media/old_namespace /dokuwiki_base/data/media/new_namespace''
 +  * ''rm -Rf /dokuwiki_base/data/meta/old_namespace''
 +  * ''rm -Rf /dokuwiki_base/data/attic/old_namespace''
 +
 +
 +Note that the ''old_namespace'' and/or ''new_namespace'' words may need to be encoded if they are on a non-latin character set (ie Greek, Russian etc).
 +
 +  * Correct (by editing them) all the links to the pages under the //moved// namespace (you can discover those before moving the namespace by reviewing each page's backlinks).
 +
 +  * Browse each and every page under the new namespace. This will create the missing indexing information and metadata for the pages under the moved 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.log''
 +  * ''rm -Rf /dokuwiki_base/data/attic/*''
 +  * ''rm -Rf /dokuwiki_base/data/cache/?''
 +  * ''rm -Rf /dokuwiki_base/data/cache/*.idx''
 +  * ''rm -Rf /dokuwiki_base/data/cache/purgefile''
 +  * Browse each and every page of your Wiki.
 +
 +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 [[wiki: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 manualy.
 +
 +===== 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
 +existance of certain named files. For %%[[foo:bar:]]%% the following pages are
 +checked:
 +
 +<code>
 +foo:bar:$conf['start']
 +foo:bar:bar
 +foo:bar
 +</code>
 +
 +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.**