To jest stara wersja strony!
Spis treści
Przestrzenie nazw
Przestrzeń nazw jest podobna do folderu, podczas gdy nazwy stron wykazują podobieństwo do plików. Możesz użyć przestrzeni nazw by porządkować strony w DokuWiki. Nazwy przestrzeni nazw mają takie same ograniczenia jak nazwy stron.
Domyślnie instalacja DokuWiki zawiera wbudowaną przestrzeń nazw: wiki.
Tworzenie przestrzeni nazw
Nie musisz tworzyć przestrzeni nazw oddzielnie; po prostu utwórz strony z dwukropkami w nazwie strony. Słowo po ostatnim dwukropku stanie się stroną, podczas gdy pozostałe słowa będą przestrzeniami nazw. Wszystkie przestrzenie nazw użyte w nazwie strony, które nie istniały przed tworzeniem strony, zostaną utworzone automatycznie przez DokuWiki.
(Strony w DokuWiki są tworzone tak, jak we wszystkich innych wiki. Po prostu utwórz link do nieistniejącej strony, wejdź w ten link, po czym wciśnij Utwórz stronę.) Patrz Dodawanie stron.
Przykłady: | |
---|---|
example .example .:example | odnosi sie do strony „example” w aktualnej przestrzeni nazw. |
:example | odnosi się do strony „example” w głównej (root) przestrzeni nazw. |
..example ..:example .:..:example | odnosi się do strony „example” w nadrzędnej przestrzeni nazw. |
wiki:example | odnosi się do strony „example” w przestrzeni nazw „wiki”. przestrzeń nazw „wiki” położona jest wewnątrz głównej przestrzeni nazw. |
ns1:ns2:example :ns1:ns2:example | odnosi się do strony „example” w przestrzeni nazw ns2. Przestrzeń nazw ns2 leży wewnątrz przestrzeni nazw ns1; przestrzeń nazw ns1 leży wewnątrz głównej przestrzeni nazw. |
.ns1:ns2:example .:ns1:ns2:example | odnosi się do strony „example” w przestrzeni nazw ns2. Przestrzeń nazw ns2 leży wewnątrz przestrzeni nazw ns1; przestrzeń nazw ns1 leży wewnątrz aktualnej przestrzeni nazw. |
..ns1:ns2:example ..:ns1:ns2:example | odnosi się do strony „example” w przestrzeni nazw ns2. Przestrzeń nazw ns2 leży wewnątrz przestrzeni nazw ns1; przestrzeń nazw ns1 leży nadrzędnej dla aktualnej przestrzeni nazw (tj. zarówno ns1 jak i aktualna przestrzeń nazw leżą wewnątrz tej samej nadrzędnej przestrzeni nazw, gdziekolwiek względem głównej przestrzeni nazw ta przestrzeń by się nie znajdowała). |
.ns1:ns2: .:ns1:ns2: | odnosi się do strony „start” w przestrzeni nazw ns2. Przestrzeń nazw ns2 leży wewnątrz przestrzeni nazw ns1; przestrzeń nazw ns1 leży w aktualnej przestrzeni nazw. (Domyślna strona może nazywać się inaczej niż „start” wedle ustawień parametru konfiguracji startpage.) |
Pułapka: Składnia dla względnych i bezwzględnych linków wewnętrznych nie jest unikalna i złożona względem konwencji nazewniczej folderów i plików. Ścieżka jest bezwzględna wtedy i tylko wtedy, gdy zaczyna się od „/”. Linki są bezwzględne wtedy i tylko wtedy, gdy mają na początku „:” lub nie mają przedrostka, ale mają wewnątrz (lub na końcu) „:” Linki względne do aktualnej przestrzeni nazw mogż zaczynać się od „.” albo „.:” („..” albo „..:” dla nadrzędnej przestrzeni nazw).
Deleting Namespaces
When all pages inside a namespace are removed the namespace logically doesn’t exist anymore. DokuWiki usually deletes the now empty directory as well.
How to rename namespaces?
Manual way
In order to rename a namespace manually you will have to:
- 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
(or move that over as well, if you want to preserve old versions)
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 (i.e. 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 (i.e. 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.
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
You can use the third-party PageMove plugin to move each of the pages from the old namespace to the new one. Please consult the documentation to see if this fits your needs. Note - the PageMove plugin is not working and is currently deprecated
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.