;
; From a requirements directory containing a map file and all of the referenced
; .html files, generate the following:
; * index.html, with a heading and full table of contents
; * index{1-6}.html, with tables of contents for section levels 1 through 6,
; as these levels exist
; * lof.html, containing a cumulatively numbered list of figures
; * modified *_.html files, with inserted title commands at the top,
; navigation links at the bottom, and generated section numbers in the
; body; these files are referenced in the toc and nav links
;
; Formating requirements for a map file are the following:
; ... see the example in work/calendar/requirements for now ...
;
; Formating requirements for html files are as follows:
; *
, , and commands are replaced if present; the first
; command is used to generate the title and heading
; * through indicate section depth
; *
is counted as a figure; the non-standard caption
; argument is replaced by an anchored caption text immediately below the
; image; spacing, centering, and horizontal rules are added; the caption
; text appears in the lof
; * the non-standard html command [unique section title prefix] is
; replaced with the section number; if the section title prefix is non-
; unique, a warning is issued and the the earliest number is used; if the
; section title prefix is not found, then it is left unchanged but linked
; to a _sectinon-not-found.html file; otherwise identical section titles
; can be disambiguated with or other invisible characters
; * the non-standard html command unique caption prefix is
; replaced with the figure number; error handling is the same as for [
;
;
; Alternatives to building separate *_.html files:
; * , , and commands are processed the same, i.e., by
; replacement.
; * Any leading dewey decimal number is replaced when processing
; commands.
; * The caption= argument is left as is within the ]
command.
; Immediately following the
tag begin/end pair of caption tags
; is inserted with the following syntax:
; Figure n: caption text.
; If caption tag pair is present, its guts are replaced.
; * The caption= arg can also appear in commands. If present, it
; signals that the table should appear in the lot. Processing is as for
; the caption= arg in
s.
; * Change [ and commands as follows: Make the command syntax
; ][
; When the processing, the generated number (section, fig, or table) is
; added after the ][ command and ended with ]. If a number
; and are already present, they are replaced.
;
;
; First pass:
; foreach line in map file
; save file-level as prev-file-level
; set file-level to number of leading tabs + 1
; do parent/child processing
; nuke any extant , , and replace with new stuff
; search consecutively for each type of arg we care about
; switch on arg
; case : add or replace number; store number in symtab
; case
| : if captioned, add or replace caption;
; store number in symtab
; create nav links based on file-level, etc.
;
; Second pass:
; process all [ commands
;
; Section number components
(defvar l1 0)
(defvar l2 0)
(defvar l3 0)
(defvar l4 0)
(defvar l5 0)
(defvar l6 0)
; Figure number
(defvar fig 0)
; Table number
(defvar tab 0)
; File level, as spefied by indentation in map. It's init'd to -1 so as to
; catch any leading tabs on the first line of the part of the map.
(defvar file-level -1)
; List that defines the hierachy of sections based on numbering. The list is
; used to generate the navigation links.
(defvar map nil)
; Open the map file and leave in a buffer for access as necessary. Complain
; and exit if no map file present.
(defun open-map ()
)
; Create the index.html file, inserting title and heading text. Any old index
; is moved to index.html.bak.
(defun create-index ()
; Open up.
(find-file "index.html")
; Copy to .bak if necessary.
(if (> (buffer-size) 0)
(shell-command "cp -p index.html index.html.bak &")
)
; Insert title info from map file.
)
; Scan all sections files, doing the following for each
; * prepend l1. ... .ln in front of the text for each section
; * create a toc entry for each section
; * create a lof entry for each figure
;
(defun process-file-body ()
(while (search-forward-regexp
(concat "\\(<[Hh][1-9]>\\)\\|"
"\\(]
' of the heading command.
(defun insert-section-number ()
; Move over whitespace and check
)
; Insert or replace a figure number of there's a caption arg before the next
; ">".
(defun insert-section-number ()
)
; Insert or replace a table number of there's a caption arg before the next
; ">".
(defun insert-section-number ()
)
; Insert generated section numbers in heading commands.
(defun insert-section-numbers ()
)
; Scan all sections files, creating toc entries and lof entries
; Pre: level >= 1 and level <= 6
(defun start-new-section (level)
; Enforce precond brutally
(if (< level 1) (setq level 1))
(if (> level 6) (setq level 6))
; Increment l by 1
(setq l1 (1+ l1))
; Reset l, i < level, to 1
(let ((i (1+ level)))
(while ()
)
)
;
)
; Do indentation validity checking. If cur-lev > prev-lev + 1, issue warning
; that extra indentation is ignored, giving map file line number. Set cur-lev
; = to prev-lev + 1.
(defun process-indentation (line)
)
; Do previous processing. If prev-lev is same as cur-lev, make prev link the
; preceding file. If prev-lev > cur-lev, make prev link nil.
; Do parent processing. If cur-lev is equal to prev-lev, leave parent
; unchanged; if cur-lev < prev-lev, pop (prev-lev - cur-lev) items off parent
; stack and set parent = to new top of stack; if cur-lev = prev-lev + 1, push
; current parent and set parent = prev-file.
(defun compute-parent ()
)
; Example format of nav-link list:
(setq nav-list '(
(intro.html nil functional.html index.html index.html)
(functional.html intro.html non-functional.html index.html index.html)
(ui-overview.html nil appt-scheduling.html functional.html index.html)
(appt-scheduling.html ui-overview.html viewing.html functional.html index.html)
(viewing.html appt-scheduling.html more-scheduling.html functional.html index.html)
structural-viewing.html
specific-date-viewing.html
list-viewing.html
filtered-viewing.html
viewing-other-users.html
window-viewing.html
more-scheduling.html
meeting-scheduling.html
task-scheduling.html
event-scheduling.html
finer-points.html
item-level-viewing.html
changing-and-deleting.html
recurring-details.html
receiving-reminders.html
category-editing.html
dynamic-view-updating.html
admin.html
options.html
file.html
edit.html
help.html
data-entry-details.html
error-conditions.html
gui-details.html
multi-user-envir.html
installation.html
future-enhancements.html
work-in-progress.html
non-functional.html
developer-overview.html
spec.html
schedule.rsl.html
caldb.rsl.html
view.rsl.html
admin.rsl.html
options.rsl.html
file.rsl.html
edit.rsl.html
rationale.html
users-man.html
command-lang.html
help-content.html
feature-comparison.html
)
)