shithub: puzzles

Download patch

ref: 1c47f2b55351d224c74707a0c0cb047046bec6c2
parent: b10be2b32adc91e3d51117aeac8a75e59271d941
author: Simon Tatham <anakin@pobox.com>
date: Mon Jan 24 08:00:11 EST 2005

Improve OS X help: split back up into multiple files (thanks to
Halibut's new \cfg{html-local-head} directive), and add some CSS to
mimic the font choices of system help files.

[originally from svn r5194]

--- a/Recipe
+++ b/Recipe
@@ -48,8 +48,9 @@
 CFLAGS += -DCOMBINED
 Puzzles_extra = Puzzles.app/Contents/Resources/Help/index.html
 Puzzles.app/Contents/Resources/Help/index.html: \
-	Puzzles.app/Contents/Resources/Help puzzles.but
-	halibut --html=$@ puzzles.but
+	Puzzles.app/Contents/Resources/Help osx-help.but puzzles.but
+	cd Puzzles.app/Contents/Resources/Help; \
+		halibut --html ../../../../osx-help.but ../../../../puzzles.but
 Puzzles.app/Contents/Resources/Help: Puzzles.app/Contents/Resources
 	mkdir -p Puzzles.app/Contents/Resources/Help
 !end
--- /dev/null
+++ b/osx-help.but
@@ -1,0 +1,14 @@
+\# Additional Halibut fragment to set up the HTML output
+\# appropriately for MacOS online help.
+
+\cfg{html-head-end}{
+<style type="text/css">
+body \{ font-family: "Lucida Grande", Helvetica, Arial; font-size: 9pt \}
+h1 \{ font-size: 12pt \}
+h2 \{ font-size: 10pt \}
+h3 \{ font-size: 9pt \}
+h4 \{ font-size: 9pt \}
+h5 \{ font-size: 9pt \}
+h6 \{ font-size: 9pt \}
+</style>
+}
--- a/osx.m
+++ b/osx.m
@@ -3,13 +3,8 @@
  *
  * Still to do:
  * 
- *  - Improve the help. For a start I probably ought to split it
- *    into pieces (which means Halibut needs to acquire a mechanism
- *    of putting something in the head section of _only one_ HTML
- *    file); then I'd also like to be able to call up context help
- *    for a specific game at a time. Also I just idly wonder
- *    whether changing font might be nice, to match up to Apple
- *    norms.
+ *  - I'd like to be able to call up context help for a specific
+ *    game at a time.
  * 
  * Mac interface issues that possibly could be done better:
  * 
--- a/puzzles.but
+++ b/puzzles.but
@@ -5,17 +5,14 @@
 
 \cfg{text-filename}{puzzles.txt}
 
-\#
 \cfg{html-contents-filename}{index.html}
+\cfg{html-template-filename}{%k.html}
+\cfg{html-index-filename}{docindex.html}
 \cfg{html-leaf-level}{1}
 \cfg{html-contents-depth-0}{1}
 \cfg{html-contents-depth-1}{2}
 \cfg{html-leaf-contains-contents}{true}
 
-\cfg{html-single-filename}{index.html}
-\cfg{html-head-end}{<meta name="AppleTitle" content="Puzzles Help">}
-\cfg{html-leaf-level}{0}
-
 \cfg{info-filename}{puzzles.info}
 
 \cfg{ps-filename}{puzzles.ps}
@@ -27,8 +24,9 @@
 reserved. You may distribute this documentation under the MIT licence.
 See \k{licence} for the licence text in full.
 
-\versionid $Id$
+\cfg{html-local-head}{<meta name="AppleTitle" content="Puzzles Help">}
 
+\versionid $Id$
 
 \C{intro} Introduction