summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--doc/man.macros23
-rw-r--r--tools/tcltk-man2html-utils.tcl15
3 files changed, 44 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5c25427..2229eea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-12 Donal K. Fellows <dkf@users.sf.net>
+
+ * tools/tcltk-man2html-utils.tcl (make-manpage-section): Start of some
+ * doc/man.macros (.FI): support for a macro for figures, which is
+ mainly intended for use with Tk.
+
2012-03-27 Donal K. Fellows <dkf@users.sf.net>
IMPLEMENTATION OF TIP#395.
diff --git a/doc/man.macros b/doc/man.macros
index ddd073d..37cf721 100644
--- a/doc/man.macros
+++ b/doc/man.macros
@@ -67,6 +67,14 @@
.\" Print an open parenthesis, arg1 in quotes, then arg2 normally
.\" (for trailing punctuation) and then a closing parenthesis.
.\"
+.\" .FI pictureName caption
+.\" Creates a figure from the picture called "pictureName". This
+.\" translates into a URL to a PNG version of the picture when formatted
+.\" for a terminal, a use of the EPS version of the picture when
+.\" formatting for printed output, and a centered inline image (from the
+.\" PNG) in the version for the web. The caption is added below, with
+.\" appropriate numbering.
+.\"
.\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
.if t .wh -1.3i ^B
.nr ^l \n(.l
@@ -265,3 +273,18 @@ Database Class: \\fB\\$3\\fR
.de MT
.QW ""
..
+.\" # FI - figure with caption
+.ds UB http://www.tcl.tk/man/tcl8.6/img/
+.nr fi 0 1
+.de FI
+.RS
+.PP
+.ie n \{\
+.ce
+<\\*(UB\\$1.png>
+.\}
+.el .PSPIC img/\\$1.eps
+.ce
+Figure \\n+(fi: \\$2
+.RE
+..
diff --git a/tools/tcltk-man2html-utils.tcl b/tools/tcltk-man2html-utils.tcl
index c0c6a75..de88bea 100644
--- a/tools/tcltk-man2html-utils.tcl
+++ b/tools/tcltk-man2html-utils.tcl
@@ -1470,6 +1470,21 @@ proc make-manpage-section {outputDir sectionDescriptor} {
}
error "found .. outside of .de"
}
+ .ds {
+ regexp {^(\S+) ([^\s""]+|".*")$} $rest var rest
+ if {$var eq "UB"} {
+ variable ImageUrlBase [unquote $rest]
+ }
+ }
+ .FI {
+ flushbuffer
+ regexp {^(\S+) ([^\s""]+|".*")$} $rest fig caption
+ variable ImageUrlBase
+ set fig $ImageUrlBase$fig.png
+ set caption [process-text [unquote $caption]]
+ lappend manual(text) \
+ "<center><img src=\"$fig\"><br>$caption</center>"
+ }
default {
if {!$verbose} {
puts stderr ""