Index: .hgignore
===================================================================
--- .hgignore	(revision 1)
+++ .hgignore	(revision 10)
@@ -16,2 +16,3 @@
 ^html/.*
 ^gen-images/.*
+^gen-dox/.*
Index: Doxyfile
===================================================================
--- Doxyfile	(revision 11)
+++ Doxyfile	(revision 12)
@@ -71,5 +71,5 @@
 SHOW_NAMESPACES        = NO
 FILE_VERSION_FILTER    = 
-LAYOUT_FILE            = DoxygenLayout.xml
+LAYOUT_FILE            = ./DoxygenLayout.xml
 #---------------------------------------------------------------------------
 # configuration options related to warning and progress messages
@@ -85,5 +85,5 @@
 # configuration options related to the input files
 #---------------------------------------------------------------------------
-INPUT                  = . \
+INPUT                  = ./gen-dox \
                          ./demo
 INPUT_ENCODING         = UTF-8
Index: Makefile
===================================================================
--- Makefile	(revision 8)
+++ Makefile	(revision 10)
@@ -16,4 +16,6 @@
 
 html: $(PNG_IMAGES)
+	-mkdir gen-dox
+	./titlegen.py
 	doxygen Doxyfile
 
Index: getting_started.dox
===================================================================
--- getting_started.dox	(revision 11)
+++ getting_started.dox	(revision 12)
@@ -19,5 +19,5 @@
 namespace lemon {
 /**
-\page hello_lemon Compile Your First Code
+[PAGE]hello_lemon[PAGE] Compile Your First Code
 
 First of all you have to install LEMON on your system (see
@@ -55,5 +55,5 @@
 Now let us compile this simple example program.
 
-\section hello_lemon_system If LEMON is Installed System-Wide
+[SEC]hello_lemon_system[SEC] If LEMON is Installed System-Wide
 
 If LEMON is installed system-wide (into directory \c /usr/local),
@@ -73,5 +73,5 @@
 \endverbatim
 
-\section hello_lemon_user If LEMON is Installed User-Local
+[SEC]hello_lemon_user[SEC] If LEMON is Installed User-Local
 
 Compiling the code is a bit more difficult if you installed LEMON
@@ -117,4 +117,5 @@
 <a href="mailto:lemon-user@lemon.cs.elte.hu"><b>contact us</b></a>.
 
+[TRAILER]
 */
 }
Index: install.dox
===================================================================
--- install.dox	(revision 11)
+++ install.dox	(revision 12)
@@ -18,5 +18,5 @@
 
 /**
-\page install Installation Guide
+[PAGE]install[PAGE] Installation Guide
 
 In this section we detail how to start using LEMON, from downloading it
@@ -28,5 +28,5 @@
 <a href="mailto:lemon-user@lemon.cs.elte.hu"><b>ask</b></a>.
 
-\section requirements_lemon Hardware and Software Requirements
+[SEC]requirements_lemon[SEC] Hardware and Software Requirements
 
 In LEMON we use C++ templates heavily, thus compilation takes a
@@ -47,5 +47,5 @@
 the instructions detailed here to be able to use LEMON with your compiler.
 
-\subsection requirements_lp LP Solver Requirements
+[SEC]requirements_lp[SEC] LP Solver Requirements
 
 The LEMON LP solver interface can use the GLPK (GNU Linear Programming
@@ -54,5 +54,5 @@
 See the <b><tt>INSTALL</tt></b> file how to enable these at compile time.
 
-\section install_from_source Install from Source
+[SEC]install_from_source[SEC] Install from Source
 
 You can download LEMON from the web site:
@@ -142,5 +142,5 @@
 For more information see the <b><tt>INSTALL</tt></b> file.
 
-\subsection install_hg Install the Latest Development Version
+[SEC]install_hg[SEC] Install the Latest Development Version
 
 You can also use the latest (developer) version of LEMON from our Mercurial
@@ -187,19 +187,18 @@
 
 
-\section install_rpm Install from rpm
+[SEC]install_rpm[SEC] Install from rpm
 
 \todo Write this section (\ref install_rpm).
 
-
-\section install_user Install Locally to the User
+[SEC]install_user[SEC] Install Locally to the User
 
 \todo Write this section (\ref install_user).
 
 
-\section compile_codes Compile Codes that Use LEMON
+[SEC]compile_codes[SEC] Compile Codes that Use LEMON
 
 Now let us see how to use the library after installing it.
 
-\subsection compile_system_wide If LEMON is Installed System-Wide
+[SEC]compile_system_wide[SEC] If LEMON is Installed System-Wide
 
 If your installation of LEMON into directory \c /usr/local was
@@ -214,5 +213,5 @@
 installed library LEMON.
 
-\subsection compile_user_local If LEMON is Installed User-Local
+[SEC]compile_user_local[SEC] If LEMON is Installed User-Local
 
 You have to give more options to the compiler if LEMON is installed
@@ -226,7 +225,8 @@
 \endverbatim
 
-\subsubsection compile_use_pkg_config Use pkg-config
+[SEC]compile_use_pkg_config[SEC] Use pkg-config
 
 \todo Write this sub-subsection (\ref compile_use_pkg_config).
 
+[TRAILER]
 */
