From 486f460132434db1eaff92dcadb265011f394bf1 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 15 Jul 2008 16:09:40 +0200 Subject: pedigree rename to parentlinks: renamed files, to start with Signed-off-by: intrigeri --- doc/plugins/parentlinks.mdwn | 113 +++++++++++++++++++++++++++++++++++++++++++ doc/plugins/pedigree.mdwn | 113 ------------------------------------------- 2 files changed, 113 insertions(+), 113 deletions(-) create mode 100644 doc/plugins/parentlinks.mdwn delete mode 100644 doc/plugins/pedigree.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/parentlinks.mdwn b/doc/plugins/parentlinks.mdwn new file mode 100644 index 000000000..15c032838 --- /dev/null +++ b/doc/plugins/parentlinks.mdwn @@ -0,0 +1,113 @@ +[[!template id=plugin name=pedigree author="intrigeri"]] +[[!tag type/useful]] + +This plugin offers a `HTML::Template` loop that iterates over all or +a subset of a page's parents, providing a few bonus possibilities, +such as styling the parent links depending on their place in the path. +One can think of pedigree as "`PARENTLINKS` on steroids". + +[[!toc ]] + +Content +======= + +This plugin provides one template loop, called `PEDIGREE`, that +returns the same parents list as `PARENTLINKS` would; as a bonus, +every path element returned by the `PEDIGREE` loop has the following +variables set: + +* `URL` (string): url to the current path element +* `PAGE` (string): title of the current path element +* `DEPTH` (positive integer): depth of the path leading to the + current path element, counting from the wiki's root, which has + `DEPTH=0` +* `HEIGHT` (positive integer): distance, expressed in path elements, + from the current page to the current path element; e.g. this is + 1 for the current page's mother, 2 for its grand-mother, etc. +* `DEPTH_n` (boolean): true if, and only if, `DEPTH==n` +* `HEIGHT_n` (boolean): true if, and only if, `HEIGHT==n` + +Usage +===== + +The `DEPTH_n` and `HEIGHT_n` variables allow the template writer to +skip arbitrary elements in the parents list: they are arbitrary +page-range selectors. + +The `DEPTH` and `HEIGHT` variables allow the template writer to apply +general treatment, depending on one of these variables, to *every* +parent: they are counters. + +Styling parents depending on their depth +---------------------------------------- + +Say you want the parent links to be styled depending on their depth in +the path going from the wiki root to the current page; just add the +following lines in `page.tmpl`: + + + " class="depth"> + + / + + +Then write the appropriate CSS bits for `a.depth1`, etc. + +Skip some parents, style the others depending on their distance to the current page +----------------------------------------------------------------------------------- + +Say you want to display all the parents links but the wiki homepage, +styled depending on their distance to the current page; just add the +following lines in `page.tmpl`: + + + + + " class="height"> + + / + + +Then write the appropriate CSS bits for `a.height1`, etc. + +Full-blown example +------------------ + +Let's have a look at a more complicated example; combining the boolean +loop variables provided by this plugin (`IS_ROOT` and friends) and +`HTML::Template` flow control structures, you can have custom HTML +and/or CSS generated for some special path components; e.g.: + + +
+
    + + + + + +
  • ">
  • +
    +
    +
    +
+
+ + + + +
+ "> +
+ + +
+ "> +
+
+
+
+ + + + diff --git a/doc/plugins/pedigree.mdwn b/doc/plugins/pedigree.mdwn deleted file mode 100644 index 15c032838..000000000 --- a/doc/plugins/pedigree.mdwn +++ /dev/null @@ -1,113 +0,0 @@ -[[!template id=plugin name=pedigree author="intrigeri"]] -[[!tag type/useful]] - -This plugin offers a `HTML::Template` loop that iterates over all or -a subset of a page's parents, providing a few bonus possibilities, -such as styling the parent links depending on their place in the path. -One can think of pedigree as "`PARENTLINKS` on steroids". - -[[!toc ]] - -Content -======= - -This plugin provides one template loop, called `PEDIGREE`, that -returns the same parents list as `PARENTLINKS` would; as a bonus, -every path element returned by the `PEDIGREE` loop has the following -variables set: - -* `URL` (string): url to the current path element -* `PAGE` (string): title of the current path element -* `DEPTH` (positive integer): depth of the path leading to the - current path element, counting from the wiki's root, which has - `DEPTH=0` -* `HEIGHT` (positive integer): distance, expressed in path elements, - from the current page to the current path element; e.g. this is - 1 for the current page's mother, 2 for its grand-mother, etc. -* `DEPTH_n` (boolean): true if, and only if, `DEPTH==n` -* `HEIGHT_n` (boolean): true if, and only if, `HEIGHT==n` - -Usage -===== - -The `DEPTH_n` and `HEIGHT_n` variables allow the template writer to -skip arbitrary elements in the parents list: they are arbitrary -page-range selectors. - -The `DEPTH` and `HEIGHT` variables allow the template writer to apply -general treatment, depending on one of these variables, to *every* -parent: they are counters. - -Styling parents depending on their depth ----------------------------------------- - -Say you want the parent links to be styled depending on their depth in -the path going from the wiki root to the current page; just add the -following lines in `page.tmpl`: - - - " class="depth"> - - / - - -Then write the appropriate CSS bits for `a.depth1`, etc. - -Skip some parents, style the others depending on their distance to the current page ------------------------------------------------------------------------------------ - -Say you want to display all the parents links but the wiki homepage, -styled depending on their distance to the current page; just add the -following lines in `page.tmpl`: - - - - - " class="height"> - - / - - -Then write the appropriate CSS bits for `a.height1`, etc. - -Full-blown example ------------------- - -Let's have a look at a more complicated example; combining the boolean -loop variables provided by this plugin (`IS_ROOT` and friends) and -`HTML::Template` flow control structures, you can have custom HTML -and/or CSS generated for some special path components; e.g.: - - -
-
    - - - - - -
  • ">
  • -
    -
    -
    -
-
- - - - -
- "> -
- - -
- "> -
-
-
-
- - - - -- cgit v1.2.3