# HG changeset patch # User Alpar Juttner # Date 1225386813 0 # Node ID 55e2f7712e8723526b0294e0ec854554a067394f # Parent a48bf0d3a790aceadf1bb1e309b63a3c6d70098d TOC and section numbering are generated from toc.txt diff -r a48bf0d3a790 -r 55e2f7712e87 .hgignore --- a/.hgignore Tue Oct 28 18:54:30 2008 +0100 +++ b/.hgignore Thu Oct 30 17:13:33 2008 +0000 @@ -15,3 +15,4 @@ (.*/)?\#[^/]*\#$ ^html/.* ^gen-images/.* +^gen-dox/.* diff -r a48bf0d3a790 -r 55e2f7712e87 Doxyfile --- a/Doxyfile Tue Oct 28 18:54:30 2008 +0100 +++ b/Doxyfile Thu Oct 30 17:13:33 2008 +0000 @@ -70,7 +70,7 @@ SHOW_FILES = NO SHOW_NAMESPACES = NO FILE_VERSION_FILTER = -LAYOUT_FILE = DoxygenLayout.xml +LAYOUT_FILE = ./DoxygenLayout.xml #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- @@ -84,7 +84,7 @@ #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = . \ +INPUT = ./gen-dox \ ./demo INPUT_ENCODING = UTF-8 FILE_PATTERNS = *.h \ diff -r a48bf0d3a790 -r 55e2f7712e87 Makefile --- a/Makefile Tue Oct 28 18:54:30 2008 +0100 +++ b/Makefile Thu Oct 30 17:13:33 2008 +0000 @@ -15,6 +15,8 @@ $(GS_COMMAND) -sDEVICE=pngalpha -r18 -sOutputFile=$@ $< html: $(PNG_IMAGES) + -mkdir gen-dox + ./titlegen.py doxygen Doxyfile clean: diff -r a48bf0d3a790 -r 55e2f7712e87 getting_started.dox --- a/getting_started.dox Tue Oct 28 18:54:30 2008 +0100 +++ b/getting_started.dox Thu Oct 30 17:13:33 2008 +0000 @@ -17,7 +17,7 @@ */ /** -\page hello_lemon Compile Your First Code +[PAGE]hello_lemon[PAGE] Compile Your First Code If you have installed LEMON on your system you can paste the following code segment into a file called hello_lemon.cc to have a first @@ -52,7 +52,7 @@ 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), then it is very easy to compile this program with the @@ -70,7 +70,7 @@ ./hello_lemon \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 user-local into a directory (e.g. ~/lemon) or if you just @@ -114,4 +114,5 @@ do not hesitate to contact us. +[TRAILER] */ diff -r a48bf0d3a790 -r 55e2f7712e87 install.dox --- a/install.dox Tue Oct 28 18:54:30 2008 +0100 +++ b/install.dox Thu Oct 30 17:13:33 2008 +0000 @@ -17,7 +17,7 @@ */ /** -\page install Installation Guide +[PAGE]install[PAGE] Installation Guide In this section we detail how to start using LEMON, from downloading it to your computer, through the steps of installation, to showing how to @@ -27,7 +27,7 @@ difficulties do not hesitate to ask. -\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 considerable amount of time and memory. So some decent box would be @@ -46,14 +46,14 @@ However keep in mind that you have to make appropriate steps instead of 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 Kit), CPLEX and SoPlex solver. If you want to use it, you will need at least one of these. See the INSTALL 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: http://lemon.cs.elte.hu/. @@ -141,7 +141,7 @@ Several other configure flags can be passed to ./configure. For more information see the INSTALL 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 repository. You need a couple additional tool for that. @@ -186,21 +186,20 @@ make install? -\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 successful, then you have to issue a command like this to compile a @@ -213,7 +212,7 @@ The argument -lemon tells the compiler that we are using the 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 user-local into a directory (denoted by ) @@ -225,8 +224,9 @@ g++ -lemon -I -L /lemon/.libs [other options] \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] */ diff -r a48bf0d3a790 -r 55e2f7712e87 intro.dox --- a/intro.dox Tue Oct 28 18:54:30 2008 +0100 +++ b/intro.dox Thu Oct 30 17:13:33 2008 +0000 @@ -17,9 +17,9 @@ */ /** -\page intro Introduction +[PAGE]intro[PAGE] Introduction -\section intro_lemon What is LEMON +[SEC]intro_lemon[SEC] What is LEMON LEMON stands for Library of Efficient Models and Optimization in Networks. It is a C++ template @@ -42,7 +42,7 @@ For more information visit the LEMON web site: http://lemon.cs.elte.hu/. -\section intro_tutorial LEMON Tutorial +[SEC]intro_tutorial[SEC] LEMON Tutorial This tutorial introduces the reader to the basic concepts and features of LEMON, and there are also some sections about advanced topics showing the @@ -52,4 +52,7 @@ LEMON with the help of the detailed documentation (that can also be used as a reference manual). + +[TRAILER] + */ diff -r a48bf0d3a790 -r 55e2f7712e87 license.dox --- a/license.dox Tue Oct 28 18:54:30 2008 +0100 +++ b/license.dox Thu Oct 30 17:13:33 2008 +0000 @@ -18,8 +18,9 @@ /** -\page license License Terms +[PAGE]license[PAGE] License Terms \verbinclude ./LICENSE +[TRAILER] */ diff -r a48bf0d3a790 -r 55e2f7712e87 mainpage.dox --- a/mainpage.dox Tue Oct 28 18:54:30 2008 +0100 +++ b/mainpage.dox Thu Oct 30 17:13:33 2008 +0000 @@ -22,48 +22,7 @@ \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] */ } diff -r a48bf0d3a790 -r 55e2f7712e87 titlegen.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/titlegen.py Thu Oct 30 17:13:33 2008 +0000 @@ -0,0 +1,71 @@ +#! /usr/bin/env python + +import sys +import os +import copy +import re + +def sec_inc(section, lev): + while len(section)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() diff -r a48bf0d3a790 -r 55e2f7712e87 toc.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/toc.txt Thu Oct 30 17:13:33 2008 +0000 @@ -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