Index: intro.dox
===================================================================
--- intro.dox	(revision 6)
+++ intro.dox	(revision 10)
@@ -18,7 +18,7 @@
 
 /**
-\page intro Introduction
+[PAGE]intro[PAGE] Introduction
 
-\section intro_lemon What is LEMON
+[SEC]intro_lemon[SEC] What is LEMON
 
 <b>LEMON</b> stands for <b>L</b>ibrary of <b>E</b>fficient <b>M</b>odels and
@@ -43,5 +43,5 @@
 <a href="http://lemon.cs.elte.hu/"><b>http://lemon.cs.elte.hu/</b></a>.
 
-\section intro_tutorial LEMON Tutorial
+[SEC]intro_tutorial[SEC] LEMON Tutorial
 
 This tutorial introduces the reader to the basic concepts and features of
@@ -53,3 +53,6 @@
 as a reference manual).
 
+
+[TRAILER]
+
 */
Index: license.dox
===================================================================
--- license.dox	(revision 3)
+++ license.dox	(revision 10)
@@ -19,7 +19,8 @@
 /**
 
-\page license License Terms
+[PAGE]license[PAGE] License Terms
 
 \verbinclude ./LICENSE
 
+[TRAILER]
 */
Index: mainpage.dox
===================================================================
--- mainpage.dox	(revision 9)
+++ mainpage.dox	(revision 10)
@@ -23,46 +23,5 @@
 \section toc Table of Contents
 
- - \ref intro
- - \ref basic_concepts "Basic Concepts"
-   - \ref hello_lemon
-   - \ref digraph_build "Build and Modify a Digraph"
-   - \ref digraph_iterate "Iterate Over the Elements"
-   - \ref standard_maps "Maps - Assign Data to Graphs"
-   - \ref algorithms "Algorithms"
-     - \ref alg_bfs_dfs "BFS, DFS - Graph Search"
-     - \ref alg_dijkstra "Dijkstra - Shorthest Path"
-     - \ref alg_kruskal "Kruskal - Minimum Spanning Tree"
-   - \ref undir_graphs "Undirected Graphs"
- - \ref tools "Some Important Auxiliary Tools"
-   - \ref lgf "LEMON Graph Format"
-     - \ref glemon "gLemon - A Graph Editor for LEMON"
-   - \ref graph_to_eps "GraphToEps - Postscript Exporting"
-   - \ref time_count "Time Measuring and Counting"
-   - \ref random "Random Numbers"
- - \ref advanced "Advanced Topics"
-   - \ref maps "Maps"
-     - \ref map_concepts "Read/Write/Reference Maps"
-     - \ref custom_maps "Custom Maps"
-     - \ref map_adaptors "Map Adaptors"
-     - \ref special_maps "Other Special Purpose Maps"
-   - \ref graphs "Graphs"
-     - \ref graph_adaptors "Graph Adaptors"
-     - \ref special_graphs "Special Graph Structures"
-   - \ref named_params "Named Parameters"
-     - \ref alg_named_params "Customizing Algorithms"
- - \ref lp "LP and MIP Solvers"
-   - \ref lp_examples "Simple Examples"
-   - \ref lp_maxflow "Maximum Flow as LP Problem"
- - \ref appendix "Appendix"
-   - \ref install
-     - \ref requirements_lemon
-       - \ref requirements_lp
-     - \ref install_from_source
-       - \ref install_hg
-     - \ref install_rpm
-     - \ref install_user
-     - \ref compile_codes
-       - \ref compile_system_wide
-       - \ref compile_user_local
+[TOC]
 
 */
