[Lemon-commits] Alpar Juttner: TOC and section numbering are gen...
Lemon HG
hg at lemon.cs.elte.hu
Thu Oct 30 18:13:44 CET 2008
details: http://lemon.cs.elte.hu/hg/lemon-tutorial/rev/55e2f7712e87
changeset: 10:55e2f7712e87
user: Alpar Juttner <alpar [at] cs.elte.hu>
date: Thu Oct 30 17:13:33 2008 +0000
description:
TOC and section numbering are generated from toc.txt
diffstat:
10 files changed, 133 insertions(+), 63 deletions(-)
.hgignore | 1
Doxyfile | 4 +-
Makefile | 2 +
getting_started.dox | 7 ++---
install.dox | 24 ++++++++---------
intro.dox | 9 ++++--
license.dox | 3 +-
mainpage.dox | 43 ------------------------------
titlegen.py | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++
toc.txt | 32 ++++++++++++++++++++++
diffs (truncated from 380 to 300 lines):
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 <tt>hello_lemon.cc</tt> 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. <tt>~/lemon</tt>) or if you just
@@ -114,4 +114,5 @@
do not hesitate to
<a href="mailto:lemon-user at lemon.cs.elte.hu"><b>contact us</b></a>.
+[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
<a href="mailto:lemon-user at 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
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 <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:
<a href="http://lemon.cs.elte.hu/">http://lemon.cs.elte.hu/</a>.
@@ -141,7 +141,7 @@
Several other configure flags can be passed to <tt>./configure</tt>.
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
repository. You need a couple additional tool for that.
@@ -186,21 +186,20 @@
<tt><b>make install</b></tt>?
-\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 <tt>-lemon</tt> 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 <tt><dir></tt>)
@@ -225,8 +224,9 @@
g++ -lemon -I <dir> -L <dir>/lemon/.libs [other options] <source file>
\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
<b>LEMON</b> stands for <b>L</b>ibrary of <b>E</b>fficient <b>M</b>odels and
<b>O</b>ptimization in <b>N</b>etworks. It is a C++ template
@@ -42,7 +42,7 @@
For more information visit the LEMON web site:
<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
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)<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()
More information about the Lemon-commits
mailing list