From 02eec48c3b242e3ba520ca6f25cc05398f215ef3 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 21 Feb 2011 08:24:58 +0100 Subject: [PATCH] Documentation of the new menu generating script for the website Signed-off-by: Ichthyostega --- doc/technical/infra/MenuGen.txt | 265 ++++++++++++++++++++++++++++++-- 1 file changed, 249 insertions(+), 16 deletions(-) diff --git a/doc/technical/infra/MenuGen.txt b/doc/technical/infra/MenuGen.txt index f2b3d0b0b..a6f402cd1 100644 --- a/doc/technical/infra/MenuGen.txt +++ b/doc/technical/infra/MenuGen.txt @@ -1,43 +1,276 @@ Website Navigation Generator ============================ -:Author: Hermann Voßeler -:Date: 2/2011 +:author: Hermann Voßeler +:revdate: 2/2011 + + +This page contains documentation and notes regarding the +menugen.py+ -- +written 2/2011 during our attempt to get the new Lumiera website online finally. +The link::http://git.lumiera.org/gitweb?p=website-staging;a=blob;f=menugen.lua;h=aad2129d7f4ed3f3b35b2fc3ac2a63a9f1bfb62d;hb=menugen[initial draft version] was written by _cehteh_ in Lua + + +************************************************************************** +The purpose of the +*menugen*+ script is to maintain the navigation menu +on the Lumiera website semi-automatically. In the usual setup, this script +is triggered from a _Git push_ -- it walks the web subdirectories and +discovers menu entries. The generated HTML page contains both visible +elements and JavaScript snippets to display and highlight the menu +on the client side appropriately +************************************************************************** + +Overview: how it works +---------------------- +The menu generation and display is comprised of several parts working together + +. the +build_website.sh+ is triggered as a Git post-receive hook, whenever new + commits are transfered to the website Git repository. After discovering new + Asciidoc source files and generating the corresponding HTML files, the + menu generator script is invoked +. the +menugen+ python script walks the subdirectories to discover possible + menu contents. It visits Asciidoc source files (`*.txt`) and picks up + + - the location / URL + - the title + - special `//MENU:` directives embedded in Asciidoc comments + +. after building a complete menu tree (actually a DAG), this data structure + is walked to generate output HTML into a `menu.html` file in website root. +. the page template (`page.conf`) for generated Asciidoc pages contains an + +