]> oss.titaniummirror.com Git - webber.git/commitdiff
toc.py, hierarchy.py: add new "Hide: true" page attribute
authorHolger Schurig <holgerschurig@gmail.com>
Thu, 1 Jul 2010 08:51:12 +0000 (10:51 +0200)
committerHolger Schurig <holgerschurig@gmail.com>
Thu, 1 Jul 2010 08:51:12 +0000 (10:51 +0200)
in/index.md
in/overview.md
in/pageformat.md
plugins/hierarchy.py
plugins/toc.py

index 2f9800cd8aee5869e1f87a019b04774c09b82fb9..29d57b7851640ce54fc7e07becaafe59e1de291d 100644 (file)
@@ -2,7 +2,6 @@ title: Webber
 ctime: 2009-06-24
 mtime: 2009-06-24
 
-* [[overview]]
 * [[pageformat]]
 * [[configuration]]
  * [[commandline]]
index 992ba39d82116a60e5587dac137953a2c9e7e18e..ffcb759b46407237b35a3f3667f94cfbc531eea5 100644 (file)
@@ -1,6 +1,7 @@
 title: Overview
 parent: Webber
 ctime: 2009-06-24
+hide: true
 
 *Webber* is a static web-site generation tool, loosely based on ideas
 from IkiWiki and my own likings.
index dd477c1b1bc3adf085377b3984342dcfe95292f1..e0324816e30a097f5ed55fe72c25934c03dfeba5 100644 (file)
@@ -116,6 +116,13 @@ name. For convenience, you can ommit "`.tmpl`".
        template: history
 
 
+== hide ==
+
+       hide: true
+
+will hide the generated page from in the plugins [[hierarchy]] and [[toc]].
+
+
 == description ==
 
 Anything you specify here will be accessible in the template as ${description}.
index 92279c39578d9e9b81c1d9d1919f734b7dc37c85..2c9c4dc4b5e3b5167e90c17580679adc7f24ecfd 100644 (file)
@@ -43,6 +43,11 @@ def memorize_parent(title, parent, order=100):
 @set_hook("scan")
 def scan(params):
        file = params["file"]
+
+       # Ignore hidden pages
+       if file.has_key("hide") and file.hide:
+               return
+
        if file.has_key("links"):
                memorize_links(file.linktitle, file.links)
        if file.has_key("parent"):
index fa22cc362bc60045eb32f7c0d1a47094b613d92e..41d31dc7947e3a8d51ad85678d75b380b1edafdb 100644 (file)
@@ -82,6 +82,10 @@ def linkify(params):
        _labels = {}
        _first = -1
 
+       # Ignore hidden pages
+       if params.file.has_key("hide") and params.file.hide:
+               return
+
        # Very small pages don't need a table-of-contents
        if params.file.contents.count("\n") < toc_min_lines:
                return