documentation:namespaces

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
documentation:namespaces [2014/03/26 09:33] milicicdocumentation:namespaces [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== Namespaces ====== 
-A namespace is similar to a directory or folder, while pagenames are similar to files. Namespaces are used to categorize the pages and to restrict access to certain users and groups. [[:start?do=index|Sitemap]] 
----- 
-===== Pagenames and Namespaces ===== 
  
-You may picture namespaces as directories and pagenames as files inside them.  
- 
-Therefore the ''a:b:c'' pagename can be pictured as: 
- 
-<file> 
- 
-   root namespace (always present) 
-     │ 
-     └── 'a' namespace 
-          │ 
-          └── 'b' namespace 
-               │ 
-               └── 'c' pagename 
- 
-</file> 
- 
-Note that you can have a pagename and a namespace with the same name, at the same time, within any namespace. Back to the above example, the ''a:b'' pagename can be pictured as: 
- 
-<file> 
- 
-   root namespace (always present) 
-     │ 
-     └── 'a' namespace 
-          │ 
-          └── 'b' pagename (not to be confused with the 'b' namespace above) 
- 
-</file> 
- 
-This doesn't lead to conflicts, because DokuWiki treats the final token (the one after the last colon) as the name of the [[page]] itself, while all other tokens are namespaces.   
- 
-  * In ''a:b:c'', ''a'' and ''b'' are namespaces while ''c'' is a page. 
-  * In ''a:b'', ''a'' is interpreted as a namespace and ''b'' as a page. 
- 
----- 
-===== Creating Namespaces ===== 
- 
-You don't need to create namespaces separately; simply create pages with colons in the [[pagename]].  
-The token after the last colon will be the name of the page itself, while all other tokens are namespaces.  
-All namespaces used in your pagename that don't exist already will be created by DokuWiki automatically. 
- 
-A namespace can be created in the media manager after having selected a file on the local computer and before clicking  ''upload'' 
- 
-In DokuWiki pages are created as in every other wiki. Simply create a link to a non existing page, follow this link, and click on Create this page. See also [[.:page#create_a_page|Adding pages]]. 
- 
-^  Examples:  ^^ 
-|example\\ .example\\ .:example|refers to the page "example" in the **current** namespace.| 
-|:example|refers to the page "example" in the **root** namespace.| 
-|..example\\ ..:example\\ .:..:example|refers to the page "example" in the **parent** namespace| 
-|wiki:example|refers to the page "example" in the namespace "wiki". The namespace "wiki" is located **beneath the root** namespace.| 
-|ns1:ns2:example\\ :ns1:ns2:example|refers to the page "example" in the namespace ns2. The namespace ns2 is located beneath the namespace ns1; the namespace ns1 is located **beneath the root** namespace.| 
-|.ns1:ns2:example\\ .:ns1:ns2:example|refers to the page "example" in the namespace ns2. The namespace ns2 is located beneath the namespace ns1; the namespace ns1 is located **beneath the current** namespace.| 
-|..ns1:ns2:example\\ ..:ns1:ns2:example|refers to the page "example" in the namespace ns2. The namespace ns2 is located beneath the namespace ns1; the namespace ns1 is located **beside the current** namespace (i.e. both ns1 and the current namespace are beneath the same parent namespace, wherever according to the root namespace this parent may be located itself).| 
-|.ns1:ns2:\\ .:ns1:ns2:|refers to the page "start" in the namespace ns2. The namespace ns2 is located beneath the namespace ns1; the namespace ns1 is located beneath the current namespace.\\ \\ (The default page can be named something other than "start" by adjusting the [[config:startpage]] configuration setting.)|  
- 
-:!: Gotcha: The syntax for relative and absolute internal links is non-unique and complex relative to directory and filename conventions. 
- 
-Paths are absolute if and only if they begin with "/". 
- 
-Links are absolute if and only if they have a ":" prefix or have no prefix but do have intermediate (or suffix) ":" 
- 
-Links relative to the current namespace may also begin with either "." or ".:" (".." or "..:" for parent namespace). 
- 
-===== Deleting namespaces ===== 
- 
-When all pages inside a namespace are removed (see [[page#delete_a_page|delete a page]]) the namespace logically doesn’t exist anymore. DokuWiki usually deletes the now empty directory as well.