From 0bbd3558ac2e0c994ae60be63a97476e936a3d47 Mon Sep 17 00:00:00 2001
From: "Mirar (Pontus Hagland)" <pike@sort.mirar.org>
Date: Mon, 10 Nov 1997 19:13:01 +0100
Subject: [PATCH] one page per section

Rev: tutorial/html_section_pages.pike:1.1
---
 tutorial/html_section_pages.pike | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 tutorial/html_section_pages.pike

diff --git a/tutorial/html_section_pages.pike b/tutorial/html_section_pages.pike
new file mode 100644
index 0000000000..6e55e11762
--- /dev/null
+++ b/tutorial/html_section_pages.pike
@@ -0,0 +1,25 @@
+inherit "html.pike";
+
+void split_and_remove_section(object t,object prev)
+{
+   if (t->data)
+      foreach (t->data,object t2)
+	 if (objectp(t2))
+	 {
+	    split_and_remove_section(t2,t->tag=="anchor"?t:0);
+	    if (t2->tag=="section")
+	    {
+	       object tq;
+	       if (prev)
+	       {
+		  sections[t2->params->number]=({t});
+		  prev->data-=({t});
+	       }
+	       else
+	       {
+		  sections[t2->params->number]=({t2});
+		  t->data-=({t2});
+	       }
+	    }
+	 }
+}
-- 
GitLab