Index: titlegen.py
===================================================================
--- titlegen.py	(revision 10)
+++ titlegen.py	(revision 10)
@@ -0,0 +1,71 @@
+#! /usr/bin/env python
+
+import sys
+import os
+import copy
+import re
+
+def sec_inc(section, lev):
+    while len(section)<lev:
+        section.append(0)
+    section[lev-1]+=1
+    section=section[:lev]
+    return section
+
+def format_sec(sec):
+    s=""
+    for i in sec:
+        s+=str(i)+'.'
+    return s
+
+section = [];
+toc={}
+ind={}
+
+prev_page=''
+for l in open("toc.txt").readlines():
+    sl = l.split()
+    if len(sl)==2 and len(sl[0])>0: 
+        lev=len(sl[0])
+        section=sec_inc(section,lev)
+        t_sec=copy.copy(section)
+        t_link=sl[1];
+        print format_sec(t_sec),t_link
+        ind[t_link]=[t_sec,'','']
+        if lev==1:
+            ind[t_link][1]=prev_page
+            if prev_page:
+                ind[prev_page][2]=t_link
+            prev_page=t_link
+        toc[format_sec(t_sec)]=t_link
+
+for doxfile in os.listdir('.'):
+    if doxfile[-4:]=='.dox':
+        print 'Generate ',doxfile
+        page=''
+        fo=open(os.path.join("gen-dox",doxfile),"w")
+        for l in open(doxfile).readlines():
+            gr = re.match(r"(^[[]PAGE[]].*[[]PAGE[]])?(^[[]SEC[]].*[[]SEC[]])?(^[[]TRAILER[]])?(^[[]TOC[]])?(.*)$", l).groups()
+            if gr[0]:
+                page=gr[0][6:-6]
+                fo.write("\page %s %s%s\n"%(page,
+                                            format_sec(ind[page][0]),gr[4]))
+            elif gr[1]:
+                sec=gr[1][5:-5]
+                fo.write("\section %s %s%s\n"%(sec,
+                                               format_sec(ind[sec][0]),gr[4]))
+            elif gr[2]:
+                prev_page=ind[page][1]
+                prev_str= ( '\\ref '+prev_page ) if prev_page else ''
+                next_page=ind[page][2]
+                next_str= ( '\\ref '+next_page ) if next_page else ''
+                fo.write('<< %s | \\ref toc "Home" | %s >>\n'%\
+                             (prev_str,next_str))
+            elif gr[3]:
+                secs = [ x for x in toc]
+                secs.sort()
+                for num in secs:
+                    fo.write("%s - \\ref %s\n"%(' '*(len(num)-2),toc[num]))
+            else:
+                fo.write(gr[4]+'\n')
+        fo.close()
Index: toc.txt
===================================================================
--- toc.txt	(revision 10)
+++ toc.txt	(revision 10)
@@ -0,0 +1,32 @@
+* intro
+** intro_lemon
+** intro_tutorial
+* hello_lemon
+** hello_lemon_system
+** hello_lemon_user
+**_digraph_build
+**_digraph_iterate
+**_standard_maps
+**_algorithms
+***_alg_bfs_dfs
+***_alg_dijkstra
+***_alg_kruskal
+**_undir_graphs
+*_tools
+**_lgf
+**_glemon
+**_graph_to_eps
+**_time_count
+**_random
+* install
+** requirements_lemon
+*** requirements_lp
+** install_from_source
+** install_hg
+** install_rpm
+** install_user
+** compile_codes
+*** compile_system_wide
+*** compile_user_local
+**** compile_use_pkg_config
+* license
