pWiki/bootstrap/Doc/Path.md
Alex A. Naanou 761f0137be started work on path docs -- simplify!!!
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2016-08-17 05:56:24 +03:00

2.8 KiB

pWiki pWiki Path

XXX a Wiki is a set of pages, mostly top level pages, mosty titled in WikiWord style, pWiki follows this culture but does not restrict either page nesting or title formatting. But following this style is recommended.

XXX write a set of recommendations...

Basic terminology

Path
One or more names separated by "/" that identifies a view.

We call the last name in the path sequence a title.

We call the sub-path without the title a basedir or simply dir.

In pWiki, there is no distinction between a page and a directory, thus we do not use the term, instead, we may use the term sub-page

View
A path that resolves to a page that may or may not be at that specific path.

(see: Page acquisiton below)

Page
A set of data associated with a path.

A page is identified by it's path, but this does not require that every sub-path of that path must exist.

WikiWord
XXX

Page acquisition

XXX motivation

Acquisition process:

  1. if path matches a specific page, target page is found
  2. if path does not match a page:
  3. if title matches a page in the parent path, page is found
  4. repeat until we either have a match or reach root (empty basedir)
  5. if no match is found, check if title exists in [Templates] in basedir
  6. if no match is found, check if title exists in [/System]
  7. if no match is found, repeat process for EmptyPage instead of title

Example:

For path path/to/page the following paths are checked in order and the first matching page is returned:

  • path/to/page
  • path/page
  • page
  • path/to/Templates/page (Check in Templates)
  • path/Templates/page
  • Templates/page
  • System/page (Check in /System, mote that only root /System is checked)
  • path/to/EmptyPage (Check EmptyPage)
  • path/EmptyPage
  • EmptyPage
  • path/to/Templates/EmptyPage
  • path/Templates/EmptyPage
  • Templates/EmptyPage (This is guaranteed to exist)

Exceptions:

  • System/settings is global and can not be overloaded. This is done for security reasons.

Default pages

Templates/EmptyPage

Templates/EmptyToDo

Templates/EmptyOutline

Relative and absolute paths (".", ".." and "/")

Path patterns ("*" and "**")

Path actions

XXX path elements that perform actions on pages but do not actually correspond to actual pages.

Path variables

$NOW

Also see the \@now() macro: [Doc/Macros].

WikiWord

XXX not actualy part of the path spec but a way (culture) to define paths in pages + automatic link creation.