;;; manual.mhtml: -*- Meta-HTML -*- 
;;; References to the Meta-HTML manual.
;;;  Copyright (c) 1996 Brian J. Fox
;;;  Author: Brian J. Fox (bfox@ai.mit.edu) Mon Jul  8 13:46:32 1996.

;;; The full path (in web space) to the Meta-HTML documentation tree.
<defun manual::location>
  /release/<get-var mhtml::version>/meta-html/manual
</defun>

<defsubst manual::url><get-var mhtml::http-prefix><manual::location></defsubst>

<defun manual::dir>
  <get-var mhtml::include-prefix><manual::location>
</defun>

<defun funref function>
  <set-var key=<get-var function>>
  <concat
   <a href="<manual::url>/man-page.mhtml?<cgi-encode key>">
   <code><get-var function></code>
   </a>>
</defun>

<defun secref>
  <set-var section =
    <upcase <subst-in-string <prog %body>
			     "^[ \t]+" ""
			     "[ \t]+$" ""
			     " +" "-">>>
  <concat <a href="<manual::url>/view-section.mhtml?<cgi-encode section>">
	  <capitalize <subst-in-string <get-var section> "-" " ">>
	  </a>>
</defun>

<defun varref varname>
  <funref <get-var varname>>
</defun>

<defun manual::section-of-function name>
  <with-open-database db <manual::dir>/functions.db mode=read>
    <set-var x =
      <database-load-record db <upcase <get-var name>>>>
  </with-open-database>
  <capitalize <subst-in-string <get-var section> "-" " ">>
</defun>
