Index: modules/doctools/changelog.tcl ================================================================== --- modules/doctools/changelog.tcl +++ modules/doctools/changelog.tcl @@ -1,16 +1,13 @@ # changelog.tcl -- # # Handling of ChangeLog's. # -# Copyright (c) 2003-2008 Andreas Kupries +# Copyright (c) 2003-2019 Andreas Kupries # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: changelog.tcl,v 1.8 2008/07/08 23:03:58 andreas_kupries Exp $ - # FUTURE -- Expand pre-parsed log (nested lists) into flat structures # FUTURE -- => date/author/file/cref + cref/text # FUTURE -- I.e. relational/tabular structure, useable in table displays, # FUTURE -- sort by date, author, file to see aggregated changes Index: modules/doctools/checker_toc.tcl ================================================================== --- modules/doctools/checker_toc.tcl +++ modules/doctools/checker_toc.tcl @@ -51,11 +51,11 @@ # --------------+-----------------------+---------------------- # division | item | -> division // # +-----------------------+----------- # | division_start | -> division, PUSH division # +-----------------------+----------- -# | division_end | POP (-> division / -> end) +# | division_end | POP (-> division / -> contents) # --------------+-----------------------+---------------------- # end | toc_end | -> done # +-----------------------+----------- # | division_start | PUSH division # --------------+-----------------------+---------------------- @@ -110,21 +110,21 @@ return } proc Is {s} {global state ; return [string equal $state $s]} proc IsNot {s} {global state ; return [expr {![string equal $state $s]}]} -proc Go {s} {Log " >>\[$s\]" ; global state ; set state $s; return} -proc Push {s} {Log " //\[$s\]" ; global state stack ; lappend stack $state ; set state $s; return} -proc Pop {} {Log* " pop" ; global state stack ; set state [lindex $stack end] ; set stack [lrange $stack 0 end-1] ; Log " \\\\\[$state\]" ; return} +proc Go {s} {Log " ==\[$s\]" ; global state ; set state $s; return} +proc Push {s} {Log " >>\[$s\]" ; global state stack ; lappend stack $state ; set state $s; return} +proc Pop {} {Log* " <<" ; global state stack ; set state [lindex $stack end] ; set stack [lrange $stack 0 end-1] ; Log " \\\\\[$state\]" ; return} proc State {} {global state stack ; return "$stack || $state"} -proc Enter {cmd} {Log* "\[[State]\] $cmd"} +proc Enter {cmd} {Log* "\n\[[State]\] $cmd"} +proc Log* {args} {} +proc Log {args} {} #proc Log* {text} {puts -nonewline $text} #proc Log {text} {puts $text} -proc Log* {text} {} -proc Log {text} {} # ------------------------------------------------------------- # Framing proc ck_initialize {} { global state ; set state toc_begin @@ -175,11 +175,12 @@ # ------------------------------------------------------------- # Formatting commands proc toc_begin {label title} { Enter toc_begin if {[IsNot toc_begin]} {Error toc/begincmd} - Go contents + Go end + Push contents fmt_toc_begin $label $title } proc toc_end {} { Enter toc_end if {[IsNot end] && [IsNot contents]} {Error toc/endcmd} @@ -189,11 +190,10 @@ proc division_start {title {symfile {}}} { Enter division_start if { [IsNot contents] && [IsNot end] && [IsNot division] } {Error toc/sectcmd} - if {[Is contents] || [Is end]} {Go end} else {Go division} Push division fmt_division_start $title $symfile } proc division_end {} { Enter division_end Index: modules/doctools/cvs.tcl ================================================================== --- modules/doctools/cvs.tcl +++ modules/doctools/cvs.tcl @@ -1,15 +1,13 @@ # cvs.tcl -- # # Handling of various cvs output formats. # -# Copyright (c) 2003-2008 Andreas Kupries +# Copyright (c) 2003-2019 Andreas Kupries # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: cvs.tcl,v 1.10 2008/07/08 23:03:58 andreas_kupries Exp $ package require Tcl 8.2 package require textutil namespace eval ::doctools {} Index: modules/doctools/docidx.tcl ================================================================== --- modules/doctools/docidx.tcl +++ modules/doctools/docidx.tcl @@ -1,15 +1,13 @@ # docidx.tcl -- # # Implementation of docidx objects for Tcl. # -# Copyright (c) 2003-2018 Andreas Kupries +# Copyright (c) 2003-2019 Andreas Kupries # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: docidx.tcl,v 1.22 2010/06/08 19:13:53 andreas_kupries Exp $ package require Tcl 8.2 package require textutil::expander # @mdgen OWNER: api_idx.tcl Index: modules/doctools/docidx.test ================================================================== --- modules/doctools/docidx.test +++ modules/doctools/docidx.test @@ -3,14 +3,12 @@ # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # -# Copyright (c) 2003-2009 by Andreas Kupries +# Copyright (c) 2003-2019 by Andreas Kupries # All rights reserved. -# -# RCS: @(#) $Id: docidx.test,v 1.15 2009/02/12 05:42:47 andreas_kupries Exp $ # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ @@ -19,10 +17,11 @@ testsNeedTcl 8.2 testsNeedTcltest 1.0 support { use textutil/expander.tcl textutil::expander + use fileutil/fileutil.tcl fileutil } testing { useLocal docidx.tcl doctools::idx } @@ -305,12 +304,58 @@ set result } {Docidx Error in macro at line 1, column 30: [index_end] --> (FmtError) IDX error (idx/endcmd), "index_end" : Command not allowed here..} + +# ------------------------------------------------------------------------- +## Series of tests for all available backends, check their formatting. + +set k 11 +foreach format { + html nroff text + wiki null +} { + set n 0 + foreach src [TestFilesGlob tests/idx/idx/*] { + if {[file tail $src] == "CVS"} continue + + # Get the expected result + set dst [localPath [file join tests idx $format [file tail $src]]] + set map {} ; lappend map @USR@ $tcl_platform(user) + set rem {} ; lappend rem $tcl_platform(user) @USR@ + if {$format eq "nroff"} { + lappend map ".so man.macros\n" [fileutil::cat [localPath mpformats/man.macros]] + } + if {[catch { + set expected [string map $map [fileutil::cat $dst]] + }]} { set expected **missing** } + + test docidx-${format}-${k}.$n "docidx backends, $format/[file tail $src]" { + new mydocidx + mydocidx configure \ + -format $format \ + -file .FILE. + if {[catch { + set res [mydocidx format [fileutil::cat $src]] + }]} { + set res $::errorInfo + } + mydocidx destroy + #fileutil::writeFile ${dst}.actual [string map $rem $res] + set res + } $expected + + #fileutil::writeFile ${dst}.expected $expected + incr n + } + incr k +} + +# ------------------------------------------------------------------------- namespace forget ::doctools::idx::new # ------------------------------------------------------------------------- testsuiteCleanup return Index: modules/doctools/doctoc.test ================================================================== --- modules/doctools/doctoc.test +++ modules/doctools/doctoc.test @@ -3,14 +3,12 @@ # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # -# Copyright (c) 2003-2009 by Andreas Kupries +# Copyright (c) 2003-2019 by Andreas Kupries # All rights reserved. -# -# RCS: @(#) $Id: doctoc.test,v 1.14 2009/02/12 05:42:47 andreas_kupries Exp $ # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ @@ -19,10 +17,11 @@ testsNeedTcl 8.2 testsNeedTcltest 1.0 support { use textutil/expander.tcl textutil::expander + use fileutil/fileutil.tcl fileutil } testing { useLocal doctoc.tcl doctools::toc } @@ -288,32 +287,78 @@ set result } {Doctoc Error in plain text at line 1, column 0: [plain_text foo] --> (FmtError) TOC error (toc/plaintext), "plain_text foo" : Plain text beyond whitespace is not allowed..} -test docidx-9.1 {doctoc syntax v1.1, empty toc, ok} { - new mydocidx -format null - set result [mydocidx format {[toc_begin TOC Test][toc_end]}] - mydocidx destroy +test doctoc-9.1 {doctoc syntax v1.1, empty toc, ok} { + new mydoctoc -format null + set result [mydoctoc format {[toc_begin TOC Test][toc_end]}] + mydoctoc destroy + set result +} {} + +test doctoc-9.2 {doctoc syntax v1.1, mixing items and divisions, ok} { + new mydoctoc -format null + set result [mydoctoc format {[toc_begin TOC Test][item I1f i1 i1d][division_start D Df][item I2f i2 i2d][division_end][toc_end]}] + mydoctoc destroy set result } {} -test docidx-9.2 {doctoc syntax v1.1, mixing items and divisions, ok} { - new mydocidx -format null - set result [mydocidx format {[toc_begin TOC Test][item I1f i1 i1d][division_start D Df][item I2f i2 i2d][division_end][toc_end]}] - mydocidx destroy +test doctoc-9.3 {doctoc syntax v1.1, empty division, ok} { + new mydoctoc -format null + set result [mydoctoc format {[toc_begin TOC Test][division_start D Df][division_end][toc_end]}] + mydoctoc destroy set result } {} -test docidx-9.3 {doctoc syntax v1.1, empty division, ok} { - new mydocidx -format null - set result [mydocidx format {[toc_begin TOC Test][division_start D Df][division_end][toc_end]}] - mydocidx destroy - set result -} {} + +# ------------------------------------------------------------------------- +## Series of tests for all available backends, check their formatting. + +set k 11 +foreach format { + html tmml nroff + text wiki null +} { + set n 0 + foreach src [TestFilesGlob tests/toc/toc/*] { + if {[file tail $src] == "CVS"} continue + + # Get the expected result + set dst [localPath [file join tests toc $format [file tail $src]]] + set map {} ; lappend map @USR@ $tcl_platform(user) + set rem {} ; lappend rem $tcl_platform(user) @USR@ + if {$format eq "nroff"} { + lappend map ".so man.macros\n" [fileutil::cat [localPath mpformats/man.macros]] + } + if {[catch { + set expected [string map $map [fileutil::cat $dst]] + }]} { set expected **missing** } + + test doctoc-${format}-${k}.$n "doctoc backends, $format/[file tail $src]" { + new mydoctoc + mydoctoc configure \ + -format $format \ + -file .FILE. + if {[catch { + set res [mydoctoc format [fileutil::cat $src]] + }]} { + set res $::errorInfo + } + mydoctoc destroy + #fileutil::writeFile ${dst}.actual [string map $rem $res] + set res + } $expected + + #fileutil::writeFile ${dst}.expected $expected + incr n + } + incr k +} + +# ------------------------------------------------------------------------- namespace forget ::doctools::toc::new # ------------------------------------------------------------------------- - testsuiteCleanup return Index: modules/doctools/doctools.test ================================================================== --- modules/doctools/doctools.test +++ modules/doctools/doctools.test @@ -3,14 +3,12 @@ # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # -# Copyright (c) 2003-2010 by Andreas Kupries +# Copyright (c) 2003-2019 by Andreas Kupries # All rights reserved. -# -# RCS: @(#) $Id: doctools.test,v 1.28 2011/01/13 02:41:44 andreas_kupries Exp $ # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ @@ -316,23 +314,22 @@ # ------------------------------------------------------------------------- ## Series of tests for all available backends, check their formatting. set k 11 foreach format { - html tmml - nroff latex - text wiki + html tmml nroff + latex text wiki desc list null } { set n 0 foreach src [TestFilesGlob tests/man/*] { if {[file tail $src] == "CVS"} continue # Get the expected result set dst [localPath [file join tests $format [file tail $src]]] - set map @ID@ ; lappend map \$Id\$ ; lappend map @USR@ $tcl_platform(user) - set rem \$Id\$ ; lappend rem @ID@ ; lappend $tcl_platform(user) @USR@ + set map {} ; lappend map @USR@ $tcl_platform(user) + set rem {} ; lappend rem $tcl_platform(user) @USR@ if {$format eq "nroff"} { lappend map ".so man.macros\n" [fileutil::cat [localPath mpformats/man.macros]] } if {[catch { set expected [string map $map [fileutil::cat $dst]] @@ -369,22 +366,22 @@ foreach src [TestFilesGlob tests/man/*] { if {[file tail $src] == "CVS"} continue # Get the expected result set dst [localPath [file join tests html [file tail $src]]] - set map @ID@ ; lappend map \$Id\$ ; lappend map @USR@ $tcl_platform(user) - set rem \$Id\$ ; lappend rem @ID@ ; lappend $tcl_platform(user) @USR@ + set map {} ; lappend map @USR@ $tcl_platform(user) + set rem {} ; lappend rem $tcl_platform(user) @USR@ if {[catch { set expected [string map $map [fileutil::cat $dst]] }]} { set expected **missing** } # Transform regular output to contents of body/, i.e. raw output. regsub {.*} $expected {} expected regsub {.*} $expected {} expected append expected \n - if {$n == 5 || $n == 8} { set expected \n$expected } + #if {$n == 5 || $n == 8} { set expected \n$expected } # Run the test ... test doctools-html-raw-11.$n "doctools backends, html-raw/[file tail $src]" { new mydoctools mydoctools configure \ Index: modules/doctools/mpformats/_html.tcl ================================================================== --- modules/doctools/mpformats/_html.tcl +++ modules/doctools/mpformats/_html.tcl @@ -1,11 +1,11 @@ # -*- tcl -*- -# Copyright (c) 2001-2008 Andreas Kupries +# Copyright (c) 2001-2019 Andreas Kupries # # Helper rules for the creation of the memchan website from the .exp files. # General formatting instructions ... - +# # htmlEscape text -- # Replaces HTML markup characters in $text with the # appropriate entity references. # @@ -92,11 +92,11 @@ puts_stderr @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ puts_stderr $text puts_stderr @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ } - return $text + return [string trimleft $text] } # markup text -- # Protect markup characters in $text with \1. # These will be stripped out in PostProcess. Index: modules/doctools/mpformats/_nroff.tcl ================================================================== --- modules/doctools/mpformats/_nroff.tcl +++ modules/doctools/mpformats/_nroff.tcl @@ -1,11 +1,10 @@ # -*- tcl -*- # # -- nroff commands # -# Copyright (c) 2003-2005 Andreas Kupries - +# Copyright (c) 2003-2019 Andreas Kupries ################################################################ # nroff specific commands # # All dot-commands (f.e. .PP) are returned with a leading \n\1, @@ -176,8 +175,8 @@ lappend map \n\1.IP\n\1. \n\1. set lines [string map $map $lines] # Return the modified result buffer - return [string map $finalMap $lines] + return [string trim [string map $finalMap $lines]]\n } Index: modules/doctools/mpformats/_text.tcl ================================================================== --- modules/doctools/mpformats/_text.tcl +++ modules/doctools/mpformats/_text.tcl @@ -1,9 +1,11 @@ # -*- tcl -*- # -# _text.tcl -- Core support for text engines. - +# -- Core support for text engines. +# +# Copyright (c) 2003-2019 Andreas Kupries +# Freely redistributable. ################################################################ if {0} { catch {rename proc proc__} msg ; puts_stderr >>$msg @@ -23,394 +25,10 @@ rename proc__ proc puts_stderr ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } -################################################################ -# Formatting constants ... Might be engine variables in the future. - -global lmarginIncrement ; set lmarginIncrement 4 -global rmarginThreshold ; set rmarginThreshold 20 -global bulleting ; set bulleting {* - # @ ~ %} -global enumeration ; set enumeration {[%] (%) <%>} - -proc Bullet {ivar} { - global bulleting ; upvar $ivar i - set res [lindex $bulleting $i] - set i [expr {($i + 1) % [llength $bulleting]}] - return $res -} - -proc EnumBullet {ivar} { - global enumeration ; upvar $ivar i - set res [lindex $enumeration $i] - set i [expr {($i + 1) % [llength $enumeration]}] - return $res -} - -################################################################ - -# -# The engine maintains several data structures per document and pass. -# Most important is an internal representation of the text better -# suited to perform the final layouting, the display list. Elements of -# the display list are lists containing 2 elements, an operation, and -# its arguments, in this order. The arguments are a list again, its -# contents are specific to the operation. -# -# The operations are: -# -# - SECT Section. Title. -# - SUBSECT Subsection. Title. -# - PARA Paragraph. Environment reference and text. -# -# The PARA operation is the workhorse of the engine, dooing all the -# formatting, using the information in an "environment" as the guide -# for doing so. The environments themselves are generated during the -# second pass through the contents. They contain the information about -# nesting (i.e. indentation), bulleting and the like. -# - -global cmds ; set cmds [list] ; # Display list -global pEnv ; array set pEnv {} ; # Defined paragraph environments (bulleting, indentation, other). -global para ; set para "" ; # Text buffer for paragraphs. - -global nextId ; set nextId 0 ; # Counter for environment generation. -global currentId ; set currentId {} ; # Id of current environment in 'pEnv' -global currentEnv ; array set currentEnv {} ; # Current environment, expanded form. -global contexts ; set contexts [list] ; # Stack of saved environments. -global off ; set off 1 ; # Suppression of plain text in some places. - -################################################################ -# Management of the current context. - -proc Text {text} {global para ; append para $text ; return} -proc Store {op args} {global cmds ; lappend cmds [list $op $args] ; return} -proc Off {} {global off ; set off 1 ; return} -proc On {} {global off para ; set off 0 ; set para "" ; return} -proc IsOff {} {global off ; return [expr {$off == 1}]} - -# Debugging ... -#proc Text {text} {puts_stderr "TXT \{$text\}"; global para; append para $text ; return} -#proc Store {op args} {puts_stderr "STO $op $args"; global cmds; lappend cmds [list $op $args]; return} -#proc Off {} {puts_stderr OFF ; global off ; set off 1 ; return} -#proc On {} {puts_stderr ON_ ; global off para ; set off 0 ; set para "" ; return} - - -proc NewEnv {name script} { - global currentId nextId currentEnv - - #puts_stderr "NewEnv ($name)" - - set parentId $currentId - set currentId $nextId - incr nextId - - append currentEnv(NAME) -$parentId-$name - set currentEnv(parent) $parentId - set currentEnv(id) $currentId - - # Always squash a verbatim environment inherited from the previous - # environment ... - catch {unset currentEnv(verbenv)} - - uplevel $script - SaveEnv - return $currentId -} - -################################################################ - -proc TextInitialize {} { - global off ; set off 1 - global cmds ; set cmds [list] ; # Display list - global pEnv ; array set pEnv {} ; # Defined paragraph environments (bulleting, indentation, other). - global para ; set para "" ; # Text buffer for paragraphs. - - global nextId ; set nextId 0 ; # Counter for environment generation. - global currentId ; set currentId {} ; # Id of current environment in 'pEnv' - global currentEnv ; array set currentEnv {} ; # Current environment, expanded form. - global contexts ; set contexts [list] ; # Stack of saved environments. - - # lmargin = location of left margin for text. - # prefix = prefix string to use for all lines. - # wspfx = whitespace prefix for all but the first line - # listtype = type of list, if any - # bullet = bullet to use for unordered, bullet template for ordered. - # verbatim = flag if verbatim formatting requested. - # next = if present the environment to use after closing the paragraph using this one. - - NewEnv Base { - array set currentEnv { - lmargin 0 - prefix {} - wspfx {} - listtype {} - bullet {} - verbatim 0 - bulleting 0 - enumeration 0 - } - } - return -} - -################################################################ - -proc Section {name} {Store SECT $name ; return} -proc Subsection {name} {Store SUBSECT $name ; return} - -proc CloseParagraph {{id {}}} { - global para currentId - if {$para != {}} { - if {$id == {}} {set id $currentId} - Store PARA $id $para - #puts_stderr "CloseParagraph $id" - } - set para "" - return -} - -proc SaveContext {} { - global contexts currentId - lappend contexts $currentId - - #global currentEnv ; puts_stderr "Save>> $currentId ($currentEnv(NAME))" - return -} - -proc RestoreContext {} { - global contexts - SetContext [lindex $contexts end] - set contexts [lrange $contexts 0 end-1] - - #global currentId currentEnv ; puts_stderr "<>" - - if {[IsOff]} {return} - - # Note: Whenever we get plain text it is possible that a macro for - # visual markup actually generated output before the expander got - # to the current text. This output was captured by the expander in - # its current context. Given the current organization of the - # engine we have to retrieve this formatted text from the expander - # or it will be lost. This is the purpose of the 'ctopandclear', - # which retrieves the data and also clears the capture buffer. The - # latter to prevent us from retrieving it again later, after the - # next macro added more data. - - set text [ex_ctopandclear]$text - - # ... TODO ... Handling of example => verbatim - - if {[string length [string trim $text]] == 0} return - - Text $text - return -} - -################################################################ - -proc text_postprocess {text} { - - #puts_stderr XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - #puts_stderr <<$text>> - #puts_stderr XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - - global cmds - # The argument is not relevant. Access the display list, perform - # the final layouting and return its result. - - set linebuffer [list] - array set state {lmargin 0 rmargin 0} - foreach cmd $cmds { - foreach {op arguments} $cmd break - $op $arguments - } - - #puts_stderr XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - - return [join $linebuffer \n] -} - - -proc SECT {text} { - upvar linebuffer linebuffer - - # text is actually the list of arguments, having one element, the text. - set text [lindex $text 0] - #puts_stderr "SECT $text" - #puts_stderr "" - - # Write section title, underline it - - lappend linebuffer "" - lappend linebuffer $text - lappend linebuffer [textutil::repeat::strRepeat = [string length $text]] - return -} - -proc SUBSECT {text} { - upvar linebuffer linebuffer - - # text is actually the list of arguments, having one element, the text. - set text [lindex $text 0] - #puts_stderr "SUBSECT $text" - #puts_stderr "" - - # Write subsection title, underline it (with less emphasis) - - lappend linebuffer "" - lappend linebuffer $text - lappend linebuffer [textutil::repeat::strRepeat - [string length $text]] - return -} - -proc PARA {arguments} { - global pEnv - upvar linebuffer linebuffer - - foreach {env text} $arguments break - array set para $pEnv($env) - - #puts_stderr "PARA $env" - #parray_stderr para - #puts_stderr " \{$text\}" - #puts_stderr "" - - # Use the information in the referenced environment to format the paragraph. - - if {$para(verbatim)} { - set text [textutil::adjust::undent $text] - } else { - # The size is determined through the set left and right margins - # right margin is fixed at 80, left margin is variable. Size - # is at least 20. I.e. when left margin > 60 right margin is - # shifted out to the right. - - set size [expr {80 - $para(lmargin)}] - if {$size < 20} {set size 20} - - set text [textutil::adjust::adjust $text -length $size] - } - - # Now apply prefixes, (ws prefixes bulleting), at last indentation. - - if {[string length $para(prefix)] > 0} { - set text [textutil::adjust::indent $text $para(prefix)] - } - - if {$para(listtype) != {}} { - switch -exact $para(listtype) { - bullet { - # Indent for bullet, but not the first line. This is - # prefixed by the bullet itself. - - set thebullet $para(bullet) - } - enum { - # Handling the enumeration counter. Special case: An - # example as first paragraph in an item has to use the - # counter in environment it is derived from to prevent - # miscounting. - - if {[info exists para(example)]} { - set parent $para(parent) - array set __ $pEnv($parent) - if {![info exists __(counter)]} { - set __(counter) 1 - } else { - incr __(counter) - } - set pEnv($parent) [array get __] ; # Save context change ... - set n $__(counter) - } else { - if {![info exists para(counter)]} { - set para(counter) 1 - } else { - incr para(counter) - } - set pEnv($env) [array get para] ; # Save context change ... - set n $para(counter) - } - - set thebullet [string map [list % $n] $para(bullet)] - } - } - - set blen [string length $thebullet] - if {$blen >= [string length $para(wspfx)]} { - set text "$thebullet\n[textutil::adjust::indent $text $para(wspfx)]" - } else { - set fprefix $thebullet[string range $para(wspfx) $blen end] - set text "${fprefix}[textutil::adjust::indent $text $para(wspfx) 1]" - } - } - - if {$para(lmargin) > 0} { - set text [textutil::adjust::indent $text \ - [textutil::repeat::strRepeat " " $para(lmargin)]] - } - - lappend linebuffer "" - lappend linebuffer $text - return -} - -################################################################ - -proc strong {text} {return *${text}*} -proc em {text} {return _${text}_} - -################################################################ - proc parray_stderr {a {pattern *}} { upvar 1 $a array if {![array exists array]} { error "\"$a\" isn't an array" } @@ -425,6 +43,114 @@ set nameString [format %s(%s) $a $name] puts_stderr " [format "%-*s = {%s}" $maxl $nameString $array($name)]" } } -################################################################ +# # ## ### ##### ######## +## + +dt_source _text_utils.tcl +# Formatting utilities + +dt_source _text_margin.tcl +# RMargin, LMI + +dt_source _text_state.tcl +# On, Off, IsOff + +dt_source _text_para.tcl +# Text, Text?, TextClear, TextPlain (-> IsOff) + +dt_source _text_cstack.tcl +# ContextReset, ContextPush, ContextPop (-> CAttrCurrent, ContextSet) + +dt_source _text_ccore.tcl +# ContextSetup, ContextSet, ContextNew, ContextCommit, CAttrName, CAttrCurrent, +# CAttrRef, CAttrUnset, CAttrSet, CAttrAppend, CAttrIncr, CAttrGet, CAttrHas + +dt_source _text_bullets.tcl +# DIB, IBullet (-> CAttrRef) +# DEB, EBullet (-> CAttrRef) + +dt_source _text_dlist.tcl +# DListClear, Section, Subsection, CloseParagraph (-> Text?, TextClear, CAttrCurrent) +# PostProcess +# - SECT (-> SectTitle) +# - SUBSECT (-> SubsectTitle) +# - PARA (-> TEXT context accessors) + +# # ## ### ##### ######## +## + +proc TextInitialize {} { + DListClear + TextClear + ContextReset + Off + ContextSetup + + # Root context + ContextNew Base { + MarginReset + PrefixReset + WPrefixReset + VerbatimOff + ListNone + BulletReset + ItemReset + EnumReset + } + return +} + +# # ## ### ##### ######## +## `text` formatting + +proc SectTitle {lb title} { + upvar 1 $lb lines + #lappend lines "" + lappend lines $title + lappend lines [RepeatM = $title] + return +} + +proc SubsectTitle {lb title} { + upvar 1 $lb lines + #lappend lines "" + lappend lines $title + lappend lines [RepeatM - $title] + return +} + +proc Strong {text} { return *${text}* } +proc Em {text} { return _${text}_ } + +# # ## ### ##### ######## +## Bulleting +# +# itembullet = index of the bullet to use in the next itemized list +# enumbullet = index of the bullet to use in the next enumerated list + +proc EnumReset {} { CAttrSet enumbullet 0 } +proc ItemReset {} { CAttrSet itembullet 0 } + +# # ## ### ##### ######## +## + +proc text_plain_text {text} { TextPlain $text } +proc text_postprocess {text} { PostProcess $text } + +#return + +# Debugging +proc text_postprocess {text} { + if {[set code [catch { + PostProcess $text + } res]]} { + global errorInfo errorCode + puts_stderr + puts_stderr $errorCode + puts_stderr $errorInfo + return -code $code -errorinfo $errorInfo -errorcode $errorCode $msg + } + return $res +} ADDED modules/doctools/mpformats/_text_bullets.tcl Index: modules/doctools/mpformats/_text_bullets.tcl ================================================================== --- /dev/null +++ modules/doctools/mpformats/_text_bullets.tcl @@ -0,0 +1,30 @@ +# -*- tcl -*- +# +# Copyright (c) 2019 Andreas Kupries +# Freely redistributable. +# +# _text_bullets.tcl -- Bulleting configuration and use. + +global itembullets ; set itembullets {* - # @ ~ %} +global enumbullets ; set enumbullets {[%] (%) <%>} + +proc IB {} { global itembullets ; return $itembullets } +proc EB {} { global enumbullets ; return $enumbullets } +proc DIB {bullets} { global itembullets ; set itembullets $bullets } +proc DEB {bullets} { global enumbullets ; set enumbullets $bullets } + +proc NB {bullets countervar} { + upvar 1 $countervar counter + set bullet [lindex $bullets $counter] + set counter [expr {($counter + 1) % [llength $bullets]}] + return $bullet +} + +proc ItemBullet {countervar} { upvar 1 $countervar counter ; NB [IB] counter } +proc EnumBullet {countervar} { upvar 1 $countervar counter ; NB [EB] counter } + +# xref current content +proc IBullet {} { ItemBullet [CAttrRef itembullet] } +proc EBullet {} { EnumBullet [CAttrRef enumbullet] } + +return ADDED modules/doctools/mpformats/_text_ccore.tcl Index: modules/doctools/mpformats/_text_ccore.tcl ================================================================== --- /dev/null +++ modules/doctools/mpformats/_text_ccore.tcl @@ -0,0 +1,134 @@ +# -*- tcl -*- +# +# Copyright (c) 2019 Andreas Kupries +# Freely redistributable. +# +# _text_ccore.tcl -- Management of current context, and database of all contexts + +global nextId ; # Counter for context generation. +global contextData ; # In-memory database of known contexts. +global contextName ; # Map context handles to name. + +global currentHandle ; # Handle of context in 'currentContext'. +global currentContext ; # Current context, for direct access of all attributes + +# # ## ### ##### ######## +## Internals + +proc ContextCommit {} { + global contextData currentHandle currentContext + set contextData($currentHandle) [array get currentContext] + return +} + +proc NextId {} { + global nextId + set new $nextId + incr nextId + return $new +} + +# # ## ### ##### ######## +## Basic management + +proc ContextSetup {} { + global contextData ; unset -nocomplain contextData ; array set contextData {} + global contextName ; unset -nocomplain contextName ; array set contextName {} + global nextId ; set nextId 0 + + global currentHandle ; set currentHandle {} + global currentContext ; array set currentContext {} + return +} + +proc ContextSet {id} { + global currentHandle currentContext contextData + set currentHandle $id + + #puts_stderr "--Set ($id) ([CAttrName $id])" + + # Ensure that array is clean before setting hte new block of + # information. + unset currentContext + array set currentContext $contextData($currentHandle) + return +} + +proc ContextNew {name script} { + global currentHandle contextName currentContext + set in [array get currentContext] + + set parentId $currentHandle + set currentHandle [NextId] + + #puts_stderr "ContextNew ${currentHandle}:($name) in ${parentId}:[CAttrName $parentId]" + + CAttrAppend NAME /${name}:$currentHandle + CAttrSet parent $parentId + CAttrSet id $currentHandle + CAttrUnset verbenv ;# Each context must have its own verbatim variant. + + # Customize the context - modifier commands + uplevel $script + + # ContextCommit state for future use. + ContextCommit + set contextName($currentHandle) [CAttrGet NAME] + + return $currentHandle +} + +# # ## ### ##### ######## +## Generic accessors + +proc CAttrName {{id {}}} { + global contextName + if {$id == {}} { global currentHandle ; set id $currentHandle } + if {![info exists contextName($id)]} { return <$id> } + return $contextName($id) +} + +proc CAttrCurrent {} { global currentHandle ; return $currentHandle } + +proc CAttrSet {key value} { global currentContext ; set currentContext($key) $value } +proc CAttrAppend {key value} { global currentContext ; append currentContext($key) $value } +proc CAttrIncr {key {value 1}} { global currentContext ; incr currentContext($key) $value } +proc CAttrGet {key} { global currentContext ; set currentContext($key) } +proc CAttrHas {key} { global currentContext ; info exists currentContext($key) } +proc CAttrUnset {key} { global currentContext ; catch { unset currentContext($key) } } +proc CAttrRef {key} { return "::currentContext($key)" } + +# # ## ### ##### ######## +## Verbatim +# +# Attributes: +# - verbatim = flag if verbatim formatting requested, i.e. no paragraph reflow. +# - verbenv = if present, id of verbatim variant of this environment + +proc NewVerbatim {} { + return [ContextNew Verbatim { VerbatimOn }] +} + +proc Verbatim {} { + if {![CAttrHas verbenv]} { + ContextPush + set verbenv [NewVerbatim] + ContextPop + # Remember the associated verbatim mode in the base + # environment and database. + CAttrSet verbenv $verbenv + ContextCommit + } + return [CAttrGet verbenv] +} + +proc VerbatimOff {} { CAttrSet verbatim 0 } +proc VerbatimOn {} { CAttrSet verbatim 1 } +proc Verbatim? {} { CAttrGet verbatim } + +# # ## ### ##### ######## + +proc Parent? {} { CAttrGet parent } + +# # ## ### ##### ######## +return ADDED modules/doctools/mpformats/_text_cstack.tcl Index: modules/doctools/mpformats/_text_cstack.tcl ================================================================== --- /dev/null +++ modules/doctools/mpformats/_text_cstack.tcl @@ -0,0 +1,31 @@ +# -*- tcl -*- +# +# Copyright (c) 2019 Andreas Kupries +# Freely redistributable. +# +# _text_cstack.tcl -- Stack of contexts and accessors + +global contexts ; set contexts {} + +################################################################ +# Management of the stack + +proc ContextReset {} { global contexts ; set contexts {} ; return } + +proc ContextPush {} { + global contexts + lappend contexts [set id [CAttrCurrent]] + + #puts_stderr "Push:[llength $contexts]>> [CAttrName $id]" + return +} + +proc ContextPop {} { + global contexts + set id [lindex $contexts end] + set contexts [lrange $contexts 0 end-1] + + #puts_stderr "< +# Freely redistributable. +# +# _text_dlist.tcl -- Display list variables and accessors + +# +# The engine maintains several data structures per document and pass. +# Most important is an internal representation of the text better +# suited to perform the final layouting, the display list. Elements of +# the display list are lists containing 2 elements, an operation, and +# its arguments, in this order. The arguments are a list again, its +# contents are specific to the operation. +# +# The operations are: +# +# - SECT Section. Title. +# - SUBSECT Subsection. Title. +# - PARA Paragraph. Context reference and text. +# +# The PARA operation is the workhorse of the engine, dooing all the +# formatting, using the information in an "context" as the guide +# for doing so. The contexts themselves are generated during the +# second pass through the contents. They contain the information about +# nesting (i.e. indentation), bulleting and the like. +# + +# # ## ### ##### ######## +## State: Display list + +global __dlist + +# # ## ### ##### ######## +## Internal: Extend + +proc Store {op args} { global __dlist ; lappend __dlist [list $op $args] ; return} + +# Debugging ... +#proc Store {op args} {puts_stderr "STO $op $args"; global __dlist; lappend __dlist [list $op $args]; return} + +# # ## ### ##### ######## +## API +# +# API Section Add section +# API Subsection Add subsection +# API CloseParagraph Add paragraph using text and (current) env +# Boolean result indicates if something was added, or not + +proc DListClear {} { global __dlist ; unset -nocomplain __dlist ; set __dlist {} } + +proc Section {name} {Store SECT $name ; return} +proc Subsection {name} {Store SUBSECT $name ; return} + +proc CloseParagraph {{id {}}} { + set para [Text?] + if {$para == {}} { return 0 } + if {$id == {}} { set id [CAttrCurrent] } + Store PARA $id $para + #puts_stderr "CloseParagraph $id [CAttrName $id]" + TextClear + return 1 +} + +proc PostProcess {text} { + #puts_stderr XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + #puts_stderr <<$text>> + #puts_stderr XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + global __dlist + # The argument is not relevant. Access the display list, perform + # the final layouting and return its result. + + set lines {} + array set state {lmargin 0 rmargin 0} + foreach cmd $__dlist { + lappend lines "" + foreach {op arguments} $cmd break + $op $arguments + } + + #puts_stderr XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + return [Compose lines]\n +} + +# # ## ### ##### ######## +## PARA attributes +# +# Attributes +# - bullet = bullet (template) to use for (un)ordered lists. +# - counter = if present, item counter for enumeration list. +# - listtype = type of list, if any. +# - lmargin = left-indent, location of left margin for text. +# - prefix = prefix to use for all lines of the parapgraph. +# - wspfx = whitespace prefix for all but the first line of the paragraph. + +proc BulletReset {} { CAttrSet bullet {} } +proc ListNone {} { CAttrSet listtype {} } +proc MarginIn {} { CAttrIncr lmargin [LMI] } +proc MarginReset {} { CAttrSet lmargin 0 } +proc PrefixReset {} { CAttrSet prefix {} } +proc WPrefixReset {} { CAttrSet wspfx {} } + +proc Prefix! {p} { CAttrSet prefix $p } +proc WPrefix! {p} { CAttrSet wspfx $p } + +proc Bullet? {} { CAttrGet bullet } +proc ListType? {} { CAttrGet listtype } +proc Margin? {} { CAttrGet lmargin } +proc Prefix? {} { CAttrGet prefix } +proc WPrefix? {} { CAttrGet wspfx } + +proc List! {type bullet wprefix} { + CAttrSet listtype $type + CAttrSet bullet $bullet + CAttrSet wspfx $wprefix +} + +proc EnumCounter {} { + if {![CAttrHas counter]} { + CAttrSet counter 1 + } else { + CAttrIncr counter + } + ContextCommit + #puts_stderr "Counter ... [CAttrName] => [CAttrGet counter]" + return [CAttrGet counter] +} + +proc EnumId {} { + # Handling the enumeration counter. + # + # Special case: An example as first paragraph in an item has to + # use the counter in the context it is derived from to prevent + # miscounting. + + #puts_stderr "EnumId: [CAttrName] | [CAttrName [Parent?]]" + + if {[Example?]} { + ContextPush + ContextSet [Parent?] + set n [EnumCounter] + ContextPop + } else { + set n [EnumCounter] + } + return $n +} + +# # ## ### ##### ######## +## Hooks + +proc SECT {text} { + #puts_stderr "SECT $text" + #puts_stderr "" + # text is actually the list of arguments, having one element, the text. + upvar 1 lines lines + set text [lindex $text 0] + SectTitle lines $text + return +} + +proc SUBSECT {text} { + #puts_stderr "SUBSECT $text" + #puts_stderr "" + # text is actually the list of arguments, having one element, the text. + upvar 1 lines lines + set text [lindex $text 0] + SubsectTitle lines $text + return +} + +proc PARA {arguments} { + upvar lines lines + + # Note. As the display list is processed at the very end we can + # reuse the current context and accessors to hold and query the + # context of each paragraph. + + foreach {env text} $arguments break + ContextSet $env + + #puts_stderr "PARA $env" + #parray_stderr ::currentEnv + #puts_stderr " \{$text\}" + #puts_stderr "" + + # Use the information in the referenced context to format the + # paragraph. + + set lm [Margin?] + set lt [ListType?] + set blank [WPrefix?] + + if {[Verbatim?]} { + set text [Undent $text] + } else { + set plm $lm + incr plm [string length $blank] + set text [Reflow $text [RMargin $plm]] + } + + # Now apply prefixes, (ws prefixes bulleting), at last indentation. + + set p [Prefix?] + if {[string length $p]} { + set text [Indent $text $p] + } + + if {$lt != {}} { + switch -exact $lt { + bullet { + # Indent for bullet, but not the first line. This is + # prefixed by the bullet itself. + set thebullet [Bullet?] + } + enum { + #puts_stderr EB + + set n [EnumId] + set thebullet [string map [list % $n] [Bullet?]] + + #puts_stderr "E $n | $thebullet |" + } + } + + set blank [WPrefix?] + + if {[string length $thebullet] >= [string length $blank]} { + # The item's bullet is longer than the space for indenting. + # Put bullet and text on separate lines, indent text in full. + + set text "$thebullet\n[Indent $text $blank]" + } else { + # The item's bullet fits into the space for + # indenting. Make hanging indent of text and place the + # bullet in front of the first line, with suitable partial + # spacing. + + set text [Indent1 $text [ReHead $blank $thebullet] $blank] + } + } + + if {$lm} { + set text [Indent $text [Blank $lm]] + } + + lappend lines $text + return +} + +# # ## ### ##### ######## +return ADDED modules/doctools/mpformats/_text_margin.tcl Index: modules/doctools/mpformats/_text_margin.tcl ================================================================== --- /dev/null +++ modules/doctools/mpformats/_text_margin.tcl @@ -0,0 +1,21 @@ +# -*- tcl -*- +# +# Copyright (c) 2019 Andreas Kupries +# Freely redistributable. +# +# _text_margin.tcl -- Margin control + +global lmarginIncrement ; set lmarginIncrement 4 +global rmarginThreshold ; set rmarginThreshold 20 + +proc LMI {} { global lmarginIncrement ; return $lmarginIncrement } +proc RMT {} { global rmarginThreshold ; return $rmarginThreshold } + +proc RMargin {indent} { + set rmt [RMT] + set rmargin [expr {80 - $indent}] + if {$rmargin < $rmt} { set rmargin $rmt } + return $rmargin +} + +return ADDED modules/doctools/mpformats/_text_para.tcl Index: modules/doctools/mpformats/_text_para.tcl ================================================================== --- /dev/null +++ modules/doctools/mpformats/_text_para.tcl @@ -0,0 +1,60 @@ +# -*- tcl -*- +# +# Copyright (c) 2019 Andreas Kupries +# Freely redistributable. +# +# _text_para.tcl -- Paragraph variables and accessors - Text accumulator + +# # ## ### ##### ######## +## State: Text buffer for paragraphs. + +global __currentp + +# # ## ### ##### ######## +## API + +proc Text {text} { global __currentp ; append __currentp $text ; return } +proc Text? {} { global __currentp ; return $__currentp } +proc TextClear {} { global __currentp ; set __currentp "" } + +proc TextTrimLeadingSpace {} { + global __currentp + regsub {^([ \t\v\f]*\n)*} $__currentp {} __currentp + return +} + +proc TextPlain {text} { + #puts_stderr "<>" + + if {[IsOff]} {return} + + # Note: Whenever we get plain text it is possible that a macro for + # visual markup actually generated output before the expander got + # to the current text. This output was captured by the expander in + # its current context. Given the current organization of the + # engine we have to retrieve this formatted text from the expander + # or it will be lost. This is the purpose of the 'ctopandclear', + # which retrieves the data and also clears the capture buffer. The + # latter to prevent us from retrieving it again later, after the + # next macro added more data. + + set text [ex_ctopandclear]$text + + # ... TODO ... Handling of example => verbatim + + if {[string length [string trim $text]] == 0} return + + Text $text + return +} + +#return +# # ## ### ##### ######## +## Debugging + +proc Text {text} { + #puts_stderr "T++ (($text))" + global __currentp + append __currentp $text + return +} ADDED modules/doctools/mpformats/_text_state.tcl Index: modules/doctools/mpformats/_text_state.tcl ================================================================== --- /dev/null +++ modules/doctools/mpformats/_text_state.tcl @@ -0,0 +1,22 @@ +# -*- tcl -*- +# +# Copyright (c) 2019 Andreas Kupries +# Freely redistributable. +# +# _text_state.tcl -- State variables and accessors + +# # ## ### ##### ######## +# State: Flag to suppress of plain text in some places. + +global __off + +# # ## ### ##### ######## +# API + +proc Off {} { global __off ; set __off 1 ; return} +proc On {} { global __off ; set __off 0 ; TextClear ; return} +proc IsOff {} { global __off ; return $__off } + +# Debugging ... +#proc Off {} {puts_stderr OFF ; global __off ; set __off 1 ; return} +#proc On {} {puts_stderr ON_ ; global __off ; set __off 0 ; TextClear ; return} ADDED modules/doctools/mpformats/_text_utils.tcl Index: modules/doctools/mpformats/_text_utils.tcl ================================================================== --- /dev/null +++ modules/doctools/mpformats/_text_utils.tcl @@ -0,0 +1,56 @@ +# -*- tcl -*- +# +# Copyright (c) 2019 Andreas Kupries +# Freely redistributable. +# +# _text_utils.tcl -- Text formatting utilities + +# # ## ### ##### ######## +## API + +proc Compose {lb} { + upvar 1 $lb linebuffer + return [string trimright [join $linebuffer \n]] +} + +proc ReHead {line prefix} { + set n [string length $prefix] + incr n -1 + string replace $line 0 $n $prefix +} + +proc MaxLen {v s} { + upvar 1 $v max + set n [string length $s] + if {$n <= $max} return + set max $n +} + +proc BlankMargin {} { global lmarginIncrement ; Blank $lmarginIncrement } + +proc Repeat {char n} { textutil::repeat::strRepeat $char $n } +proc Blank {n} { textutil::repeat::blank $n } +proc RepeatM {char text} { Repeat $char [string length $text] } +proc BlankM {text} { Blank [string length $text] } +proc Undent {text} { textutil::adjust::undent $text } +proc Reflow {text maxlen} { textutil::adjust::adjust $text -length $maxlen } +proc Indent {text prefix} { textutil::adjust::indent $text $prefix } +proc Indent1 {text p1 p} { return "${p1}[textutil::adjust::indent $text $p 1]" } +proc InFlow {text maxlen prefix1 prefix} { + # Reformats the paragraph `text` to keep line length under + # `maxlen` and then indents the result using `prefix1` and + # `prefix`. `prefix1` is applied to the first line, and `prefix` + # to the remainder. The caller is responsible for ensuring that + # both prefixes have the same length. + Indent1 [Reflow $text $maxlen] $prefix1 $prefix +} + +proc Provenance {} { + textutil::string::uncap [c_provenance] +} + +# # ## ### ##### ######## +# Internals + +# # ## ### ##### ######## +return Index: modules/doctools/mpformats/_xml.tcl ================================================================== --- modules/doctools/mpformats/_xml.tcl +++ modules/doctools/mpformats/_xml.tcl @@ -1,16 +1,13 @@ # -*- tcl -*- -# -# $Id: _xml.tcl,v 1.9 2004/04/22 21:16:46 jenglish Exp $ -# # [expand] utilities for generating XML. # # Copyright (C) 2001 Joe English . # Freely redistributable. # +# Copyright (C) 2019 Andreas Kupries ###################################################################### - # Handling XML delimiters in content: # # Plain text is initially passed through unescaped; # internally-generated markup is protected by preceding it with \1. @@ -22,13 +19,13 @@ variable attvalMap { {&} & {<} < {>} > {"} " {'} ' } ; # " variable markupMap { {&} {\1&} {<} {\1<} {>} {\1>} } variable finalMap { {\1&} {&} {\1<} {<} {\1>} {>} {&} & {<} < {>} > } -proc fmt_postprocess {text} { +proc fmt_postprocess {text} { variable finalMap - return [string map $finalMap $text] + return [string trim [string map $finalMap $text]]\n } # markup text -- # Protect markup characters in $text with \1. # These will be stripped out in PostProcess. Index: modules/doctools/mpformats/fmt.latex ================================================================== --- modules/doctools/mpformats/fmt.latex +++ modules/doctools/mpformats/fmt.latex @@ -1,10 +1,7 @@ # -*- tcl -*- -# -# fmt.latex -# -# (c) 2001 Andreas Kupries +# (c) 2001-2019 Andreas Kupries # # [mpexpand] definitions to convert a tcl based manpage definition into # a manpage based upon LaTeX markup. # ################################################################ @@ -34,12 +31,21 @@ proc Year {} {clock format [clock seconds] -format %Y} c_holdBuffers require proc fmt_postprocess {text} { + # Trim trailing whitespace, for all lines. + regsub -all -- "\[ \t]+\n" $text "\n" text + # Strip superfluous line breaks regsub -all -- "\n+" $text "\n" text - return [string map {\1\\ \\ \1$ $} $text] + # Normalize paragraph breaks (subsume leading and traling whitespace) + regsub -all -- "\[\t \n]+\1@P" $text "\1@P" text + regsub -all -- "\1@P\[\t \n]+" $text "\1@P" text + # Insert the paragraph breaks, unify multiple adjacent breaks + regsub -all -- "(\1@P)+" $text "\n\n" text + # Finalize the protected special characters + return [string trimleft [string map {\1\\ \\ \1$ $} $text]] #return $text } ################################################################ ## Backend for LaTeX markup @@ -56,11 +62,11 @@ set hdr "" append hdr [Comment [c_provenance]] \n if {$copyright != {}} { append hdr [Comment $copyright] \n } - append hdr [Comment "CVS: \$Id\$ $title.$section"] \n + append hdr [Comment "$title.$section"] \n append hdr \n append hdr "\1\\documentclass\{article\}" \n if {$_has_images} { append hdr "\1\\usepackage{epsfig}" \n @@ -129,11 +135,13 @@ return $res } proc fmt_section {name id} {return "\1\\section\{[texEscape $name]\}\1\\label\{$id\}"} proc fmt_subsection {name id} {return "\1\\subsection\{[texEscape $name]\}\1\\label\{$id\}"} -proc fmt_para {} {return \n\n} + +proc fmt_para {} { return \1@P } +proc fmt_nl {} { return \1@P } c_pass 2 fmt_require {pkg {version {}}} NOP c_pass 1 fmt_require {pkg {version {}}} { if {$version != {}} { set res "package require [Bold "$pkg $version"]\n" @@ -304,11 +312,10 @@ return {\end{verbatim}} } # No mapping of special characters proc fmt_example {code} { return "\1\\begin\{verbatim\}\n${code}\n\1\\end\{verbatim\}\n" } -proc fmt_nl {} {return} proc fmt_arg {text} {Underline $text} proc fmt_cmd {text} {Bold $text} proc fmt_emph {text} {Italic $text} proc fmt_opt {text} {return ?$text?} @@ -391,14 +398,22 @@ \1\\^ \1\\^ \1\\$ \1\\$ \1\\# \1\\# \1\\& \1\\& \1\\ \1\\ - \\ \1$\\backslash$ _ \1\\_ % \1\\% ^ \1\\^ $ \1\\$ < \1$<$ > \1$>$ # \1\\# & \1\\& + \\ \1$\\backslash$ + _ \1\\_ + % \1\\% + ^ \1\\^ + $ \1\\$ + < \1$<$ + > \1$>$ + # \1\\# + & \1\\& } $text] if {$x} { #puts_stderr "==> '$text'" } return $text } ################################################################ Index: modules/doctools/mpformats/fmt.nroff ================================================================== --- modules/doctools/mpformats/fmt.nroff +++ modules/doctools/mpformats/fmt.nroff @@ -1,10 +1,10 @@ # -*- tcl -*- # # -- doctools NROFF formatting engine. # -# Copyright (c) 2001-2011 Andreas Kupries +# Copyright (c) 2001-2019 Andreas Kupries # # [expand] definitions to convert a tcl based manpage definition into # a manpage based upon *roff markup. Additional definition files allow # the conversion into HTML and TMML. @@ -101,11 +101,11 @@ append nroff [nr_fill] } return $nroff } -proc fmt_postprocess {nroff} {return [nroff_postprocess $nroff]} +proc fmt_postprocess {nroff} { nroff_postprocess $nroff } proc fmt_section {name {id {}}} {return [nr_section $name]} proc fmt_subsection {name {id {}}} {return [nr_subsection $name]} proc fmt_para {} { if {[dt_lnesting]} { return [nr_item] } Index: modules/doctools/mpformats/fmt.text ================================================================== --- modules/doctools/mpformats/fmt.text +++ modules/doctools/mpformats/fmt.text @@ -1,162 +1,220 @@ # -*- tcl -*- # -# fmt.text -- Engine to convert a doctools document into plain text. -# -# Copyright (c) 2003 Andreas Kupries -# -################################################################ -################################################################ - -# Load shared code and modify it to our needs. +# -- Engine to convert a doctools document into plain text. +# +# Copyright (c) 2003-2019 Andreas Kupries + +# # ## ### ##### ######## ############# +## Load shared code and modify it to our needs. dt_source _common.tcl dt_source _text.tcl + proc c_copyrightsymbol {} {return "(c)"} -rename fmt_initialize BaseInitialize -proc fmt_initialize {} {BaseInitialize ; TextInitialize ; return} +# # ## ### ##### ######## +## Special manpage contexts -################################################################ -# Special manpage environments +# example = if present, context is for an example +# exenv = if present, reference to example variant of current context + +proc Example! {} { CAttrSet example . } +proc Example? {} { CAttrHas example } proc NewExample {} { - global currentEnv - return [NewEnv Example { - set currentEnv(verbatim) 1 - append currentEnv(prefix) "| " - set currentEnv(example) . - }] ; # {} + return [ContextNew Example { VerbatimOn ; Example! ; Prefix! "| " }] ; # {} } proc Example {} { - global currentEnv - if {![info exists currentEnv(exenv)]} { - SaveContext - set verb [NewExample] - RestoreContext - - # Remember verbatim mode in the base environment - set currentEnv(exenv) $verb - SaveEnv - } - return $currentEnv(exenv) + if {![CAttrHas exenv]} { + ContextPush + set exenv [NewExample] + ContextPop + CAttrSet exenv $exenv + ContextCommit + } + return [CAttrGet exenv] } proc NewList {what} { - # List environments - # Per list several environments are required. - + # List contexts + # Per list several contexts are required. switch -exact -- $what { enumerated {NewOrderedList} itemized {NewUnorderedList} arguments - commands - options - tkoptions - definitions {NewDefinitionList} } + return } proc NewUnorderedList {} { - global currentEnv lmarginIncrement - # Itemized list - unordered list - bullet - # 1. Base environment provides indentation. + # 1. Base context provides indentation. # 2. First paragraph in a list item. # 3. All other paragraphs. - - set base [NewEnv Itemized { - incr currentEnv(lmargin) $lmarginIncrement - - set bullet [Bullet currentEnv(bulleting)] + ContextPush + set base [ContextNew Itemized { + MarginIn + set bullet [IBullet] }] ; # {} - set first [NewEnv First { - set currentEnv(wspfx) [::textutil::repeat::blank $lmarginIncrement] - set currentEnv(listtype) bullet - set currentEnv(bullet) $bullet - }] ; SetContext $base ; # {} - - set next [NewEnv Next { - incr currentEnv(lmargin) $lmarginIncrement - }] ; SetContext $base ; # {} - - set currentEnv(_first) $first - set currentEnv(_next) $next - set currentEnv(pcount) 0 - SaveEnv + + set first [ContextNew First { + List! bullet $bullet [BlankMargin] + }] ; ContextSet $base ; # {} + + set next [ContextNew Next { + MarginIn + }] ; ContextSet $base ; # {} + + OUL $first $next + ContextCommit + + ContextPop + ContextSet $base return } proc NewOrderedList {} { - global currentEnv lmarginIncrement - # Ordered list - enumeration - enum - # 1. Base environment provides indentation. + # 1. Base context provides indentation. # 2. First paragraph in a list item. # 3. All other paragraphs. - - set base [NewEnv Enumerated { - incr currentEnv(lmargin) $lmarginIncrement - - set bullet [EnumBullet currentEnv(enumeration)] + ContextPush + + set base [ContextNew Enumerated { + MarginIn + set bullet [EBullet] }] ; # {} - set first [NewEnv First { - set currentEnv(wspfx) [::textutil::repeat::blank $lmarginIncrement] - set currentEnv(listtype) enum - set currentEnv(bullet) $bullet - }] ; SetContext $base ; # {} - - set next [NewEnv Next { - incr currentEnv(lmargin) $lmarginIncrement - }] ; SetContext $base ; # {} - - set currentEnv(_first) $first - set currentEnv(_next) $next - set currentEnv(pcount) 0 - SaveEnv + + set first [ContextNew First { + List! enum $bullet [BlankMargin] + }] ; ContextSet $base ; # {} + + set next [ContextNew Next { + MarginIn + }] ; ContextSet $base ; # {} + + OUL $first $next + ContextCommit + + ContextPop + ContextSet $base return } proc NewDefinitionList {} { - global currentEnv lmarginIncrement - # Definition list - terms & definitions - # 1. Base environment provides indentation. - # 2. Term environment - # 3. Definition environment + # 1. Base context provides indentation. + # 2. Term context + # 3. Definition context + ContextPush - set base [NewEnv DefL { - incr currentEnv(lmargin) $lmarginIncrement + set base [ContextNew Definitions { + MarginIn }] ; # {} - set term [NewEnv Term { - set currentEnv(verbatim) 1 - }] ; SetContext $base ; # {} - - set def [NewEnv Def { - incr currentEnv(lmargin) $lmarginIncrement - }] ; SetContext $base ; # {} - - set currentEnv(_term) $term - set currentEnv(_definition) $def - SaveEnv + + set term [ContextNew Term { + VerbatimOn + }] ; ContextSet $base ; # {} + + set def [ContextNew Def { + MarginIn + }] ; ContextSet $base ; # {} + + TD $term $def + ContextCommit + + ContextPop + ContextSet $base return } -################################################################ -# Final layouting. +# # ## ### ##### ######## +## + +proc OUL {f n} { + CAttrSet _first $f + CAttrSet _next $n + CAttrSet pcount 0 +} + +proc TD {t d} { + CAttrSet _term $t + CAttrSet _definition $d +} + +proc IsPara {} { CAttrHas pcount } +proc Paras {} { CAttrGet pcount } +proc PAdvance {} { CAttrIncr pcount 1 } +proc PReset {} { CAttrSet pcount 0 } +proc First {} { CAttrGet _first } +proc Other {} { CAttrGet _next } +proc Term {} { CAttrGet _term } +proc Def {} { CAttrGet _definition } +proc IsDef {} { CAttrHas _definition } + +# # ## ### ##### ######## +## + +proc CloseCurrent {{op PAdvance}} { + if {[IsDef]} { + # Currently in a definition list. + CloseParagraph [Def] + } elseif {[IsPara]} { + # Currently in an (un)ordered list. + if {![Paras]} { + # No paragraphs yet, this is first in the item + if {[CloseParagraph [First]]} $op + } else { + # More paragraphs in the item + if {[CloseParagraph [Other]]} $op + } + } else { + # Currently in a regular paragraph + CloseParagraph + } +} + +proc GetCurrent {{op PAdvance}} { + if {[IsDef]} { + # Currently in a definition list. + return [Def] + } elseif {[IsPara]} { + # Currently in an (un)ordered list. + if {![Paras]} { + set res [First] + } else { + set res [Other] + } + $op + return $res + } else { + # Currently in a regular paragraph + return {} + } +} + +# # ## ### ##### ######## +## c_holdBuffers require -proc fmt_postprocess {text} {text_postprocess $text} +rename fmt_initialize BaseInitialize +proc fmt_initialize {} {BaseInitialize ; TextInitialize ; return} +proc fmt_postprocess {text} { text_postprocess $text } -################################################################ -# Implementations of the formatting commands. +# # ## ### ##### ######## +## Implementations of the formatting commands. c_pass 1 fmt_plain_text {text} NOP -c_pass 2 fmt_plain_text {text} {text_plain_text $text} +c_pass 2 fmt_plain_text {text} { text_plain_text $text } c_pass 1 fmt_manpage_begin {title section version} NOP c_pass 2 fmt_manpage_begin {title section version} { Off set module [dt_module] @@ -207,11 +265,16 @@ c_pass 1 fmt_subsection {name {id {}}} NOP c_pass 2 fmt_subsection {name {id {}}} {CloseParagraph ; Subsection $name ; return} c_pass 1 fmt_para {} NOP -c_pass 2 fmt_para {} {CloseParagraph ; return} +c_pass 2 fmt_para {} {CloseCurrent ; return} + +# NL is an alias of PARA +# See also fmt_example_begin +c_pass 1 fmt_nl {} NOP +c_pass 2 fmt_nl {} {CloseCurrent ; return } c_pass 2 fmt_require {pkg {version {}}} NOP c_pass 1 fmt_require {pkg {version {}}} { set result "package require $pkg" if {$version != {}} {append result " $version"} @@ -245,27 +308,19 @@ Section DESCRIPTION return } -################################################################ +# # ## ### ##### ######## +## c_pass 1 fmt_list_begin {what {hint {}}} NOP c_pass 2 fmt_list_begin {what {hint {}}} { #puts_stderr "<>" - global currentEnv - if {[info exists currentEnv(_definition)]} { - CloseParagraph $currentEnv(_definition) - } elseif {[info exists currentEnv(pcount)]} { - if {$currentEnv(pcount) == 0} {CloseParagraph $currentEnv(_first)} - if {$currentEnv(pcount) > 0} {CloseParagraph $currentEnv(_next)} - incr currentEnv(pcount) - } else { - CloseParagraph - } - SaveContext + CloseCurrent + ContextPush NewList $what Off #puts_stderr "<>" return @@ -273,58 +328,40 @@ c_pass 1 fmt_list_end {} NOP c_pass 2 fmt_list_end {} { #puts_stderr "<>" - global currentEnv - if {[info exists currentEnv(_definition)]} { - CloseParagraph $currentEnv(_definition) - } else { - if {$currentEnv(pcount) == 0} {CloseParagraph $currentEnv(_first)} - if {$currentEnv(pcount) > 0} {CloseParagraph $currentEnv(_next)} - } - RestoreContext + CloseCurrent + ContextPop #puts_stderr "<>" return } c_pass 1 fmt_lst_item {text} NOP c_pass 2 fmt_lst_item {text} { - global currentEnv - #puts_stderr "<>" - if {[IsOff]} { - On - } else { - CloseParagraph $currentEnv(_definition) - } + if {[IsOff]} { On } else { CloseParagraph [Def] } Text $text - CloseParagraph $currentEnv(_term) + CloseParagraph [Term] #puts_stderr "<>" return } c_pass 1 fmt_bullet {} NOP c_pass 2 fmt_bullet {} { - global currentEnv if {[IsOff]} {On ; return} - if {$currentEnv(pcount) == 0} {CloseParagraph $currentEnv(_first)} - if {$currentEnv(pcount) > 0} {CloseParagraph $currentEnv(_next)} - set currentEnv(pcount) 0 + CloseCurrent PReset return } c_pass 1 fmt_enum {} NOP c_pass 2 fmt_enum {} { - global currentEnv if {[IsOff]} {On ; return} - if {$currentEnv(pcount) == 0} {CloseParagraph $currentEnv(_first)} - if {$currentEnv(pcount) > 0} {CloseParagraph $currentEnv(_next)} - set currentEnv(pcount) 0 + CloseCurrent PReset return } c_pass 1 fmt_cmd_def {command} NOP c_pass 2 fmt_cmd_def {command} {fmt_lst_item [fmt_cmd $command]} @@ -347,55 +384,37 @@ c_pass 1 fmt_tkoption_def {name dbname dbclass} NOP c_pass 2 fmt_tkoption_def {name dbname dbclass} { set text "" append text "Command-Line Switch:\t[fmt_option $name]\n" - append text "Database Name:\t[strong $dbname]\n" - append text "Database Class:\t[strong $dbclass]\n" + append text "Database Name:\t[Strong $dbname]\n" + append text "Database Class:\t[Strong $dbclass]\n" fmt_lst_item $text } -################################################################ +# # ## ### ##### ######## +## c_pass 1 fmt_example_begin {} NOP -c_pass 2 fmt_example_begin {} { - global currentEnv para - if {[info exists currentEnv(_definition)]} { - CloseParagraph $currentEnv(_definition) - } elseif {[info exists currentEnv(pcount)]} { - if {$para != {}} { - if {$currentEnv(pcount) == 0} {CloseParagraph $currentEnv(_first)} - if {$currentEnv(pcount) > 0} {CloseParagraph $currentEnv(_next)} - incr currentEnv(pcount) - } - } else { - CloseParagraph - } - return -} +c_pass 2 fmt_example_begin {} { CloseCurrent ; return } c_pass 1 fmt_example_end {} NOP c_pass 2 fmt_example_end {} { - global currentEnv para - set penv {} - if {[info exists currentEnv(_definition)]} { - set penv $currentEnv(_definition) - } elseif {[info exists currentEnv(pcount)]} { - if {$currentEnv(pcount) == 0} {set penv $currentEnv(_first)} - if {$currentEnv(pcount) > 0} {set penv $currentEnv(_next)} - incr currentEnv(pcount) - } + TextTrimLeadingSpace + + set penv [GetCurrent] if {$penv != {}} { - # Save current list context, get chosen paragraph context and - # then create an example context form this. After closing the - # paragraph we get back our main list context. - - SaveContext - SetContext $penv + # In a list we save the current list context, activate the + # proper paragraph context and create its example + # variant. After closing the paragraph using the example we + # restore and reactivate the list context. + ContextPush + ContextSet $penv CloseParagraph [Example] - RestoreContext + ContextPop } else { + # In a regular paragraph we simple close the example CloseParagraph [Example] } return } @@ -405,52 +424,40 @@ fmt_plain_text $code fmt_example_end return } -c_pass 1 fmt_nl {} NOP -c_pass 2 fmt_nl {} { - global currentEnv - if {[info exists currentEnv(_definition)]} { - CloseParagraph $currentEnv(_definition) - } else { - if {$currentEnv(pcount) == 0} {CloseParagraph $currentEnv(_first)} - if {$currentEnv(pcount) > 0} {CloseParagraph $currentEnv(_next)} - incr currentEnv(pcount) - } - return -} - -################################################################ -# Visual markup of words and phrases. - -proc fmt_arg {text} {return $text} -proc fmt_cmd {text} {return $text} -proc fmt_emph {text} {em $text } -proc fmt_opt {text} {return "?$text?" } -proc fmt_comment {text} {return} +# # ## ### ##### ######## +## Visual markup of words and phrases. + +proc fmt_arg {text} { return $text } +proc fmt_cmd {text} { return $text } +proc fmt_emph {text} { Em $text } +proc fmt_opt {text} { return "?$text?" } +proc fmt_comment {text} { return } proc fmt_sectref {text {label {}}} { if {![string length $label]} {set label $text} return "-> $text" } -proc fmt_syscmd {text} {strong $text} -proc fmt_method {text} {return $text} -proc fmt_option {text} {return $text} -proc fmt_widget {text} {strong $text} -proc fmt_fun {text} {strong $text} -proc fmt_type {text} {strong $text} -proc fmt_package {text} {strong $text} -proc fmt_class {text} {strong $text} -proc fmt_var {text} {strong $text} -proc fmt_file {text} {return "\"$text\""} -proc fmt_namespace {text} {strong $text} + +proc fmt_syscmd {text} { Strong $text } +proc fmt_method {text} { return $text } +proc fmt_option {text} { return $text } +proc fmt_widget {text} { Strong $text } +proc fmt_fun {text} { Strong $text } +proc fmt_type {text} { Strong $text } +proc fmt_package {text} { Strong $text } +proc fmt_class {text} { Strong $text } +proc fmt_var {text} { Strong $text } +proc fmt_file {text} { return "\"$text\"" } +proc fmt_namespace {text} { Strong $text } proc fmt_uri {text {label {}}} { if {$label == {}} { # Without label we use the link directly as part of the text. return "" } else { - return "[em $label] " + return "[Em $label] " } } proc fmt_image {text {label {}}} { # text = symbolic name of the image. @@ -463,11 +470,13 @@ } } return $img } -proc fmt_term {text} {em $text} -proc fmt_const {text} {strong $text} + +proc fmt_term {text} { Em $text } +proc fmt_const {text} { Strong $text } proc fmt_mdash {} { return " --- " } proc fmt_ndash {} { return " -- " } -################################################################ +# # ## ### ##### ######## +return Index: modules/doctools/mpformats/fmt.wiki ================================================================== --- modules/doctools/mpformats/fmt.wiki +++ modules/doctools/mpformats/fmt.wiki @@ -1,10 +1,7 @@ # -*- tcl -*- -# -# fmt.nroff -# -# (c) 2002 Andreas Kupries +# (c) 2002-2019 Andreas Kupries # # [expand] definitions to convert a tcl based manpage definition into # Wiki markup. # ################################################################ @@ -48,14 +45,14 @@ # Everything else lappend lines [string map {[ [[ ] ]]} [string trimright $line]] } } } - set wiki [join $lines \n]\n + set wiki [join $lines \n] regsub {^[ ]+} $wiki {} wiki - return $wiki + return [string trim $wiki]\n } ################################################################ ## Backend for *roff markup @@ -122,11 +119,13 @@ } proc fmt_section {name {id {}}} {return "\n\n**$name**\n\n"} proc fmt_subsection {name {id {}}} {return "\n\n***$name***\n\n"} +# TODO: Modify behaviour depending on context (normal vs list) proc fmt_para {} {return \n} +proc fmt_nl {} {return \n} c_pass 2 fmt_require {pkg {version {}}} NOP c_pass 1 fmt_require {pkg {version {}}} { if {$version != {}} {set version " $version"} # @mdgen NODEP: ''' @@ -221,11 +220,10 @@ } proc emph {text} {return ''$text''} proc strong {text} {return '''$text'''} -proc fmt_nl {} {return ""} proc fmt_arg {text} {return ''$text''} proc fmt_cmd {text} {return '''$text'''} proc fmt_emph {text} {return ''$text''} proc fmt_opt {text} {return ?$text?} proc fmt_comment {text} {return {}} Index: modules/doctools/mpformats/idx.nroff ================================================================== --- modules/doctools/mpformats/idx.nroff +++ modules/doctools/mpformats/idx.nroff @@ -1,9 +1,6 @@ # -*- tcl -*- -# -# $Id: idx.nroff,v 1.7 2009/01/30 04:56:47 andreas_kupries Exp $ -# # Engine to convert a docidx document into nroff. # # Copyright (c) 2003 Andreas Kupries # Freely redistributable. # @@ -37,10 +34,14 @@ proc fmt_plain_text {text} {return {}} ################################################################ ## Backend for NROFF markup +global map ; array set map {} +global key ; set key {} +global max ; set max 0 + global prec ok haskey set prec "" set ok 0 set haskey 0 @@ -57,25 +58,44 @@ append hdr [nr_bolds]\n append hdr [nr_section INDEX]\n append hdr $title[nr_in]\n return $hdr } -proc fmt_index_end {} {return [nr_out]} -proc fmt_key {text} { + +proc fmt_index_end {} { + global map + foreach key [lsort [array names map]] { + append r $key [nr_in] \n + foreach ref $map($key) { + foreach {file label} $ref break + append r [Man $file $label] + } + append r [nr_out] \n + } + + append r [nr_out] + return $r +} + +proc fmt_key {text} { global key ; set key $text ; return } +proc fmt_manpage {file label} { global map key ; lappend map($key) [list $file $label] ; return } +proc fmt_url {url label} { global map key ; lappend map($key) [list $url $label] ; return } + +proc Key {text} { global haskey set res "" if {$haskey} {append res [nr_out]\n} append res $text[nr_in]\n set haskey 1 return $res } -proc fmt_manpage {file label} {return [nr_blt [nr_bld]$file[nr_rst]]\n$label\n} -proc fmt_url {url label} {return [nr_blt [nr_bld]$url[nr_rst]]\n$label\n} + +proc Man {file label} {return [nr_blt [nr_bld]$file[nr_rst]]\n$label\n} proc fmt_comment {text} { global prec ok - if {$ok} {return [nr_comment $text]} + if {$ok} { return [nr_comment $text] } append prec $text \n - return {} + return } ################################################################ Index: modules/doctools/mpformats/idx.text ================================================================== --- modules/doctools/mpformats/idx.text +++ modules/doctools/mpformats/idx.text @@ -1,18 +1,16 @@ # -*- tcl -*- -# -# $Id: idx.text,v 1.4 2010/06/08 19:32:36 andreas_kupries Exp $ -# # Engine to convert a docidx document into plain text. # -# Copyright (c) 2003 Andreas Kupries +# Copyright (c) 2003-2019 Andreas Kupries # Freely redistributable. # ###################################################################### dt_source _idx_common.tcl dt_source _text.tcl + proc c_copyrightsymbol {} {return "(c)"} ###################################################################### # Conversion specification. # One-pass processing. @@ -27,53 +25,53 @@ global map ; array set map {} global key ; set key {} global max ; set max 0 proc fmt_index_begin {label title} { - TextInitialize - global map ; unset map ; array set map {} global key ; set key {} global max ; set max 0 - set hdr "" - append hdr "Index [textutil::string::uncap [c_provenance]]\n\n" - if {($label != {}) && ($title != {})} { set title "$label -- $title" } elseif {$label != {}} { set title $label } elseif {$title != {}} { # title is set } - append hdr $title \n - append hdr [textutil::repeat::strRepeat = [string length $title]] - Text $hdr - CloseParagraph [Verbatim] - return -} -proc fmt_index_end {} { - global map max - - set break 0 - set rmargin [expr {80 - $max}] - if {$rmargin < 20} {set rmargin 20} - incr max - set pfx [textutil::repeat::blank $max] - - foreach key [lsort [array names map]] { - set opfx $key[string range $pfx [string length $key] end] - Text $opfx[textutil::adjust::indent [textutil::adjust::adjust [join $map($key) ", "] -length $rmargin] $pfx 1] - CloseParagraph [Verbatim] - } - return -} -proc fmt_key {text} { - global key max ; set key $text - if {[string length $text] > $max} {set max [string length $text]} - return -} -proc fmt_manpage {file label} {global map key ; lappend map($key) $file ; return} -proc fmt_url {url label} {global map key ; lappend map($key) $url ; return} + + TextInitialize + + lappend hdr "Index [Provenance]" + SectTitle hdr $title + Text [Compose hdr] + CloseParagraph [Verbatim] + return +} + +proc fmt_index_end {} { + global map max + + set rmargin [RMargin $max] + + incr max + set blank [Blank $max] ;# indent + + foreach key [lsort [array names map]] { + set keys [join $map($key) ", "] + Text [InFlow $keys $rmargin [ReHead $blank $key] $blank] + CloseParagraph [Verbatim] + } + return +} + +proc fmt_key {text} { + global key max ; set key $text + MaxLen max $text + return +} + +proc fmt_manpage {file label} {global map key ; lappend map($key) $file ; return} +proc fmt_url {url label} {global map key ; lappend map($key) $url ; return} proc fmt_comment {text} {return} ################################################################ Index: modules/doctools/mpformats/toc.html ================================================================== --- modules/doctools/mpformats/toc.html +++ modules/doctools/mpformats/toc.html @@ -1,12 +1,9 @@ # -*- tcl -*- -# -# $Id: toc.html,v 1.6 2005/09/28 04:51:19 andreas_kupries Exp $ -# # Engine to convert a doctoc document into HTML. # -# Copyright (c) 2003-2018 Andreas Kupries +# Copyright (c) 2003-2019 Andreas Kupries # Freely redistributable. # ###################################################################### dt_source _toc_common.tcl @@ -21,17 +18,13 @@ rename fmt_postprocess toc_postprocess proc fmt_plain_text {text} {return {}} ################################################################ -## Backend for TMML markup +## Backend for HTML markup -global firstitem ; set firstitem 1 -global maintable ; set maintable 1 -global even ; set even 1 - -proc fmt_toc_begin {label title} { +proc fmt_toc_begin {label title} { set hdr "" if {![Get raw]} { append hdr "[markup {}]" append hdr "[markup ]\n" append hdr "[markup ] $label [markup ]\n" @@ -51,72 +44,138 @@ lappend map @TITLE@ $label set header [string map $map $header] append hdr [markup $header]\n } - append hdr "[markup

] $label [markup

]\n" - append hdr "[markup

] $title [markup

]\n" + append hdr [markup

] + append hdr $label + append hdr [markup

] \n + append hdr [markup

] + append hdr $title + append hdr [markup

] \n + LSetup + IPush return $hdr } -proc fmt_toc_end {} { - global maintable + +proc fmt_toc_end {} { set text "\n" - if {$maintable} {append text [tag/ table]\n} + # Close table of items since last division + if {[Items]} { append text [tag/ table] \n } # Engine parameter - insert 'footer' set footer [Get footer] - if {$footer != {}} {set footer \n[markup ${footer}]\n} + if {$footer != {}} {set footer \n[markup $footer]\n} - append text [tag /dl][tag hr]${footer} + append text [tag /dd] [tag /dl] [tag hr] $footer if {![Get raw]} { - append text [tag/ body][tag/ html]\n + append text [tag/ body] [tag/ html] \n + } + + IPop ; # Assert items == {} + LOut ; # Assert level == 0 + return $text +} + +proc fmt_division_start {title symfile} { + # Close table of items before the division. Reset counter for + # items between end of this and following division. + if {[Items]} { append r [tag/ table] \n ; IReset } + + if {$symfile ne ""} { + append t [markup ""] + append t $title + append t [markup ] + set title $t + } + + append r \n [markup "
"] + append r $title + append r [markup
] + + LIn + IPush + return $r +} + +proc fmt_division_end {} { + if {[Items]} { append t [tag/ table] } + append t [tag /dl] + Even! + IPop + LOut + return $t +} + +proc fmt_item {file label desc} { + if {[IFirst]} { append text \n[markup ""]\n } + INext + + if {[Even]} { + append text [markup ""]\n + } else { + append text [markup ""]\n } + EFlip + append text [markup "
"] + append text [markup ""] + append text $label + append text [tag/ a][tag/ td]\n + append text [markup ""]${desc}[tag /td]\n + append text [tag/ tr]\n return $text } +proc fmt_comment {text} {ht_comment $text} + +################################################################ + +proc Term {text} { return [tag dt]${text}[tag /dt] } +proc Def {text} { return [tag dd]${text}[tag /dd] } + proc Anchor {text} { set anchor [regsub -all {[^a-zA-Z0-9]} [string tolower $text] {_}] set anchor [regsub -all {__+} $anchor _] return $anchor } -proc fmt_division_start {title symfile} { - global maintable ; set maintable 0 - - if {$symfile ne ""} { - set title [markup ""]$title[markup ] - } - - return \n[markup "
"]$title[markup
] -} -proc fmt_division_end {} { - global firstitem ; set firstitem 1 - global even ; set even 1 - return [markup
] -} -proc fmt_item {file label desc} { - global firstitem even - set text "" - - if {$firstitem} { - set firstitem 0 - append text \n[markup ""]\n - } - - if {$even} { - append text [markup ""]\n - } else { - append text [markup ""]\n - } - set even [expr {1-$even}] - append text [markup "
"][markup ""]$label[tag/ a][tag/ td]\n - append text [markup ""]${desc}[tag /td]\n - append text [tag/ tr]\n - return $text -} -proc fmt_comment {text} {ht_comment $text} +################################################################ + +global __level +global __items ; set __items {} +global __istack ; set __istack {} +global __even ; set __even 1 + +proc Even! {} { global __even ; set __even 1 } +proc Even {} { global __even ; set __even } +proc EFlip {} { global __even ; set __even [expr {1 - $__even}] } + + +proc LSetup {} { global __level ; set __level 0 } +proc LIn {} { global __level ; incr __level 1 } +proc LOut {} { global __level ; incr __level -1 } +proc LTop {} { global __level ; expr {!$__level } } + +proc IReset {} { global __items ; set __items 0 } +proc INext {} { global __items ; incr __items } +proc IFirst {} { global __items ; expr {!$__items} } +proc Items {} { global __items ; set __items } + +proc IPush {} { + global __istack __items + lappend __istack $__items + set __items 0 + return +} + +proc IPop {} { + global __items __istack + set __items [lindex $__istack end] + set __istack [lreplace $__istack end end] + return +} ################################################################ global __var array set __var { Index: modules/doctools/mpformats/toc.nroff ================================================================== --- modules/doctools/mpformats/toc.nroff +++ modules/doctools/mpformats/toc.nroff @@ -1,12 +1,9 @@ # -*- tcl -*- -# -# $Id: toc.nroff,v 1.7 2009/01/30 04:56:47 andreas_kupries Exp $ -# # Engine to convert a doctoc document into nroff. # -# Copyright (c) 2003 Andreas Kupries +# Copyright (c) 2003-2019 Andreas Kupries # Freely redistributable. # ###################################################################### dt_source _toc_common.tcl @@ -41,11 +38,11 @@ global prec ok set prec "" set ok 0 -proc fmt_toc_begin {label title} { +proc fmt_toc_begin {label title} { global prec ok set ok 1 set hdr [nr_comment {}]\n if {$prec != {}} { set hdr [nr_comment $prec]\n @@ -57,11 +54,11 @@ append hdr [nr_section CONTENTS]\n append hdr $title[nr_in]\n return $hdr } proc fmt_toc_end {} {} -proc fmt_division_start {title symfile} {return $title[nr_in]\n} +proc fmt_division_start {title symfile} {return [nr_blt $title][nr_in]\n} proc fmt_division_end {} {return [nr_out]\n} proc fmt_item {file label desc} {return "[nr_blt [nr_bld]$label[nr_rst]]\n[nr_ul]$file[nr_rst]: $desc\n"} proc fmt_comment {text} { global prec ok Index: modules/doctools/mpformats/toc.text ================================================================== --- modules/doctools/mpformats/toc.text +++ modules/doctools/mpformats/toc.text @@ -1,12 +1,9 @@ # -*- tcl -*- -# -# $Id: toc.text,v 1.8 2010/06/08 19:13:53 andreas_kupries Exp $ -# # Engine to convert a doctoc document into plain text. # -# Copyright (c) 2003 Andreas Kupries +# Copyright (c) 2003-2019 Andreas Kupries # Freely redistributable. # ###################################################################### dt_source _toc_common.tcl @@ -20,69 +17,90 @@ rename text_postprocess toc_postprocess proc fmt_plain_text {text} {return {}} ################################################################ -## Backend for TMML markup - -global seclist ; set seclist {} -global max ; set max 0 - -proc fmt_comment {text} {return} -proc fmt_toc_end {} {return} -proc fmt_toc_begin {label title} { - TextInitialize - - set title "$label -- $title" - set hdr "" - append hdr "Table of contents [textutil::string::uncap [c_provenance]]\n" - append hdr \n - append hdr $title \n - append hdr [textutil::repeat::strRepeat = [string length $title]] - Text $hdr - CloseParagraph [Verbatim] -} -proc fmt_division_start {title symfile} { - global lmarginIncrement currentEnv - global seclist ; set seclist {} - global max ; set max 0 - - Text $title\n - Text [textutil::repeat::strRepeat - [string length $title]] - CloseParagraph [Verbatim] - SaveContext - NewEnv Division { - incr currentEnv(lmargin) $lmarginIncrement - } - return -} -proc fmt_division_end {} { - global seclist max - - if {[llength $seclist] > 0} { - set break 0 - incr max 2 - set rmargin [expr {80 - $max}] - if {$rmargin < 20} {set rmargin 20} - set pfx [textutil::blank $max] - incr max -1 - set fpfx "[textutil::repeat::strRepeat . $max] " - - foreach {file desc} $seclist { - set opfx "$file [string range $fpfx [string length $file] end]" - Text $opfx[textutil::adjust::indent [textutil::adjust::adjust $desc -length $rmargin] $pfx 1] - CloseParagraph [Verbatim] - } - set seclist {} - } - - RestoreContext - return -} -proc fmt_item {file label desc} { - global seclist max - lappend seclist $file $desc - if {[string length $file] > $max} {set max [string length $file]} - return -} +## Backend for TEXT markup + +global seclist ; set seclist {} +global max ; set max 0 + +proc InitSections {} { + global seclist ; set seclist {} ;# list of items in this division + global max ; set max 0 ;# length of longest file path in the division + return +} + +proc ProcessSections {} { + global seclist max + + if {![llength $seclist]} { + # Division is empty, nothing to do + return + } + + incr max 2 ; set rmargin [RMargin $max] + incr max -1 ; set blank [Blank $max] + incr max -1 ; set dots "[Repeat . $max] " + + # Example wrt max handling, blank, and dots: + # + # string = "longest", max = 7 +2 => max = lmargin = 9 + # blank = "________" (max = 8, using _ as visible placeholder) + # dots = "......._" (max = 7 (dots)) + + foreach {file desc} $seclist { + Text [InFlow $desc $rmargin [ReHead $dots "$file "] $blank] + CloseParagraph [Verbatim] + } + + set seclist {} + return +} + +proc fmt_toc_begin {label title} { + set title "$label -- $title" + + TextInitialize + lappend hdr "Table of contents [Provenance]" + lappend hdr "" + SectTitle hdr $title + Text [Compose hdr] + CloseParagraph [Verbatim] + return +} + +proc fmt_toc_end {} { + ProcessSections + return +} + +proc fmt_division_start {title symfile} { + # We may have sections before the new division + ProcessSections + + InitSections + SubsectTitle hdr $title + Text [Compose hdr] + CloseParagraph [Verbatim] + + ContextPush ;# Ref (a) + ContextNew Division { MarginIn } + return +} + +proc fmt_division_end {} { + ProcessSections + ContextPop ;# Ref (a) + return +} + +proc fmt_item {file label desc} { + global seclist max + lappend seclist $file $desc + MaxLen max $file + return +} + +proc fmt_comment {text} {return} ################################################################ Index: modules/doctools/mpformats/toc.tmml ================================================================== --- modules/doctools/mpformats/toc.tmml +++ modules/doctools/mpformats/toc.tmml @@ -1,12 +1,9 @@ # -*- tcl -*- -# -# $Id: toc.tmml,v 1.6 2005/09/28 04:51:19 andreas_kupries Exp $ -# # Engine to convert a doctoc document into TMML. # -# Copyright (c) 2003 Andreas Kupries +# Copyright (c) 2003-2019 Andreas Kupries # Freely redistributable. # # See also # ###################################################################### @@ -27,11 +24,11 @@ ################################################################ ## Backend for TMML markup proc fmt_toc_begin {label title} {sequence [start manual package $label] [wrap $title title]} proc fmt_toc_end {} {end manual} -proc fmt_division_start {title symfile} {sequence [start division] [wrap $text title]} +proc fmt_division_start {title symfile} {sequence [start division] [wrap $title title]} proc fmt_division_end {} {end division} proc fmt_item {file label desc} {emptyElement subdoc href [dt_fmap $file]} proc fmt_comment {text} {xmlComment $text} ################################################################ ADDED modules/doctools/tests/desc/09 Index: modules/doctools/tests/desc/09 ================================================================== --- /dev/null +++ modules/doctools/tests/desc/09 ADDED modules/doctools/tests/desc/10 Index: modules/doctools/tests/desc/10 ================================================================== --- /dev/null +++ modules/doctools/tests/desc/10 ADDED modules/doctools/tests/desc/11 Index: modules/doctools/tests/desc/11 ================================================================== --- /dev/null +++ modules/doctools/tests/desc/11 ADDED modules/doctools/tests/desc/12 Index: modules/doctools/tests/desc/12 ================================================================== --- /dev/null +++ modules/doctools/tests/desc/12 ADDED modules/doctools/tests/desc/13 Index: modules/doctools/tests/desc/13 ================================================================== --- /dev/null +++ modules/doctools/tests/desc/13 ADDED modules/doctools/tests/desc/14 Index: modules/doctools/tests/desc/14 ================================================================== --- /dev/null +++ modules/doctools/tests/desc/14 ADDED modules/doctools/tests/desc/15 Index: modules/doctools/tests/desc/15 ================================================================== --- /dev/null +++ modules/doctools/tests/desc/15 Index: modules/doctools/tests/html/05 ================================================================== --- modules/doctools/tests/html/05 +++ modules/doctools/tests/html/05 @@ -1,6 +1,5 @@ - BASIC - + + + + +
+

TEST(z) 3.14.15.926 .MODULE. ""

+

Name

+

TEST -

+
+ +

Description

+

lorem

+
+1 lorem ipsum dolores
+
+

ipsum

+
 2 lorem ipsum dolores 
+

dolores

+
+3 lorem ipsum dolores
+
+

lorem

+
 4 lorem ipsum dolores
+
+

ipsum

+
+5 lorem ipsum dolores 
+

dolores

+
+ +
ADDED modules/doctools/tests/html/10 Index: modules/doctools/tests/html/10 ================================================================== --- /dev/null +++ modules/doctools/tests/html/10 @@ -0,0 +1,126 @@ + +test-itemized - + + + + + +
+

test-itemized(1) n .MODULE. ""

+

Name

+

test-itemized -

+
+ +

Description

+

lorem ipsum dolores

+
    +
  • lorem ipsum dolores

  • +
  • lorem ipsum dolores

    +

    lorem ipsum dolores

  • +
  • lorem ipsum dolores

    +

    lorem ipsum dolores

    +

    lorem ipsum dolores

  • +
+
+ +
ADDED modules/doctools/tests/html/11 Index: modules/doctools/tests/html/11 ================================================================== --- /dev/null +++ modules/doctools/tests/html/11 @@ -0,0 +1,126 @@ + +test-enumerated - + + + + + +
+

test-enumerated(1) n .MODULE. ""

+

Name

+

test-enumerated -

+
+ +

Description

+

lorem ipsum dolores

+
    +
  1. lorem ipsum dolores

  2. +
  3. lorem ipsum dolores

    +

    lorem ipsum dolores

  4. +
  5. lorem ipsum dolores

    +

    lorem ipsum dolores

    +

    lorem ipsum dolores

  6. +
+
+ +
ADDED modules/doctools/tests/html/12 Index: modules/doctools/tests/html/12 ================================================================== --- /dev/null +++ modules/doctools/tests/html/12 @@ -0,0 +1,129 @@ + +test-definitions - + + + + + +
+

test-definitions(1) n .MODULE. ""

+

Name

+

test-definitions -

+
+ +

Description

+

lorem ipsum dolores

+
+
lorem
+

ipsum dolores

+
lorem
+

ipsum dolores

+

lorem ipsum dolores

+
lorem
+

ipsum dolores

+

lorem ipsum dolores

+

lorem ipsum dolores

+
+
+ +
ADDED modules/doctools/tests/html/13 Index: modules/doctools/tests/html/13 ================================================================== --- /dev/null +++ modules/doctools/tests/html/13 @@ -0,0 +1,130 @@ + +test-itemized-examples - + + + + + +
+

test-itemized-examples(1) n .MODULE. ""

+

Name

+

test-itemized-examples -

+
+ +

Description

+

lorem ipsum dolores

+
    +
  • +
     A lorem ipsum dolores 
    +
  • +
  • lorem ipsum dolores

    +
     B lorem ipsum dolores 
    +

    lorem ipsum dolores

  • +
  • lorem ipsum dolores

    +
     C lorem ipsum dolores 
    +
  • +
  • lorem ipsum dolores

  • +
+
+ +
ADDED modules/doctools/tests/html/14 Index: modules/doctools/tests/html/14 ================================================================== --- /dev/null +++ modules/doctools/tests/html/14 @@ -0,0 +1,130 @@ + +test-enumerated-examples - + + + + + +
+

test-enumerated-examples(1) n .MODULE. ""

+

Name

+

test-enumerated-examples -

+
+ +

Description

+

lorem ipsum dolores

+
    +
  1. +
     A1 lorem ipsum dolores 
    +
  2. +
  3. lorem ipsum dolores

    +
     B2 lorem ipsum dolores 
    +

    lorem ipsum dolores

  4. +
  5. lorem ipsum dolores

    +
     C3 lorem ipsum dolores 
    +
  6. +
  7. lorem ipsum dolores

  8. +
+
+ +
ADDED modules/doctools/tests/html/15 Index: modules/doctools/tests/html/15 ================================================================== --- /dev/null +++ modules/doctools/tests/html/15 @@ -0,0 +1,134 @@ + +test-definition-examples - + + + + + +
+

test-definition-examples(1) n .MODULE. ""

+

Name

+

test-definition-examples -

+
+ +

Description

+

lorem ipsum dolores

+
+
lorem
+
+
 A1 lorem ipsum dolores 
+
+
lorem
+

ipsum dolores

+
 B2 lorem ipsum dolores 
+

lorem ipsum dolores

+
lorem
+

ipsum dolores

+
 C3 lorem ipsum dolores 
+
+
lorem
+

ipsum dolores

+
+
+ +
ADDED modules/doctools/tests/idx/html/00 Index: modules/doctools/tests/idx/html/00 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/html/00 @@ -0,0 +1,16 @@ + + + + + + KWIC + + +

KWIC -- Test

+
+
+
+
+ ADDED modules/doctools/tests/idx/html/01 Index: modules/doctools/tests/idx/html/01 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/html/01 @@ -0,0 +1,25 @@ + + + + + + KWIC + + +

KWIC -- Test

+
+ L +
+
+ + + + +
+Keywords: L +
lorem + dolores +
+ ADDED modules/doctools/tests/idx/html/02 Index: modules/doctools/tests/idx/html/02 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/html/02 @@ -0,0 +1,33 @@ + + + + + + KWIC + + +

KWIC -- Test

+
+ D · L +
+
+ + + + + + + + +
+Keywords: D +
dolores + ipsum · lorem · dolores +
+Keywords: L +
lorem + dolores · ipsum +
+ ADDED modules/doctools/tests/idx/idx/00 Index: modules/doctools/tests/idx/idx/00 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/idx/00 @@ -0,0 +1,3 @@ +[comment { -- basic empty }] +[index_begin KWIC Test] +[index_end] ADDED modules/doctools/tests/idx/idx/01 Index: modules/doctools/tests/idx/idx/01 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/idx/01 @@ -0,0 +1,5 @@ +[comment { -- basic key }] +[index_begin KWIC Test] +[key lorem] +[manpage ipsum dolores] +[index_end] ADDED modules/doctools/tests/idx/idx/02 Index: modules/doctools/tests/idx/idx/02 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/idx/02 @@ -0,0 +1,10 @@ +[comment { -- multiple keys }] +[index_begin KWIC Test] +[key lorem] +[manpage ipsum dolores] +[manpage lorem ipsum] +[key dolores] +[manpage lorem ipsum] +[manpage dolores lorem] +[manpage ipsum dolores] +[index_end] ADDED modules/doctools/tests/idx/nroff/00 Index: modules/doctools/tests/idx/nroff/00 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/nroff/00 @@ -0,0 +1,9 @@ +'\" +'\" Generated by tcllib/doctools/idx with format 'nroff' +.TH "KWIC" n +.so man.macros +.BS +.SH INDEX +Test +.RS +.RE ADDED modules/doctools/tests/idx/nroff/01 Index: modules/doctools/tests/idx/nroff/01 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/nroff/01 @@ -0,0 +1,15 @@ +'\" +'\" Generated by tcllib/doctools/idx with format 'nroff' +.TH "KWIC" n +.so man.macros +.BS +.SH INDEX +Test +.RS +lorem +.RS +.TP +\fBipsum\fR +dolores +.RE +.RE ADDED modules/doctools/tests/idx/nroff/02 Index: modules/doctools/tests/idx/nroff/02 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/nroff/02 @@ -0,0 +1,296 @@ +'\" +'\" Generated by tcllib/doctools/idx with format 'nroff' +.TH "KWIC" n +.\" The -*- nroff -*- definitions below are for supplemental macros used +.\" in Tcl/Tk manual entries. +.\" +.\" .AP type name in/out ?indent? +.\" Start paragraph describing an argument to a library procedure. +.\" type is type of argument (int, etc.), in/out is either "in", "out", +.\" or "in/out" to describe whether procedure reads or modifies arg, +.\" and indent is equivalent to second arg of .IP (shouldn't ever be +.\" needed; use .AS below instead) +.\" +.\" .AS ?type? ?name? +.\" Give maximum sizes of arguments for setting tab stops. Type and +.\" name are examples of largest possible arguments that will be passed +.\" to .AP later. If args are omitted, default tab stops are used. +.\" +.\" .BS +.\" Start box enclosure. From here until next .BE, everything will be +.\" enclosed in one large box. +.\" +.\" .BE +.\" End of box enclosure. +.\" +.\" .CS +.\" Begin code excerpt. +.\" +.\" .CE +.\" End code excerpt. +.\" +.\" .VS ?version? ?br? +.\" Begin vertical sidebar, for use in marking newly-changed parts +.\" of man pages. The first argument is ignored and used for recording +.\" the version when the .VS was added, so that the sidebars can be +.\" found and removed when they reach a certain age. If another argument +.\" is present, then a line break is forced before starting the sidebar. +.\" +.\" .VE +.\" End of vertical sidebar. +.\" +.\" .DS +.\" Begin an indented unfilled display. +.\" +.\" .DE +.\" End of indented unfilled display. +.\" +.\" .SO ?manpage? +.\" Start of list of standard options for a Tk widget. The manpage +.\" argument defines where to look up the standard options; if +.\" omitted, defaults to "options". The options follow on successive +.\" lines, in three columns separated by tabs. +.\" +.\" .SE +.\" End of list of standard options for a Tk widget. +.\" +.\" .OP cmdName dbName dbClass +.\" Start of description of a specific option. cmdName gives the +.\" option's name as specified in the class command, dbName gives +.\" the option's name in the option database, and dbClass gives +.\" the option's class in the option database. +.\" +.\" .UL arg1 arg2 +.\" Print arg1 underlined, then print arg2 normally. +.\" +.\" .QW arg1 ?arg2? +.\" Print arg1 in quotes, then arg2 normally (for trailing punctuation). +.\" +.\" .PQ arg1 ?arg2? +.\" Print an open parenthesis, arg1 in quotes, then arg2 normally +.\" (for trailing punctuation) and then a closing parenthesis. +.\" +.\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. +.if t .wh -1.3i ^B +.nr ^l \n(.l +.ad b +.\" # Start an argument description +.de AP +.ie !"\\$4"" .TP \\$4 +.el \{\ +. ie !"\\$2"" .TP \\n()Cu +. el .TP 15 +.\} +.ta \\n()Au \\n()Bu +.ie !"\\$3"" \{\ +\&\\$1 \\fI\\$2\\fP (\\$3) +.\".b +.\} +.el \{\ +.br +.ie !"\\$2"" \{\ +\&\\$1 \\fI\\$2\\fP +.\} +.el \{\ +\&\\fI\\$1\\fP +.\} +.\} +.. +.\" # define tabbing values for .AP +.de AS +.nr )A 10n +.if !"\\$1"" .nr )A \\w'\\$1'u+3n +.nr )B \\n()Au+15n +.\" +.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n +.nr )C \\n()Bu+\\w'(in/out)'u+2n +.. +.AS Tcl_Interp Tcl_CreateInterp in/out +.\" # BS - start boxed text +.\" # ^y = starting y location +.\" # ^b = 1 +.de BS +.br +.mk ^y +.nr ^b 1u +.if n .nf +.if n .ti 0 +.if n \l'\\n(.lu\(ul' +.if n .fi +.. +.\" # BE - end boxed text (draw box now) +.de BE +.nf +.ti 0 +.mk ^t +.ie n \l'\\n(^lu\(ul' +.el \{\ +.\" Draw four-sided box normally, but don't draw top of +.\" box if the box started on an earlier page. +.ie !\\n(^b-1 \{\ +\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' +.\} +.el \}\ +\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' +.\} +.\} +.fi +.br +.nr ^b 0 +.. +.\" # VS - start vertical sidebar +.\" # ^Y = starting y location +.\" # ^v = 1 (for troff; for nroff this doesn't matter) +.de VS +.if !"\\$2"" .br +.mk ^Y +.ie n 'mc \s12\(br\s0 +.el .nr ^v 1u +.. +.\" # VE - end of vertical sidebar +.de VE +.ie n 'mc +.el \{\ +.ev 2 +.nf +.ti 0 +.mk ^t +\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' +.sp -1 +.fi +.ev +.\} +.nr ^v 0 +.. +.\" # Special macro to handle page bottom: finish off current +.\" # box/sidebar if in box/sidebar mode, then invoked standard +.\" # page bottom macro. +.de ^B +.ev 2 +'ti 0 +'nf +.mk ^t +.if \\n(^b \{\ +.\" Draw three-sided box if this is the box's first page, +.\" draw two sides but no top otherwise. +.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c +.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c +.\} +.if \\n(^v \{\ +.nr ^x \\n(^tu+1v-\\n(^Yu +\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c +.\} +.bp +'fi +.ev +.if \\n(^b \{\ +.mk ^y +.nr ^b 2 +.\} +.if \\n(^v \{\ +.mk ^Y +.\} +.. +.\" # DS - begin display +.de DS +.RS +.nf +.sp +.. +.\" # DE - end display +.de DE +.fi +.RE +.sp +.. +.\" # SO - start of list of standard options +.de SO +'ie '\\$1'' .ds So \\fBoptions\\fR +'el .ds So \\fB\\$1\\fR +.SH "STANDARD OPTIONS" +.LP +.nf +.ta 5.5c 11c +.ft B +.. +.\" # SE - end of list of standard options +.de SE +.fi +.ft R +.LP +See the \\*(So manual entry for details on the standard options. +.. +.\" # OP - start of full description for a single option +.de OP +.LP +.nf +.ta 4c +Command-Line Name: \\fB\\$1\\fR +Database Name: \\fB\\$2\\fR +Database Class: \\fB\\$3\\fR +.fi +.IP +.. +.\" # CS - begin code excerpt +.de CS +.RS +.nf +.ta .25i .5i .75i 1i +.. +.\" # CE - end code excerpt +.de CE +.fi +.RE +.. +.\" # UL - underline word +.de UL +\\$1\l'|0\(ul'\\$2 +.. +.\" # QW - apply quotation marks to word +.de QW +.ie '\\*(lq'"' ``\\$1''\\$2 +.\"" fix emacs highlighting +.el \\*(lq\\$1\\*(rq\\$2 +.. +.\" # PQ - apply parens and quotation marks to word +.de PQ +.ie '\\*(lq'"' (``\\$1''\\$2)\\$3 +.\"" fix emacs highlighting +.el (\\*(lq\\$1\\*(rq\\$2)\\$3 +.. +.\" # QR - quoted range +.de QR +.ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3 +.\"" fix emacs highlighting +.el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3 +.. +.\" # MT - "empty" string +.de MT +.QW "" +.. +.BS +.SH INDEX +Test +.RS +dolores +.RS +.TP +\fBlorem\fR +ipsum +.TP +\fBdolores\fR +lorem +.TP +\fBipsum\fR +dolores +.RE +lorem +.RS +.TP +\fBipsum\fR +dolores +.TP +\fBlorem\fR +ipsum +.RE +.RE ADDED modules/doctools/tests/idx/null/00 Index: modules/doctools/tests/idx/null/00 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/null/00 ADDED modules/doctools/tests/idx/null/01 Index: modules/doctools/tests/idx/null/01 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/null/01 ADDED modules/doctools/tests/idx/null/02 Index: modules/doctools/tests/idx/null/02 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/null/02 ADDED modules/doctools/tests/idx/text/00 Index: modules/doctools/tests/idx/text/00 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/text/00 @@ -0,0 +1,4 @@ + +Index generated by tcllib/doctools/idx with format 'text' +KWIC -- Test +============ ADDED modules/doctools/tests/idx/text/01 Index: modules/doctools/tests/idx/text/01 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/text/01 @@ -0,0 +1,6 @@ + +Index generated by tcllib/doctools/idx with format 'text' +KWIC -- Test +============ + +lorem ipsum ADDED modules/doctools/tests/idx/text/02 Index: modules/doctools/tests/idx/text/02 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/text/02 @@ -0,0 +1,8 @@ + +Index generated by tcllib/doctools/idx with format 'text' +KWIC -- Test +============ + +dolores lorem, dolores, ipsum + +lorem ipsum, lorem ADDED modules/doctools/tests/idx/wiki/00 Index: modules/doctools/tests/idx/wiki/00 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/wiki/00 @@ -0,0 +1,3 @@ +Index '''KWIC''' +'''Test''' + ADDED modules/doctools/tests/idx/wiki/01 Index: modules/doctools/tests/idx/wiki/01 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/wiki/01 @@ -0,0 +1,4 @@ +Index '''KWIC''' +'''Test''' + + '''lorem''': ipsum ADDED modules/doctools/tests/idx/wiki/02 Index: modules/doctools/tests/idx/wiki/02 ================================================================== --- /dev/null +++ modules/doctools/tests/idx/wiki/02 @@ -0,0 +1,5 @@ +Index '''KWIC''' +'''Test''' + + '''lorem''': ipsum lorem + '''dolores''': lorem dolores ipsum Index: modules/doctools/tests/latex/00 ================================================================== --- modules/doctools/tests/latex/00 +++ modules/doctools/tests/latex/00 @@ -1,8 +1,8 @@ % Generated from file '.FILE.' by tcllib/doctools with format 'latex' % Copyright (c) .COPYRIGHT. -% CVS: @ID@ TEST.z +% TEST.z \documentclass{article} \begin{document} \author{@USR@} \title{.MODULE. / TEST -- : } \maketitle Index: modules/doctools/tests/latex/01 ================================================================== --- modules/doctools/tests/latex/01 +++ modules/doctools/tests/latex/01 @@ -1,8 +1,8 @@ % Generated from file '.FILE.' by tcllib/doctools with format 'latex' % Copyright (c) **Copyright** -% CVS: @ID@ TEST.z +% TEST.z \documentclass{article} \begin{document} \author{@USR@} \title{.MODULE. / TEST -- : } \maketitle Index: modules/doctools/tests/latex/02 ================================================================== --- modules/doctools/tests/latex/02 +++ modules/doctools/tests/latex/02 @@ -1,8 +1,8 @@ % Generated from file '.FILE.' by tcllib/doctools with format 'latex' % Copyright (c) .COPYRIGHT. -% CVS: @ID@ TEST.z +% TEST.z \documentclass{article} \begin{document} \author{@USR@} \title{.MODULE. / TEST -- ..THE\_MODULE.. : ..THE\_TITLE..} \maketitle Index: modules/doctools/tests/latex/03 ================================================================== --- modules/doctools/tests/latex/03 +++ modules/doctools/tests/latex/03 @@ -1,8 +1,8 @@ % Generated from file '.FILE.' by tcllib/doctools with format 'latex' % Copyright (c) .COPYRIGHT. -% CVS: @ID@ TEST.z +% TEST.z \documentclass{article} \begin{document} \author{@USR@} \title{.MODULE. / TEST -- : } \maketitle @@ -15,12 +15,14 @@ 333 \subsection{BbB.dDd}\label{subsection2} 4444 \section{EeE}\label{section4} 5555 + At {\bf AaA (\ref{section2})}. + At {\bf \_\_undefined\_\_ (\ref{\_\_undefined\_\_})}. \section{Copyright}\label{copyright} \begin{flushleft} Copyright (c) .COPYRIGHT.\linebreak \end{flushleft} \end{document} Index: modules/doctools/tests/latex/04 ================================================================== --- modules/doctools/tests/latex/04 +++ modules/doctools/tests/latex/04 @@ -1,8 +1,8 @@ % Generated from file '.FILE.' by tcllib/doctools with format 'latex' % Copyright (c) .COPYRIGHT. -% CVS: @ID@ TEST.z +% TEST.z \documentclass{article} \begin{document} \author{@USR@} \title{.MODULE. / TEST -- : } \maketitle @@ -9,10 +9,11 @@ \section{Description}\label{section1} BEGINNE HIER \begin{verbatim} Example Block More Lines \end{verbatim} + \begin{verbatim} Inlined Example \ Next Line \end{verbatim} FERTIG Index: modules/doctools/tests/latex/05 ================================================================== --- modules/doctools/tests/latex/05 +++ modules/doctools/tests/latex/05 @@ -1,20 +1,20 @@ - % Generated from file '.FILE.' by tcllib/doctools with format 'latex' % Copyright (c) .COPYRIGHT. -% CVS: @ID@ BASIC.a +% BASIC.a \documentclass{article} \begin{document} \author{@USR@} \title{.MODULE. / BASIC -- : } \maketitle \section{Synopsis}\label{synopsis} \begin{itemize} -\item[] a-command +\item[] a-command \end{itemize} \section{Description}\label{section1} OK + \begin{itemize} % \item[] \underline{argument-1} integer % verification @@ -21,10 +21,11 @@ % \item[] \underline{argument-2} string (out) % mogrification \end{itemize} + \begin{itemize} % \item[] {\bf command-a} % explanation @@ -31,44 +32,52 @@ % \item[] {\bf command-b} % elucidation \end{itemize} + \begin{itemize} % \item[] term % definition % -\item[] a-command +\item[] a-command % semantic \end{itemize} + \begin{enumerate} % \item % A % \item % B + C + D \end{enumerate} + \begin{itemize} % \item % 1 % \item % 2 + 2a + 2b \end{itemize} + \begin{itemize} % \item[] {\bf option-1} % meaning @@ -75,10 +84,11 @@ % \item[] {\bf option-2} value % elaboration \end{itemize} + \begin{itemize} % \item[] Command-Line Switch: {\bf background}\\ Database Name: {\bf Background}\\ Database Class: {\bf Color}\\ @@ -89,11 +99,12 @@ Database Name: {\bf Foreground}\\ Database Class: {\bf Color}\\ % caramel \end{itemize} + KO \section{Copyright}\label{copyright} \begin{flushleft} Copyright (c) .COPYRIGHT.\linebreak \end{flushleft} \end{document} Index: modules/doctools/tests/latex/06 ================================================================== --- modules/doctools/tests/latex/06 +++ modules/doctools/tests/latex/06 @@ -1,8 +1,8 @@ % Generated from file '.FILE.' by tcllib/doctools with format 'latex' % Copyright (c) .COPYRIGHT. -% CVS: @ID@ TEST.z +% TEST.z \documentclass{article} \begin{document} \author{@USR@} \title{.MODULE. / TEST -- : } \maketitle @@ -9,19 +9,27 @@ \section{Description}\label{section1} \begin{itemize} % \item % - 1 2 3 + 1 + +2 + +3 % \item % \begin{enumerate} % \item % - a b c + a + +b + +c % \item % \begin{itemize} % @@ -38,17 +46,25 @@ gork \end{itemize} % \item % - a b c + a + +b + +c \end{enumerate} % \item % - 4 5 6 + 4 + +5 + +6 \end{itemize} \section{Copyright}\label{copyright} \begin{flushleft} Copyright (c) .COPYRIGHT.\linebreak \end{flushleft} \end{document} Index: modules/doctools/tests/latex/07 ================================================================== --- modules/doctools/tests/latex/07 +++ modules/doctools/tests/latex/07 @@ -1,8 +1,8 @@ % Generated from file '.FILE.' by tcllib/doctools with format 'latex' % Copyright (c) .COPYRIGHT. -% CVS: @ID@ TEST.z +% TEST.z \documentclass{article} \begin{document} \author{@USR@} \title{.MODULE. / TEST -- : } \maketitle Index: modules/doctools/tests/latex/08 ================================================================== --- modules/doctools/tests/latex/08 +++ modules/doctools/tests/latex/08 @@ -1,9 +1,8 @@ - % Generated from file '.FILE.' by tcllib/doctools with format 'latex' % Copyright (c) **Copyright** -% CVS: @ID@ ALL.a +% ALL.a \documentclass{article} \begin{document} \author{@USR@} \title{.MODULE. / ALL -- ..THE\_MODULE.. : ..THE\_TITLE..} \maketitle ADDED modules/doctools/tests/latex/09 Index: modules/doctools/tests/latex/09 ================================================================== --- /dev/null +++ modules/doctools/tests/latex/09 @@ -0,0 +1,31 @@ +% Generated from file '.FILE.' by tcllib/doctools with format 'latex' +% Copyright (c) .COPYRIGHT. +% TEST.z +\documentclass{article} +\begin{document} +\author{aku} +\title{.MODULE. / TEST -- : } +\maketitle +\section{Description}\label{section1} +lorem +\begin{verbatim} +1 lorem ipsum dolores +\end{verbatim} +ipsum +\begin{verbatim} 2 lorem ipsum dolores \end{verbatim} +dolores +\begin{verbatim} +3 lorem ipsum dolores +\end{verbatim} +lorem +\begin{verbatim} 4 lorem ipsum dolores +\end{verbatim} +ipsum +\begin{verbatim} +5 lorem ipsum dolores \end{verbatim} +dolores +\section{Copyright}\label{copyright} +\begin{flushleft} +Copyright (c) .COPYRIGHT.\linebreak +\end{flushleft} +\end{document} ADDED modules/doctools/tests/latex/10 Index: modules/doctools/tests/latex/10 ================================================================== --- /dev/null +++ modules/doctools/tests/latex/10 @@ -0,0 +1,35 @@ +% Generated from file '.FILE.' by tcllib/doctools with format 'latex' +% Copyright (c) .COPYRIGHT. +% test-itemized.1 +\documentclass{article} +\begin{document} +\author{aku} +\title{.MODULE. / test-itemized -- : } +\maketitle +\section{Description}\label{section1} +lorem ipsum dolores +\begin{itemize} +% +\item +% + lorem ipsum dolores +% +\item +% + lorem ipsum dolores + +lorem ipsum dolores +% +\item +% + lorem ipsum dolores + +lorem ipsum dolores + +lorem ipsum dolores +\end{itemize} +\section{Copyright}\label{copyright} +\begin{flushleft} +Copyright (c) .COPYRIGHT.\linebreak +\end{flushleft} +\end{document} ADDED modules/doctools/tests/latex/11 Index: modules/doctools/tests/latex/11 ================================================================== --- /dev/null +++ modules/doctools/tests/latex/11 @@ -0,0 +1,35 @@ +% Generated from file '.FILE.' by tcllib/doctools with format 'latex' +% Copyright (c) .COPYRIGHT. +% test-enumerated.1 +\documentclass{article} +\begin{document} +\author{aku} +\title{.MODULE. / test-enumerated -- : } +\maketitle +\section{Description}\label{section1} +lorem ipsum dolores +\begin{enumerate} +% +\item +% + lorem ipsum dolores +% +\item +% + lorem ipsum dolores + +lorem ipsum dolores +% +\item +% + lorem ipsum dolores + +lorem ipsum dolores + +lorem ipsum dolores +\end{enumerate} +\section{Copyright}\label{copyright} +\begin{flushleft} +Copyright (c) .COPYRIGHT.\linebreak +\end{flushleft} +\end{document} ADDED modules/doctools/tests/latex/12 Index: modules/doctools/tests/latex/12 ================================================================== --- /dev/null +++ modules/doctools/tests/latex/12 @@ -0,0 +1,35 @@ +% Generated from file '.FILE.' by tcllib/doctools with format 'latex' +% Copyright (c) .COPYRIGHT. +% test-definitions.1 +\documentclass{article} +\begin{document} +\author{aku} +\title{.MODULE. / test-definitions -- : } +\maketitle +\section{Description}\label{section1} +lorem ipsum dolores +\begin{itemize} +% +\item[] lorem +% + ipsum dolores +% +\item[] lorem +% + ipsum dolores + +lorem ipsum dolores +% +\item[] lorem +% + ipsum dolores + +lorem ipsum dolores + +lorem ipsum dolores +\end{itemize} +\section{Copyright}\label{copyright} +\begin{flushleft} +Copyright (c) .COPYRIGHT.\linebreak +\end{flushleft} +\end{document} ADDED modules/doctools/tests/latex/13 Index: modules/doctools/tests/latex/13 ================================================================== --- /dev/null +++ modules/doctools/tests/latex/13 @@ -0,0 +1,36 @@ +% Generated from file '.FILE.' by tcllib/doctools with format 'latex' +% Copyright (c) .COPYRIGHT. +% test-itemized-examples.1 +\documentclass{article} +\begin{document} +\author{aku} +\title{.MODULE. / test-itemized-examples -- : } +\maketitle +\section{Description}\label{section1} +lorem ipsum dolores +\begin{itemize} +% +\item +% +\begin{verbatim} A lorem ipsum dolores \end{verbatim} +% +\item +% + lorem ipsum dolores +\begin{verbatim} B lorem ipsum dolores \end{verbatim} +lorem ipsum dolores +% +\item +% + lorem ipsum dolores +\begin{verbatim} C lorem ipsum dolores \end{verbatim} +% +\item +% + lorem ipsum dolores +\end{itemize} +\section{Copyright}\label{copyright} +\begin{flushleft} +Copyright (c) .COPYRIGHT.\linebreak +\end{flushleft} +\end{document} ADDED modules/doctools/tests/latex/14 Index: modules/doctools/tests/latex/14 ================================================================== --- /dev/null +++ modules/doctools/tests/latex/14 @@ -0,0 +1,36 @@ +% Generated from file '.FILE.' by tcllib/doctools with format 'latex' +% Copyright (c) .COPYRIGHT. +% test-enumerated-examples.1 +\documentclass{article} +\begin{document} +\author{aku} +\title{.MODULE. / test-enumerated-examples -- : } +\maketitle +\section{Description}\label{section1} +lorem ipsum dolores +\begin{enumerate} +% +\item +% +\begin{verbatim} A1 lorem ipsum dolores \end{verbatim} +% +\item +% + lorem ipsum dolores +\begin{verbatim} B2 lorem ipsum dolores \end{verbatim} +lorem ipsum dolores +% +\item +% + lorem ipsum dolores +\begin{verbatim} C3 lorem ipsum dolores \end{verbatim} +% +\item +% + lorem ipsum dolores +\end{enumerate} +\section{Copyright}\label{copyright} +\begin{flushleft} +Copyright (c) .COPYRIGHT.\linebreak +\end{flushleft} +\end{document} ADDED modules/doctools/tests/latex/15 Index: modules/doctools/tests/latex/15 ================================================================== --- /dev/null +++ modules/doctools/tests/latex/15 @@ -0,0 +1,36 @@ +% Generated from file '.FILE.' by tcllib/doctools with format 'latex' +% Copyright (c) .COPYRIGHT. +% test-definition-examples.1 +\documentclass{article} +\begin{document} +\author{aku} +\title{.MODULE. / test-definition-examples -- : } +\maketitle +\section{Description}\label{section1} +lorem ipsum dolores +\begin{itemize} +% +\item[] lorem +% +\begin{verbatim} A1 lorem ipsum dolores \end{verbatim} +% +\item[] lorem +% + ipsum dolores +\begin{verbatim} B2 lorem ipsum dolores \end{verbatim} +lorem ipsum dolores +% +\item[] lorem +% + ipsum dolores +\begin{verbatim} C3 lorem ipsum dolores \end{verbatim} +% +\item[] lorem +% + ipsum dolores +\end{itemize} +\section{Copyright}\label{copyright} +\begin{flushleft} +Copyright (c) .COPYRIGHT.\linebreak +\end{flushleft} +\end{document} ADDED modules/doctools/tests/list/09 Index: modules/doctools/tests/list/09 ================================================================== --- /dev/null +++ modules/doctools/tests/list/09 @@ -0,0 +1,1 @@ +manpage {seealso {} keywords {} file .FILE. section z category {} module .MODULE. version 3.14.15.926 title TEST shortdesc {} desc {} fid .FILE} ADDED modules/doctools/tests/list/10 Index: modules/doctools/tests/list/10 ================================================================== --- /dev/null +++ modules/doctools/tests/list/10 @@ -0,0 +1,1 @@ +manpage {seealso {} keywords {} file .FILE. section 1 category {} module .MODULE. version n title test-itemized shortdesc {} desc {} fid .FILE} ADDED modules/doctools/tests/list/11 Index: modules/doctools/tests/list/11 ================================================================== --- /dev/null +++ modules/doctools/tests/list/11 @@ -0,0 +1,1 @@ +manpage {seealso {} keywords {} file .FILE. section 1 category {} module .MODULE. version n title test-enumerated shortdesc {} desc {} fid .FILE} ADDED modules/doctools/tests/list/12 Index: modules/doctools/tests/list/12 ================================================================== --- /dev/null +++ modules/doctools/tests/list/12 @@ -0,0 +1,1 @@ +manpage {seealso {} keywords {} file .FILE. section 1 category {} module .MODULE. version n title test-definitions shortdesc {} desc {} fid .FILE} ADDED modules/doctools/tests/list/13 Index: modules/doctools/tests/list/13 ================================================================== --- /dev/null +++ modules/doctools/tests/list/13 @@ -0,0 +1,1 @@ +manpage {seealso {} keywords {} file .FILE. section 1 category {} module .MODULE. version n title test-itemized-examples shortdesc {} desc {} fid .FILE} ADDED modules/doctools/tests/list/14 Index: modules/doctools/tests/list/14 ================================================================== --- /dev/null +++ modules/doctools/tests/list/14 @@ -0,0 +1,1 @@ +manpage {seealso {} keywords {} file .FILE. section 1 category {} module .MODULE. version n title test-enumerated-examples shortdesc {} desc {} fid .FILE} ADDED modules/doctools/tests/list/15 Index: modules/doctools/tests/list/15 ================================================================== --- /dev/null +++ modules/doctools/tests/list/15 @@ -0,0 +1,1 @@ +manpage {seealso {} keywords {} file .FILE. section 1 category {} module .MODULE. version n title test-definition-examples shortdesc {} desc {} fid .FILE} Index: modules/doctools/tests/man/00 ================================================================== --- modules/doctools/tests/man/00 +++ modules/doctools/tests/man/00 @@ -1,3 +1,4 @@ +[comment { -- Basic structure }] [manpage_begin TEST z 3.14.15.926] [description] [manpage_end] Index: modules/doctools/tests/man/01 ================================================================== --- modules/doctools/tests/man/01 +++ modules/doctools/tests/man/01 @@ -1,5 +1,6 @@ +[comment { -- Inline markup }] [manpage_begin TEST z 3.14.15.926] [copyright **Copyright**] [description] Argument ::[arg Argument]:: Class ::[class Class]:: Index: modules/doctools/tests/man/02 ================================================================== --- modules/doctools/tests/man/02 +++ modules/doctools/tests/man/02 @@ -1,5 +1,6 @@ +[comment { -- Meta markup }] [manpage_begin TEST z 3.14.15.926] [moddesc ..THE_MODULE..] [titledesc ..THE_TITLE..] [require AAA] [require BBB VVV] Index: modules/doctools/tests/man/03 ================================================================== --- modules/doctools/tests/man/03 +++ modules/doctools/tests/man/03 @@ -1,5 +1,6 @@ +[comment { -- Sectioning }] [manpage_begin TEST z 3.14.15.926] [description] [section AaA] 1 [section BbB] Index: modules/doctools/tests/man/04 ================================================================== --- modules/doctools/tests/man/04 +++ modules/doctools/tests/man/04 @@ -1,5 +1,6 @@ +[comment { -- Example 1 }] [manpage_begin TEST z 3.14.15.926] [description] BEGINNE HIER [example { Example Block \ @@ -11,6 +12,5 @@ Inlined Example \ Next Line [example_end] FERTIG [manpage_end] - Index: modules/doctools/tests/man/05 ================================================================== --- modules/doctools/tests/man/05 +++ modules/doctools/tests/man/05 @@ -1,6 +1,6 @@ -[comment {LISTS, BASIC}] +[comment { -- Lists 1 }] [manpage_begin BASIC a 5] [description] OK [para] [list_begin arguments] Index: modules/doctools/tests/man/06 ================================================================== --- modules/doctools/tests/man/06 +++ modules/doctools/tests/man/06 @@ -1,5 +1,6 @@ +[comment { -- Lists 2 }] [manpage_begin TEST z 3.14.15.926] [description] [comment { nested lists, same and different types, examples have examples at least three levels deep, for a proper inner level, i.e. not only ADDED modules/doctools/tests/man/09 Index: modules/doctools/tests/man/09 ================================================================== --- /dev/null +++ modules/doctools/tests/man/09 @@ -0,0 +1,22 @@ +[comment { -- Example 2 }] +[manpage_begin TEST z 3.14.15.926] +[description] +lorem +[example { +1 lorem ipsum dolores +}] +ipsum +[example { 2 lorem ipsum dolores }] +dolores +[example_begin] +3 lorem ipsum dolores +[example_end] +lorem +[example { 4 lorem ipsum dolores +}] +ipsum +[example { +5 lorem ipsum dolores }] +dolores +[manpage_end] + ADDED modules/doctools/tests/man/10 Index: modules/doctools/tests/man/10 ================================================================== --- /dev/null +++ modules/doctools/tests/man/10 @@ -0,0 +1,13 @@ +[comment { -- List 3 - itemized }] +[manpage_begin test-itemized 1 n] +[description] +lorem ipsum dolores +[list_begin itemized] +[item] lorem ipsum dolores +[item] lorem ipsum dolores +[para] lorem ipsum dolores +[item] lorem ipsum dolores +[para] lorem ipsum dolores +[para] lorem ipsum dolores +[list_end] +[manpage_end] ADDED modules/doctools/tests/man/11 Index: modules/doctools/tests/man/11 ================================================================== --- /dev/null +++ modules/doctools/tests/man/11 @@ -0,0 +1,13 @@ +[comment { -- List 4 - enumerated }] +[manpage_begin test-enumerated 1 n] +[description] +lorem ipsum dolores +[list_begin enumerated] +[enum] lorem ipsum dolores +[enum] lorem ipsum dolores +[para] lorem ipsum dolores +[enum] lorem ipsum dolores +[para] lorem ipsum dolores +[para] lorem ipsum dolores +[list_end] +[manpage_end] ADDED modules/doctools/tests/man/12 Index: modules/doctools/tests/man/12 ================================================================== --- /dev/null +++ modules/doctools/tests/man/12 @@ -0,0 +1,13 @@ +[comment { -- List 5 - definitions }] +[manpage_begin test-definitions 1 n] +[description] +lorem ipsum dolores +[list_begin definitions] +[def lorem] ipsum dolores +[def lorem] ipsum dolores +[para] lorem ipsum dolores +[def lorem] ipsum dolores +[para] lorem ipsum dolores +[para] lorem ipsum dolores +[list_end] +[manpage_end] ADDED modules/doctools/tests/man/13 Index: modules/doctools/tests/man/13 ================================================================== --- /dev/null +++ modules/doctools/tests/man/13 @@ -0,0 +1,15 @@ +[comment { -- List 6 - itemized examples }] +[manpage_begin test-itemized-examples 1 n] +[description] +lorem ipsum dolores +[list_begin itemized] +[item] +[example { A lorem ipsum dolores }] +[item] lorem ipsum dolores +[example { B lorem ipsum dolores }] +lorem ipsum dolores +[item] lorem ipsum dolores +[example { C lorem ipsum dolores }] +[item] lorem ipsum dolores +[list_end] +[manpage_end] ADDED modules/doctools/tests/man/14 Index: modules/doctools/tests/man/14 ================================================================== --- /dev/null +++ modules/doctools/tests/man/14 @@ -0,0 +1,15 @@ +[comment { -- List 7 - enumerated examples }] +[manpage_begin test-enumerated-examples 1 n] +[description] +lorem ipsum dolores +[list_begin enumerated] +[enum] +[example { A1 lorem ipsum dolores }] +[enum] lorem ipsum dolores +[example { B2 lorem ipsum dolores }] +lorem ipsum dolores +[enum] lorem ipsum dolores +[example { C3 lorem ipsum dolores }] +[enum] lorem ipsum dolores +[list_end] +[manpage_end] ADDED modules/doctools/tests/man/15 Index: modules/doctools/tests/man/15 ================================================================== --- /dev/null +++ modules/doctools/tests/man/15 @@ -0,0 +1,15 @@ +[comment { -- List 8 - definition examples }] +[manpage_begin test-definition-examples 1 n] +[description] +lorem ipsum dolores +[list_begin definitions] +[def lorem] +[example { A1 lorem ipsum dolores }] +[def lorem] ipsum dolores +[example { B2 lorem ipsum dolores }] +lorem ipsum dolores +[def lorem] ipsum dolores +[example { C3 lorem ipsum dolores }] +[def lorem] ipsum dolores +[list_end] +[manpage_end] Index: modules/doctools/tests/nroff/00 ================================================================== --- modules/doctools/tests/nroff/00 +++ modules/doctools/tests/nroff/00 Index: modules/doctools/tests/nroff/01 ================================================================== --- modules/doctools/tests/nroff/01 +++ modules/doctools/tests/nroff/01 Index: modules/doctools/tests/nroff/02 ================================================================== --- modules/doctools/tests/nroff/02 +++ modules/doctools/tests/nroff/02 Index: modules/doctools/tests/nroff/03 ================================================================== --- modules/doctools/tests/nroff/03 +++ modules/doctools/tests/nroff/03 Index: modules/doctools/tests/nroff/04 ================================================================== --- modules/doctools/tests/nroff/04 +++ modules/doctools/tests/nroff/04 Index: modules/doctools/tests/nroff/05 ================================================================== --- modules/doctools/tests/nroff/05 +++ modules/doctools/tests/nroff/05 Index: modules/doctools/tests/nroff/06 ================================================================== --- modules/doctools/tests/nroff/06 +++ modules/doctools/tests/nroff/06 Index: modules/doctools/tests/nroff/07 ================================================================== --- modules/doctools/tests/nroff/07 +++ modules/doctools/tests/nroff/07 Index: modules/doctools/tests/nroff/08 ================================================================== --- modules/doctools/tests/nroff/08 +++ modules/doctools/tests/nroff/08 ADDED modules/doctools/tests/nroff/09 Index: modules/doctools/tests/nroff/09 ================================================================== --- /dev/null +++ modules/doctools/tests/nroff/09 @@ -0,0 +1,47 @@ +'\" +'\" Generated from file '\&.FILE\&.' by tcllib/doctools with format 'nroff' +'\" Copyright (c) \&.COPYRIGHT\&. +'\" +.TH "TEST" z 3\&.14\&.15\&.926 \&.MODULE\&. "" +.so man.macros +.BS +.SH NAME +TEST \- +.SH DESCRIPTION +lorem +.CS + + +1 lorem ipsum dolores + +.CE +ipsum +.CS + + 2 lorem ipsum dolores +.CE +dolores +.CS + + +3 lorem ipsum dolores + +.CE +lorem +.CS + + 4 lorem ipsum dolores + +.CE +ipsum +.CS + + +5 lorem ipsum dolores +.CE +dolores +.SH COPYRIGHT +.nf +Copyright (c) \&.COPYRIGHT\&. + +.fi ADDED modules/doctools/tests/nroff/10 Index: modules/doctools/tests/nroff/10 ================================================================== --- /dev/null +++ modules/doctools/tests/nroff/10 @@ -0,0 +1,29 @@ +'\" +'\" Generated from file '\&.FILE\&.' by tcllib/doctools with format 'nroff' +'\" Copyright (c) \&.COPYRIGHT\&. +'\" +.TH "test-itemized" 1 n \&.MODULE\&. "" +.so man.macros +.BS +.SH NAME +test-itemized \- +.SH DESCRIPTION +lorem ipsum dolores +.IP \(bu +lorem ipsum dolores +.IP \(bu +lorem ipsum dolores +.sp +lorem ipsum dolores +.IP \(bu +lorem ipsum dolores +.sp +lorem ipsum dolores +.sp +lorem ipsum dolores +.PP +.SH COPYRIGHT +.nf +Copyright (c) \&.COPYRIGHT\&. + +.fi ADDED modules/doctools/tests/nroff/11 Index: modules/doctools/tests/nroff/11 ================================================================== --- /dev/null +++ modules/doctools/tests/nroff/11 @@ -0,0 +1,29 @@ +'\" +'\" Generated from file '\&.FILE\&.' by tcllib/doctools with format 'nroff' +'\" Copyright (c) \&.COPYRIGHT\&. +'\" +.TH "test-enumerated" 1 n \&.MODULE\&. "" +.so man.macros +.BS +.SH NAME +test-enumerated \- +.SH DESCRIPTION +lorem ipsum dolores +.IP [1] +lorem ipsum dolores +.IP [2] +lorem ipsum dolores +.sp +lorem ipsum dolores +.IP [3] +lorem ipsum dolores +.sp +lorem ipsum dolores +.sp +lorem ipsum dolores +.PP +.SH COPYRIGHT +.nf +Copyright (c) \&.COPYRIGHT\&. + +.fi ADDED modules/doctools/tests/nroff/12 Index: modules/doctools/tests/nroff/12 ================================================================== --- /dev/null +++ modules/doctools/tests/nroff/12 @@ -0,0 +1,32 @@ +'\" +'\" Generated from file '\&.FILE\&.' by tcllib/doctools with format 'nroff' +'\" Copyright (c) \&.COPYRIGHT\&. +'\" +.TH "test-definitions" 1 n \&.MODULE\&. "" +.so man.macros +.BS +.SH NAME +test-definitions \- +.SH DESCRIPTION +lorem ipsum dolores +.TP +lorem +ipsum dolores +.TP +lorem +ipsum dolores +.sp +lorem ipsum dolores +.TP +lorem +ipsum dolores +.sp +lorem ipsum dolores +.sp +lorem ipsum dolores +.PP +.SH COPYRIGHT +.nf +Copyright (c) \&.COPYRIGHT\&. + +.fi ADDED modules/doctools/tests/nroff/13 Index: modules/doctools/tests/nroff/13 ================================================================== --- /dev/null +++ modules/doctools/tests/nroff/13 @@ -0,0 +1,38 @@ +'\" +'\" Generated from file '\&.FILE\&.' by tcllib/doctools with format 'nroff' +'\" Copyright (c) \&.COPYRIGHT\&. +'\" +.TH "test-itemized-examples" 1 n \&.MODULE\&. "" +.so man.macros +.BS +.SH NAME +test-itemized-examples \- +.SH DESCRIPTION +lorem ipsum dolores +.IP \(bu +.CS + + A lorem ipsum dolores +.CE +.IP \(bu +lorem ipsum dolores +.CS + + B lorem ipsum dolores +.CE +.IP +lorem ipsum dolores +.IP \(bu +lorem ipsum dolores +.CS + + C lorem ipsum dolores +.CE +.IP \(bu +lorem ipsum dolores +.PP +.SH COPYRIGHT +.nf +Copyright (c) \&.COPYRIGHT\&. + +.fi ADDED modules/doctools/tests/nroff/14 Index: modules/doctools/tests/nroff/14 ================================================================== --- /dev/null +++ modules/doctools/tests/nroff/14 @@ -0,0 +1,38 @@ +'\" +'\" Generated from file '\&.FILE\&.' by tcllib/doctools with format 'nroff' +'\" Copyright (c) \&.COPYRIGHT\&. +'\" +.TH "test-enumerated-examples" 1 n \&.MODULE\&. "" +.so man.macros +.BS +.SH NAME +test-enumerated-examples \- +.SH DESCRIPTION +lorem ipsum dolores +.IP [1] +.CS + + A1 lorem ipsum dolores +.CE +.IP [2] +lorem ipsum dolores +.CS + + B2 lorem ipsum dolores +.CE +.IP +lorem ipsum dolores +.IP [3] +lorem ipsum dolores +.CS + + C3 lorem ipsum dolores +.CE +.IP [4] +lorem ipsum dolores +.PP +.SH COPYRIGHT +.nf +Copyright (c) \&.COPYRIGHT\&. + +.fi ADDED modules/doctools/tests/nroff/15 Index: modules/doctools/tests/nroff/15 ================================================================== --- /dev/null +++ modules/doctools/tests/nroff/15 @@ -0,0 +1,42 @@ +'\" +'\" Generated from file '\&.FILE\&.' by tcllib/doctools with format 'nroff' +'\" Copyright (c) \&.COPYRIGHT\&. +'\" +.TH "test-definition-examples" 1 n \&.MODULE\&. "" +.so man.macros +.BS +.SH NAME +test-definition-examples \- +.SH DESCRIPTION +lorem ipsum dolores +.TP +lorem +.CS + + A1 lorem ipsum dolores +.CE +.TP +lorem +ipsum dolores +.CS + + B2 lorem ipsum dolores +.CE +.IP +lorem ipsum dolores +.TP +lorem +ipsum dolores +.CS + + C3 lorem ipsum dolores +.CE +.TP +lorem +ipsum dolores +.PP +.SH COPYRIGHT +.nf +Copyright (c) \&.COPYRIGHT\&. + +.fi ADDED modules/doctools/tests/null/09 Index: modules/doctools/tests/null/09 ================================================================== --- /dev/null +++ modules/doctools/tests/null/09 ADDED modules/doctools/tests/null/10 Index: modules/doctools/tests/null/10 ================================================================== --- /dev/null +++ modules/doctools/tests/null/10 ADDED modules/doctools/tests/null/11 Index: modules/doctools/tests/null/11 ================================================================== --- /dev/null +++ modules/doctools/tests/null/11 ADDED modules/doctools/tests/null/12 Index: modules/doctools/tests/null/12 ================================================================== --- /dev/null +++ modules/doctools/tests/null/12 ADDED modules/doctools/tests/null/13 Index: modules/doctools/tests/null/13 ================================================================== --- /dev/null +++ modules/doctools/tests/null/13 ADDED modules/doctools/tests/null/14 Index: modules/doctools/tests/null/14 ================================================================== --- /dev/null +++ modules/doctools/tests/null/14 ADDED modules/doctools/tests/null/15 Index: modules/doctools/tests/null/15 ================================================================== --- /dev/null +++ modules/doctools/tests/null/15 Index: modules/doctools/tests/text/00 ================================================================== --- modules/doctools/tests/text/00 +++ modules/doctools/tests/text/00 Index: modules/doctools/tests/text/01 ================================================================== --- modules/doctools/tests/text/01 +++ modules/doctools/tests/text/01 Index: modules/doctools/tests/text/02 ================================================================== --- modules/doctools/tests/text/02 +++ modules/doctools/tests/text/02 Index: modules/doctools/tests/text/03 ================================================================== --- modules/doctools/tests/text/03 +++ modules/doctools/tests/text/03 Index: modules/doctools/tests/text/04 ================================================================== --- modules/doctools/tests/text/04 +++ modules/doctools/tests/text/04 @@ -11,13 +11,11 @@ DESCRIPTION =========== BEGINNE HIER - | Example Block More Lines - | Inlined Example \ | Next Line FERTIG Index: modules/doctools/tests/text/05 ================================================================== --- modules/doctools/tests/text/05 +++ modules/doctools/tests/text/05 Index: modules/doctools/tests/text/06 ================================================================== --- modules/doctools/tests/text/06 +++ modules/doctools/tests/text/06 Index: modules/doctools/tests/text/07 ================================================================== --- modules/doctools/tests/text/07 +++ modules/doctools/tests/text/07 Index: modules/doctools/tests/text/08 ================================================================== --- modules/doctools/tests/text/08 +++ modules/doctools/tests/text/08 @@ -80,11 +80,10 @@ DESCRIPTION ::Option:: TYPE NAME (MODE) DESCRIPTION ::?Optional?:: - | THE ARGUMENT IS USED IN THIS | AND/OR THAT MANNER CMDNAME ... ADDED modules/doctools/tests/text/09 Index: modules/doctools/tests/text/09 ================================================================== --- /dev/null +++ modules/doctools/tests/text/09 @@ -0,0 +1,39 @@ + +TEST - +Generated from file '.FILE.' by tcllib/doctools with format 'text' +TEST(z) 3.14.15.926 .MODULE. "" + +NAME +==== + +TEST - + +DESCRIPTION +=========== + +lorem + +| 1 lorem ipsum dolores + +ipsum + +| 2 lorem ipsum dolores + +dolores + +| 3 lorem ipsum dolores + +lorem + +| 4 lorem ipsum dolores + +ipsum + +| 5 lorem ipsum dolores + +dolores + +COPYRIGHT +========= + +Copyright (c) .COPYRIGHT. ADDED modules/doctools/tests/text/10 Index: modules/doctools/tests/text/10 ================================================================== --- /dev/null +++ modules/doctools/tests/text/10 @@ -0,0 +1,31 @@ + +test-itemized - +Generated from file '.FILE.' by tcllib/doctools with format 'text' +test-itemized(1) n .MODULE. "" + +NAME +==== + +test-itemized - + +DESCRIPTION +=========== + +lorem ipsum dolores + + * lorem ipsum dolores + + * lorem ipsum dolores + + lorem ipsum dolores + + * lorem ipsum dolores + + lorem ipsum dolores + + lorem ipsum dolores + +COPYRIGHT +========= + +Copyright (c) .COPYRIGHT. ADDED modules/doctools/tests/text/11 Index: modules/doctools/tests/text/11 ================================================================== --- /dev/null +++ modules/doctools/tests/text/11 @@ -0,0 +1,31 @@ + +test-enumerated - +Generated from file '.FILE.' by tcllib/doctools with format 'text' +test-enumerated(1) n .MODULE. "" + +NAME +==== + +test-enumerated - + +DESCRIPTION +=========== + +lorem ipsum dolores + + [1] lorem ipsum dolores + + [2] lorem ipsum dolores + + lorem ipsum dolores + + [3] lorem ipsum dolores + + lorem ipsum dolores + + lorem ipsum dolores + +COPYRIGHT +========= + +Copyright (c) .COPYRIGHT. ADDED modules/doctools/tests/text/12 Index: modules/doctools/tests/text/12 ================================================================== --- /dev/null +++ modules/doctools/tests/text/12 @@ -0,0 +1,37 @@ + +test-definitions - +Generated from file '.FILE.' by tcllib/doctools with format 'text' +test-definitions(1) n .MODULE. "" + +NAME +==== + +test-definitions - + +DESCRIPTION +=========== + +lorem ipsum dolores + + lorem + + ipsum dolores + + lorem + + ipsum dolores + + lorem ipsum dolores + + lorem + + ipsum dolores + + lorem ipsum dolores + + lorem ipsum dolores + +COPYRIGHT +========= + +Copyright (c) .COPYRIGHT. ADDED modules/doctools/tests/text/13 Index: modules/doctools/tests/text/13 ================================================================== --- /dev/null +++ modules/doctools/tests/text/13 @@ -0,0 +1,33 @@ + +test-itemized-examples - +Generated from file '.FILE.' by tcllib/doctools with format 'text' +test-itemized-examples(1) n .MODULE. "" + +NAME +==== + +test-itemized-examples - + +DESCRIPTION +=========== + +lorem ipsum dolores + + * | A lorem ipsum dolores + + * lorem ipsum dolores + + | B lorem ipsum dolores + + * lorem ipsum dolores + + * lorem ipsum dolores + + | C lorem ipsum dolores + + * lorem ipsum dolores + +COPYRIGHT +========= + +Copyright (c) .COPYRIGHT. ADDED modules/doctools/tests/text/14 Index: modules/doctools/tests/text/14 ================================================================== --- /dev/null +++ modules/doctools/tests/text/14 @@ -0,0 +1,33 @@ + +test-enumerated-examples - +Generated from file '.FILE.' by tcllib/doctools with format 'text' +test-enumerated-examples(1) n .MODULE. "" + +NAME +==== + +test-enumerated-examples - + +DESCRIPTION +=========== + +lorem ipsum dolores + + [1] | A1 lorem ipsum dolores + + [2] lorem ipsum dolores + + | B2 lorem ipsum dolores + + [3] lorem ipsum dolores + + [4] lorem ipsum dolores + + | C3 lorem ipsum dolores + + [5] lorem ipsum dolores + +COPYRIGHT +========= + +Copyright (c) .COPYRIGHT. ADDED modules/doctools/tests/text/15 Index: modules/doctools/tests/text/15 ================================================================== --- /dev/null +++ modules/doctools/tests/text/15 @@ -0,0 +1,41 @@ + +test-definition-examples - +Generated from file '.FILE.' by tcllib/doctools with format 'text' +test-definition-examples(1) n .MODULE. "" + +NAME +==== + +test-definition-examples - + +DESCRIPTION +=========== + +lorem ipsum dolores + + lorem + + | A1 lorem ipsum dolores + + lorem + + ipsum dolores + + | B2 lorem ipsum dolores + + lorem ipsum dolores + + lorem + + ipsum dolores + + | C3 lorem ipsum dolores + + lorem + + ipsum dolores + +COPYRIGHT +========= + +Copyright (c) .COPYRIGHT. Index: modules/doctools/tests/tmml/03 ================================================================== --- modules/doctools/tests/tmml/03 +++ modules/doctools/tests/tmml/03 @@ -44,6 +44,5 @@ - Index: modules/doctools/tests/tmml/04 ================================================================== --- modules/doctools/tests/tmml/04 +++ modules/doctools/tests/tmml/04 @@ -32,6 +32,5 @@ - Index: modules/doctools/tests/tmml/05 ================================================================== --- modules/doctools/tests/tmml/05 +++ modules/doctools/tests/tmml/05 @@ -1,6 +1,5 @@ - Index: modules/doctools/tests/tmml/08 ================================================================== --- modules/doctools/tests/tmml/08 +++ modules/doctools/tests/tmml/08 @@ -1,6 +1,5 @@ - ADDED modules/doctools/tests/tmml/09 Index: modules/doctools/tests/tmml/09 ================================================================== --- /dev/null +++ modules/doctools/tests/tmml/09 @@ -0,0 +1,46 @@ + + + + + + +TEST + + + + + +
+DESCRIPTION +lorem + + +1 lorem ipsum dolores + + +ipsum + + 2 lorem ipsum dolores + +dolores + + +3 lorem ipsum dolores + + +lorem + + 4 lorem ipsum dolores + + +ipsum + + +5 lorem ipsum dolores + +dolores +
+ + + +
ADDED modules/doctools/tests/tmml/10 Index: modules/doctools/tests/tmml/10 ================================================================== --- /dev/null +++ modules/doctools/tests/tmml/10 @@ -0,0 +1,34 @@ + + + + + + +test-itemized + + + + + +
+DESCRIPTION +lorem ipsum dolores + +
    + +
  • lorem ipsum dolores +
  • +
  • lorem ipsum dolores +
    lorem ipsum dolores +
  • +
  • lorem ipsum dolores +
    lorem ipsum dolores +
    lorem ipsum dolores +
  • + +
+
+ + + +
ADDED modules/doctools/tests/tmml/11 Index: modules/doctools/tests/tmml/11 ================================================================== --- /dev/null +++ modules/doctools/tests/tmml/11 @@ -0,0 +1,34 @@ + + + + + + +test-enumerated + + + + + +
+DESCRIPTION +lorem ipsum dolores + +
    + +
  1. lorem ipsum dolores +
  2. +
  3. lorem ipsum dolores +
    lorem ipsum dolores +
  4. +
  5. lorem ipsum dolores +
    lorem ipsum dolores +
    lorem ipsum dolores +
  6. + +
+
+ + + +
ADDED modules/doctools/tests/tmml/12 Index: modules/doctools/tests/tmml/12 ================================================================== --- /dev/null +++ modules/doctools/tests/tmml/12 @@ -0,0 +1,43 @@ + + + + + + +test-definitions + + + + + +
+DESCRIPTION +lorem ipsum dolores + +
+ + +
lorem
+
ipsum dolores +
+
+ +
lorem
+
ipsum dolores +
lorem ipsum dolores +
+
+ +
lorem
+
ipsum dolores +
lorem ipsum dolores +
lorem ipsum dolores +
+
+ +
+
+ + + +
ADDED modules/doctools/tests/tmml/13 Index: modules/doctools/tests/tmml/13 ================================================================== --- /dev/null +++ modules/doctools/tests/tmml/13 @@ -0,0 +1,43 @@ + + + + + + +test-itemized-examples + + + + + +
+DESCRIPTION +lorem ipsum dolores + +
    + +
  • + + A lorem ipsum dolores + +
  • +
  • lorem ipsum dolores + + B lorem ipsum dolores + +lorem ipsum dolores +
  • +
  • lorem ipsum dolores + + C lorem ipsum dolores + +
  • +
  • lorem ipsum dolores +
  • + +
+
+ + + +
ADDED modules/doctools/tests/tmml/14 Index: modules/doctools/tests/tmml/14 ================================================================== --- /dev/null +++ modules/doctools/tests/tmml/14 @@ -0,0 +1,43 @@ + + + + + + +test-enumerated-examples + + + + + +
+DESCRIPTION +lorem ipsum dolores + +
    + +
  1. + + A1 lorem ipsum dolores + +
  2. +
  3. lorem ipsum dolores + + B2 lorem ipsum dolores + +lorem ipsum dolores +
  4. +
  5. lorem ipsum dolores + + C3 lorem ipsum dolores + +
  6. +
  7. lorem ipsum dolores +
  8. + +
+
+ + + +
ADDED modules/doctools/tests/tmml/15 Index: modules/doctools/tests/tmml/15 ================================================================== --- /dev/null +++ modules/doctools/tests/tmml/15 @@ -0,0 +1,55 @@ + + + + + + +test-definition-examples + + + + + +
+DESCRIPTION +lorem ipsum dolores + +
+ + +
lorem
+
+ + A1 lorem ipsum dolores + +
+
+ +
lorem
+
ipsum dolores + + B2 lorem ipsum dolores + +lorem ipsum dolores +
+
+ +
lorem
+
ipsum dolores + + C3 lorem ipsum dolores + +
+
+ +
lorem
+
ipsum dolores +
+
+ +
+
+ + + +
ADDED modules/doctools/tests/toc/html/00 Index: modules/doctools/tests/toc/html/00 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/html/00 @@ -0,0 +1,11 @@ + + TOC + + + + +

TOC

+

Test

+

ADDED modules/doctools/tests/toc/html/01 Index: modules/doctools/tests/toc/html/01 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/html/01 @@ -0,0 +1,21 @@ + + TOC + + + + +

TOC

+

Test

+ + + + + + + + + +
i1i1d
i2i2d
+

ADDED modules/doctools/tests/toc/html/02 Index: modules/doctools/tests/toc/html/02 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/html/02 @@ -0,0 +1,34 @@ + + TOC + + + + +

TOC

+

Test

+ + + + + +
i1i1d
+
D
+ + + + + + + + + +
i2i2d
i3i3d
+ + + + + +
i4i4d
+

ADDED modules/doctools/tests/toc/nroff/00 Index: modules/doctools/tests/toc/nroff/00 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/nroff/00 @@ -0,0 +1,8 @@ +'\" +'\" Generated by tcllib/doctools/toc with format 'nroff' +.TH "TOC" n +.so man.macros +.BS +.SH CONTENTS +Test +.RS ADDED modules/doctools/tests/toc/nroff/01 Index: modules/doctools/tests/toc/nroff/01 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/nroff/01 @@ -0,0 +1,14 @@ +'\" +'\" Generated by tcllib/doctools/toc with format 'nroff' +.TH "TOC" n +.so man.macros +.BS +.SH CONTENTS +Test +.RS +.TP +\fBi1\fR +\fII1f\fR: i1d +.TP +\fBi2\fR +\fII2f\fR: i2d ADDED modules/doctools/tests/toc/nroff/02 Index: modules/doctools/tests/toc/nroff/02 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/nroff/02 @@ -0,0 +1,24 @@ +'\" +'\" Generated by tcllib/doctools/toc with format 'nroff' +.TH "TOC" n +.so man.macros +.BS +.SH CONTENTS +Test +.RS +.TP +\fBi1\fR +\fII1f\fR: i1d +.TP +D +.RS +.TP +\fBi2\fR +\fII2f\fR: i2d +.TP +\fBi3\fR +\fII3f\fR: i3d +.RE +.TP +\fBi4\fR +\fII4f\fR: i4d ADDED modules/doctools/tests/toc/null/00 Index: modules/doctools/tests/toc/null/00 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/null/00 ADDED modules/doctools/tests/toc/null/01 Index: modules/doctools/tests/toc/null/01 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/null/01 ADDED modules/doctools/tests/toc/null/02 Index: modules/doctools/tests/toc/null/02 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/null/02 ADDED modules/doctools/tests/toc/text/00 Index: modules/doctools/tests/toc/text/00 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/text/00 @@ -0,0 +1,5 @@ + +Table of contents generated by tcllib/doctools/toc with format 'text' + +TOC -- Test +=========== ADDED modules/doctools/tests/toc/text/01 Index: modules/doctools/tests/toc/text/01 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/text/01 @@ -0,0 +1,9 @@ + +Table of contents generated by tcllib/doctools/toc with format 'text' + +TOC -- Test +=========== + +I1f i1d + +I2f i2d ADDED modules/doctools/tests/toc/text/02 Index: modules/doctools/tests/toc/text/02 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/text/02 @@ -0,0 +1,16 @@ + +Table of contents generated by tcllib/doctools/toc with format 'text' + +TOC -- Test +=========== + +I1f i1d + +D +- + + I2f i2d + + I3f i3d + +I4f i4d ADDED modules/doctools/tests/toc/tmml/00 Index: modules/doctools/tests/toc/tmml/00 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/tmml/00 @@ -0,0 +1,4 @@ + +Test + + ADDED modules/doctools/tests/toc/tmml/01 Index: modules/doctools/tests/toc/tmml/01 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/tmml/01 @@ -0,0 +1,6 @@ + +Test + + + + ADDED modules/doctools/tests/toc/tmml/02 Index: modules/doctools/tests/toc/tmml/02 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/tmml/02 @@ -0,0 +1,12 @@ + +Test + + +D + + + + + + + ADDED modules/doctools/tests/toc/toc/00 Index: modules/doctools/tests/toc/toc/00 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/toc/00 @@ -0,0 +1,3 @@ +[comment { -- empty toc }] +[toc_begin TOC Test] +[toc_end] ADDED modules/doctools/tests/toc/toc/01 Index: modules/doctools/tests/toc/toc/01 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/toc/01 @@ -0,0 +1,5 @@ +[comment { -- just items }] +[toc_begin TOC Test] +[item I1f i1 i1d] +[item I2f i2 i2d] +[toc_end] ADDED modules/doctools/tests/toc/toc/02 Index: modules/doctools/tests/toc/toc/02 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/toc/02 @@ -0,0 +1,9 @@ +[comment { -- item + division mix }] +[toc_begin TOC Test] +[item I1f i1 i1d] +[division_start D Df] +[item I2f i2 i2d] +[item I3f i3 i3d] +[division_end] +[item I4f i4 i4d] +[toc_end] ADDED modules/doctools/tests/toc/wiki/00 Index: modules/doctools/tests/toc/wiki/00 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/wiki/00 @@ -0,0 +1,5 @@ + +Table of Contents '''TOC''' +'''Test''' + + ADDED modules/doctools/tests/toc/wiki/01 Index: modules/doctools/tests/toc/wiki/01 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/wiki/01 @@ -0,0 +1,7 @@ + +Table of Contents '''TOC''' +'''Test''' + [[i1]]: I1f -- i1d + [[i2]]: I2f -- i2d + + ADDED modules/doctools/tests/toc/wiki/02 Index: modules/doctools/tests/toc/wiki/02 ================================================================== --- /dev/null +++ modules/doctools/tests/toc/wiki/02 @@ -0,0 +1,11 @@ + +Table of Contents '''TOC''' +'''Test''' + [[i1]]: I1f -- i1d +'''D''' + [[i2]]: I2f -- i2d + [[i3]]: I3f -- i3d + + [[i4]]: I4f -- i4d + + Index: modules/doctools/tests/wiki/00 ================================================================== --- modules/doctools/tests/wiki/00 +++ modules/doctools/tests/wiki/00 @@ -8,6 +8,5 @@ **COPYRIGHT** Copyright (c) .COPYRIGHT. - Index: modules/doctools/tests/wiki/01 ================================================================== --- modules/doctools/tests/wiki/01 +++ modules/doctools/tests/wiki/01 @@ -8,6 +8,5 @@ Argument ::''Argument'':: Class ::'''Class''':: Command ::'''Command''':: Comment :::: Const ::'''Constant''':: Emphasis ::''Emphasis'':: File ::"''File/Path''":: Function ::'''Function''':: Method ::'''Method''':: Namespace ::'''Namespace''':: Option ::'''Option''':: Optional ::?Optional?:: Package ::'''Package''':: Syscmd ::'''SystemCommand''':: Term ::''Term'':: Type ::'''Type''':: Uri ::Uri:: Variable ::'''Variable''':: Widget ::'''Widget''':: **COPYRIGHT** Copyright (c) **Copyright** - Index: modules/doctools/tests/wiki/02 ================================================================== --- modules/doctools/tests/wiki/02 +++ modules/doctools/tests/wiki/02 @@ -30,6 +30,5 @@ **COPYRIGHT** Copyright (c) .COPYRIGHT. - Index: modules/doctools/tests/wiki/03 ================================================================== --- modules/doctools/tests/wiki/03 +++ modules/doctools/tests/wiki/03 @@ -30,6 +30,5 @@ At '''__undefined__'''. **COPYRIGHT** Copyright (c) .COPYRIGHT. - Index: modules/doctools/tests/wiki/04 ================================================================== --- modules/doctools/tests/wiki/04 +++ modules/doctools/tests/wiki/04 @@ -23,6 +23,5 @@ FERTIG **COPYRIGHT** Copyright (c) .COPYRIGHT. - Index: modules/doctools/tests/wiki/05 ================================================================== --- modules/doctools/tests/wiki/05 +++ modules/doctools/tests/wiki/05 @@ -34,16 +34,20 @@ a-command : semantic 1. A - 1. B C D + 1. B +C +D * 1 - * 2 2a 2b + * 2 +2a +2b '''option-1''': meaning '''option-2''' value: elaboration @@ -61,6 +65,5 @@ KO **COPYRIGHT** Copyright (c) .COPYRIGHT. - Index: modules/doctools/tests/wiki/06 ================================================================== --- modules/doctools/tests/wiki/06 +++ modules/doctools/tests/wiki/06 @@ -5,27 +5,34 @@ **DESCRIPTION** - * 1 2 3 + * 1 +2 +3 * - 1. a b c + 1. a +b +c 1. foo: snafu bar: barf roo: gork - 1. a b c + 1. a +b +c - * 4 5 6 + * 4 +5 +6 **COPYRIGHT** Copyright (c) .COPYRIGHT. - Index: modules/doctools/tests/wiki/07 ================================================================== --- modules/doctools/tests/wiki/07 +++ modules/doctools/tests/wiki/07 @@ -26,6 +26,5 @@ * 3 **COPYRIGHT** Copyright (c) .COPYRIGHT. - Index: modules/doctools/tests/wiki/08 ================================================================== --- modules/doctools/tests/wiki/08 +++ modules/doctools/tests/wiki/08 @@ -112,6 +112,5 @@ **COPYRIGHT** Copyright (c) **Copyright** - ADDED modules/doctools/tests/wiki/09 Index: modules/doctools/tests/wiki/09 ================================================================== --- /dev/null +++ modules/doctools/tests/wiki/09 @@ -0,0 +1,38 @@ +'''TEST 3.14.15.926''' '''.MODULE.''' + + + + +**DESCRIPTION** + +lorem +====== + +1 lorem ipsum dolores + +====== +ipsum +====== + 2 lorem ipsum dolores +====== +dolores +====== + +3 lorem ipsum dolores + +====== +lorem +====== + 4 lorem ipsum dolores + +====== +ipsum +====== + +5 lorem ipsum dolores +====== +dolores + +**COPYRIGHT** + + Copyright (c) .COPYRIGHT. ADDED modules/doctools/tests/wiki/10 Index: modules/doctools/tests/wiki/10 ================================================================== --- /dev/null +++ modules/doctools/tests/wiki/10 @@ -0,0 +1,21 @@ +'''test-itemized n''' '''.MODULE.''' + + + + +**DESCRIPTION** + +lorem ipsum dolores + + * lorem ipsum dolores + + * lorem ipsum dolores +lorem ipsum dolores + + * lorem ipsum dolores +lorem ipsum dolores +lorem ipsum dolores + +**COPYRIGHT** + + Copyright (c) .COPYRIGHT. ADDED modules/doctools/tests/wiki/11 Index: modules/doctools/tests/wiki/11 ================================================================== --- /dev/null +++ modules/doctools/tests/wiki/11 @@ -0,0 +1,21 @@ +'''test-enumerated n''' '''.MODULE.''' + + + + +**DESCRIPTION** + +lorem ipsum dolores + + 1. lorem ipsum dolores + + 1. lorem ipsum dolores +lorem ipsum dolores + + 1. lorem ipsum dolores +lorem ipsum dolores +lorem ipsum dolores + +**COPYRIGHT** + + Copyright (c) .COPYRIGHT. ADDED modules/doctools/tests/wiki/12 Index: modules/doctools/tests/wiki/12 ================================================================== --- /dev/null +++ modules/doctools/tests/wiki/12 @@ -0,0 +1,21 @@ +'''test-definitions n''' '''.MODULE.''' + + + + +**DESCRIPTION** + +lorem ipsum dolores + + lorem: ipsum dolores + + lorem: ipsum dolores +lorem ipsum dolores + + lorem: ipsum dolores +lorem ipsum dolores +lorem ipsum dolores + +**COPYRIGHT** + + Copyright (c) .COPYRIGHT. ADDED modules/doctools/tests/wiki/13 Index: modules/doctools/tests/wiki/13 ================================================================== --- /dev/null +++ modules/doctools/tests/wiki/13 @@ -0,0 +1,32 @@ +'''test-itemized-examples n''' '''.MODULE.''' + + + + +**DESCRIPTION** + +lorem ipsum dolores + + * +====== + A lorem ipsum dolores +====== + + + * lorem ipsum dolores +====== + B lorem ipsum dolores +====== +lorem ipsum dolores + + * lorem ipsum dolores +====== + C lorem ipsum dolores +====== + + + * lorem ipsum dolores + +**COPYRIGHT** + + Copyright (c) .COPYRIGHT. ADDED modules/doctools/tests/wiki/14 Index: modules/doctools/tests/wiki/14 ================================================================== --- /dev/null +++ modules/doctools/tests/wiki/14 @@ -0,0 +1,32 @@ +'''test-enumerated-examples n''' '''.MODULE.''' + + + + +**DESCRIPTION** + +lorem ipsum dolores + + 1. +====== + A1 lorem ipsum dolores +====== + + + 1. lorem ipsum dolores +====== + B2 lorem ipsum dolores +====== +lorem ipsum dolores + + 1. lorem ipsum dolores +====== + C3 lorem ipsum dolores +====== + + + 1. lorem ipsum dolores + +**COPYRIGHT** + + Copyright (c) .COPYRIGHT. ADDED modules/doctools/tests/wiki/15 Index: modules/doctools/tests/wiki/15 ================================================================== --- /dev/null +++ modules/doctools/tests/wiki/15 @@ -0,0 +1,32 @@ +'''test-definition-examples n''' '''.MODULE.''' + + + + +**DESCRIPTION** + +lorem ipsum dolores + + lorem: +====== + A1 lorem ipsum dolores +====== + + + lorem: ipsum dolores +====== + B2 lorem ipsum dolores +====== +lorem ipsum dolores + + lorem: ipsum dolores +====== + C3 lorem ipsum dolores +====== + + + lorem: ipsum dolores + +**COPYRIGHT** + + Copyright (c) .COPYRIGHT.