import of Diogenes 0.9.18
[diogenes.git] / include / Text / Wiki / Render / Xhtml / Heading.php
diff --git a/include/Text/Wiki/Render/Xhtml/Heading.php b/include/Text/Wiki/Render/Xhtml/Heading.php
new file mode 100644 (file)
index 0000000..c5e3074
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+
+class Text_Wiki_Render_Xhtml_Heading extends Text_Wiki_Render {
+    
+    var $conf = array(
+        'css_h1' => null,
+        'css_h2' => null,
+        'css_h3' => null,
+        'css_h4' => null,
+        'css_h5' => null,
+        'css_h6' => null
+    );
+    
+    function token($options)
+    {
+        // get nice variable names (id, type, level)
+        extract($options);
+        
+        if ($type == 'start') {
+            $css = $this->formatConf(' class="%s"', "css_h$level");
+            return "<h$level$css id=\"$id\">";
+        }
+        
+        if ($type == 'end') {
+            return "</h$level>\n";
+        }
+    }
+}
+?>
\ No newline at end of file