doc:namespace

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
doc:namespace [2026/03/31 10:11] – [See also] Simon Grantdoc:namespace [2026/04/02 08:44] (current) – [Why is it called a namespace, not just a folder?] Simon Grant
Line 3: Line 3:
 ====== Namespaces in DokuWiki ====== ====== Namespaces in DokuWiki ======
  
-Fear not: this can look very unfamiliar at first sight, but really it's not hard.+Fear not: this can look very unfamiliar at first sight, but it's not really hard.
  
-A namespace in DokuWiki is basically a way of pointing to different parts of the wikijust like folder (or directory) structure on your file system (on your hard drive or wherever) allows you to sort your files into sensible groups, or the way in which many web sites structure their pages into folders or directories. This is a very useful feature in DokuWiki, which isn't available in MediaWiki (and so Wikipedia), or many other wiki systems. That may be why it's not familiar.+A namespace in DokuWiki is basically a way of pointing to different parts of the wiki. It'just like the folder (or directory) structure on your file system (on your hard drive or wherever), which allows you to arrange your files into a tree-like structure of sensible groups. Many web sites arrange their pages into folders or directories. This is a very useful feature in DokuWiki, which isn't available in MediaWiki (and so Wikipedia), or many other wiki systems. That may be why it's not familiar.
  
 Here on this wiki, there is one page at the 'root', with no namespace: the [[:start]] page. If you go there and look at the URL in your browser, you may be able to see `https://knowledge.growingthecommons.org/doku.php/start`.\\ Here on this wiki, there is one page at the 'root', with no namespace: the [[:start]] page. If you go there and look at the URL in your browser, you may be able to see `https://knowledge.growingthecommons.org/doku.php/start`.\\
Line 12: Line 12:
 ''doc'' is actually the name of a folder in the web server where this page is kept. ''doc'' is actually the name of a folder in the web server where this page is kept.
  
-Look at some more examples. Our topic groups are in the namespace (and folder) called ''gt'' (for "group of topics").\\+Look at some more examples. Our topic groups are in the namespace (and folder) called ''gt'' (standing for "group of topics").\\
 If you go to any of these, such as [[gt:community|Community & culture]] you will see the URL is\\ If you go to any of these, such as [[gt:community|Community & culture]] you will see the URL is\\
 `https://knowledge.growingthecommons.org/doku.php/gt/community`.\\ `https://knowledge.growingthecommons.org/doku.php/gt/community`.\\
 The topic group "[[gt:bushcraft|Bushcraft & nature]]" similarly has the URL\\ The topic group "[[gt:bushcraft|Bushcraft & nature]]" similarly has the URL\\
 `https://knowledge.growingthecommons.org/doku.php/gt/bushcraft`.\\ `https://knowledge.growingthecommons.org/doku.php/gt/bushcraft`.\\
-The namespaces allow us to have different pages with the same name, in different namespaces.\\ +The namespaces allow us to have different pages with the same name, as long as they are in different namespaces.\\ 
-So, there is an actual topic, [[bush:bushcraft]], which is in its own namespace, ''bush''. The URL is\\+For each of our topics, we have arbitrarily chosen a four-letter namespace hinting at the topic name. 
 +So, there is an actual topic, [[bush:bushcraft]], which is in its own namespace, ''bush''. The URL for that topic is\\
 `https://knowledge.growingthecommons.org/doku.php/bush/bushcraft`. `https://knowledge.growingthecommons.org/doku.php/bush/bushcraft`.
  
 This is just the same as the fact that you can have two files with the same name in your computer system, provided they sit in different folders. Not just pages, but also images and other files sit in one or another namespace (i.e., folder). This is just the same as the fact that you can have two files with the same name in your computer system, provided they sit in different folders. Not just pages, but also images and other files sit in one or another namespace (i.e., folder).
 +
 +===== Why are namespaces so useful? =====
 +In normal file systems, a folder or directory structure allows its owner to treat files in different folders differently. Similarly, in DokuWiki, the namespace structure allows us to give different permissions to different people, for the various different namespaces. Curators belong to user groups, and the people in each user group have permission to edit pages in the corresponding namespace. This is designed to greatly reduce worries about accidentally editing the wrong pages.
  
 ==== Why is it called a namespace, not just a folder? ==== ==== Why is it called a namespace, not just a folder? ====
  
-A folder or directory structure conventionally uses the slash, `/`, as a delimiter+A folder or directory structure conventionally uses slashes, `/`, as delimiters
-Namespaces conventionally use colons `:` as delimiters.+Namespaces conventionally use a colon `:` as a delimiter.
 There is a lot of history behind this, which is not needed for understanding namespaces in DokuWiki. There is a lot of history behind this, which is not needed for understanding namespaces in DokuWiki.
-It may be enough to say that in DokuWiki, they are essentially the same, except the slash `/` is used in URLs, while the colon `:` is used for internal locations.+Probably enough to say that in DokuWiki, they are essentially the same, except the slash `/` is used in URLs, while the colon `:` is the normal usage for internal locations.
  
 So, this document's internal link is `[[doc:namespace]]` which is simply displayed as [[doc:namespace]].\\ So, this document's internal link is `[[doc:namespace]]` which is simply displayed as [[doc:namespace]].\\
-Actually, `[[doc/namespace]]` also works: [[doc/namespace]]!\\+We have configured our system so that `[[doc/namespace]]` also works, see: [[doc/namespace]]!\\
 For the URL, the link is `https://knowledge.growingthecommons.org/doku.php/doc/namespace`, using slashes.\\ For the URL, the link is `https://knowledge.growingthecommons.org/doku.php/doc/namespace`, using slashes.\\
 Just writing that URL by itself gives what looks like an external link, even though it is in our wiki:\\ Just writing that URL by itself gives what looks like an external link, even though it is in our wiki:\\
Line 40: Line 44:
 This actually works just the same here in Markdown syntax. `[this](doc:namespace)` gives [this](doc:namespace)\\ This actually works just the same here in Markdown syntax. `[this](doc:namespace)` gives [this](doc:namespace)\\
 and `[this](doc/namespace)` gives [this](doc/namespace). and `[this](doc/namespace)` gives [this](doc/namespace).
-===== Why are namespaces so useful? ===== 
-In normal file systems, a folder or directory structure allows its owner to treat files in different folders differently. Similarly, in DokuWiki, the namespace structure allows us to give different permissions to different people, for the various different namespaces. Curators belong to user groups, and the people in each user group have permission to edit pages in the corresponding namespace. This is designed to greatly reduce worries about accidentally editing the wrong pages. 
  
 ===== See also ===== ===== See also =====
   * DokuWiki has extensive documentation around namespaces, including [[doku>pagename]] and [[doku>namespaces]].   * DokuWiki has extensive documentation around namespaces, including [[doku>pagename]] and [[doku>namespaces]].
-  * Wikipedia has a very detailed explanation of [[wp>Namespace]]s+  * Wikipedia has a very detailed explanation of [[wp>Namespace]]s, with much background, for those interested.
  
  
  • doc/namespace.1774951918.txt.gz
  • Last modified: 2026/03/31 10:11
  • by Simon Grant