Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Markdown continued polishing. - Hook into generation of copyright block. - Force line break in copyright block. - Use entity for copyright symbol. - Fix missing formatting for various span-level markup. - Fix index references, want links, not anchors. - Made notes of missing things (xref mainly, see HTML) - Fixed test results to match Text - Fixed missing cleanup of current context between pages. - Additional guards to detect contexts early, on emission, instead of final render. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | doc-fixup-and-markdown |
Files: | files | file ages | folders |
SHA3-256: |
34f227b45fce05fca7c35ad8c3707483 |
User & Date: | aku 2019-03-19 05:43:11.753 |
Context
2019-03-19
| ||
22:06 | Fixed latex user reference in the results check-in: af4cc3338e user: andreask tags: doc-fixup-and-markdown | |
18:40 | Switch embedded docs over to markdown. Drop lots of superfluous trailing whitespace. check-in: 56ca2fa4d9 user: andreask tags: doc-fixup-and-markdown-localdoc | |
05:43 | Markdown continued polishing. - Hook into generation of copyright block. - Force line break in copyright block. - Use entity for copyright symbol. - Fix missing formatting for various span-level markup. - Fix index references, want links, not anchors. - Made notes of missing things (xref mainly, see HTML) - Fixed test results to match Text - Fixed missing cleanup of current context between pages. - Additional guards to detect contexts early, on emission, instead of final render. check-in: 34f227b45f user: aku tags: doc-fixup-and-markdown | |
03:50 | Continued generation of markdown: doctools. check-in: 352aea205e user: aku tags: doc-fixup-and-markdown | |
Changes
Changes to modules/doctools/mpformats/_common.tcl.
︙ | ︙ | |||
64 65 66 67 68 69 70 | return $state(mdesc) } return $state(tdesc) } proc c_copyrightsymbol {} {return "(c)"} proc c_set_copyright {text} {global state ; lappend state(copyright) $text ; return} | > > > | | | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | return $state(mdesc) } return $state(tdesc) } proc c_copyrightsymbol {} {return "(c)"} proc c_set_copyright {text} {global state ; lappend state(copyright) $text ; return} proc c_get_copyright {} { return [join [c_get_copyright_r] \n] } proc c_get_copyright_r {} { global state set cc $state(copyright) if {$cc == {}} {set cc [dt_copyright]} if {$cc == {}} {return {}} set stmts {} set re {^Copyright +(?:\(c\)|\\\(co|©)? *(.+)$} foreach stmt $cc { if { [string equal -nocase "public domain" [string trim $stmt]] } { lappend stmts "Public domain" } elseif { [regexp -nocase -- $re $stmt -> stmt] } { lappend stmts $stmt } else { lappend stmts "Copyright [c_copyrightsymbol] $stmt" } } return $stmts } proc c_provenance {} { return "Generated from file '[file tail [dt_ibase]]' by tcllib/doctools with format '[dt_format]'" } ################################################################ |
︙ | ︙ |
Changes to modules/doctools/mpformats/_markdown.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # -*- tcl -*- ## # Support for markdown, overrides parts of coore text. # # Copyright (c) 2019 Andreas Kupries <[email protected]> # Freely redistributable. ## # # ## ### ##### ######## # Modified bulleting DIB {- * +} DEB {{1.} {1)}} # # ## ### ##### ######## | > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # -*- tcl -*- ## # Support for markdown, overrides parts of coore text. # # Copyright (c) 2019 Andreas Kupries <[email protected]> # Freely redistributable. ## # # ## ### ##### ######## proc c_copyrightsymbol {} {return "©"} # Modified bulleting DIB {- * +} DEB {{1.} {1)}} # # ## ### ##### ######## |
︙ | ︙ |
Changes to modules/doctools/mpformats/_text_ccore.tcl.
︙ | ︙ | |||
32 33 34 35 36 37 38 | ## 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 | | | > > > > > | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | ## 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 ; unset -nocomplain 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 ContextExists {id} { global contextData info exists contextData($id) } proc ContextNew {name script} { global currentHandle contextName currentContext set in [array get currentContext] set parentId $currentHandle set currentHandle [NextId] |
︙ | ︙ |
Changes to modules/doctools/mpformats/_text_dlist.tcl.
︙ | ︙ | |||
52 53 54 55 56 57 58 59 60 61 62 63 64 65 | 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]" #puts_stderr " (($para))" TextClear return 1 } | > > > | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | 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] } if {![ContextExists $id]} { error "Unknown context $id for paragraph" } Store PARA $id $para #puts_stderr "CloseParagraph $id [CAttrName $id]" #puts_stderr " (($para))" TextClear return 1 } |
︙ | ︙ |
Changes to modules/doctools/mpformats/fmt.markdown.
1 2 3 4 5 6 7 8 9 10 11 | # -*- tcl -*- # Convert a doctools document into markdown formatted text # # Copyright (c) 2019 Andreas Kupries <[email protected]> # # ## ### ##### ######## ############# ## Load shared code and modify it to our needs. dt_source _common.tcl dt_source _text.tcl dt_source fmt.text | > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # -*- tcl -*- # Convert a doctools document into markdown formatted text # # Copyright (c) 2019 Andreas Kupries <[email protected]> # Note: While markdown is a text format its intended target is HTML, # making its formatting nearer to that with the ability to set anchors # and refer to them, linkage in general. # TODO: Table of contents, section linkage # TODO: Synopsis command linkage # TODO: package - xref # TODO: syscmd - xref # TODO: cmd - xref # TODO: term -xref # TODO: see also, keywords - xref # # ## ### ##### ######## ############# ## Load shared code and modify it to our needs. dt_source _common.tcl dt_source _text.tcl dt_source fmt.text |
︙ | ︙ | |||
129 130 131 132 133 134 135 136 137 138 139 140 141 142 | set text "" append text "Command-Line Switch:\t[fmt_option $name][LB]" append text "Database Name:\t[Strong $dbname][LB]" append text "Database Class:\t[Strong $dbclass]\n" fmt_lst_item $text } proc fmt_uri {text {label {}}} { if {$label == {}} { set label $text } return "\[$label\]($text)" } proc fmt_image {text {label {}}} { # text = symbolic name of the image. | > > > > > | 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | set text "" append text "Command-Line Switch:\t[fmt_option $name][LB]" append text "Database Name:\t[Strong $dbname][LB]" append text "Database Class:\t[Strong $dbclass]\n" fmt_lst_item $text } proc fmt_arg {text} { Em $text } proc fmt_cmd {text} { Strong $text } proc fmt_method {text} { Strong $text } proc fmt_option {text} { Strong $text } proc fmt_uri {text {label {}}} { if {$label == {}} { set label $text } return "\[$label\]($text)" } proc fmt_image {text {label {}}} { # text = symbolic name of the image. |
︙ | ︙ | |||
168 169 170 171 172 173 174 | c_pass 1 fmt_manpage_begin {title section version} NOP c_pass 2 fmt_manpage_begin {title section version} { Off set module [dt_module] set shortdesc [c_get_module] set description [c_get_title] | < > > > > | 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | c_pass 1 fmt_manpage_begin {title section version} NOP c_pass 2 fmt_manpage_begin {title section version} { Off set module [dt_module] set shortdesc [c_get_module] set description [c_get_title] MDComment "$title - $shortdesc" MDComment [c_provenance] MDComment "[string trimleft $title :]($section) $version $module \"$shortdesc\"" MDCDone Section NAME Text "$title - $description" CloseParagraph return } proc c_get_copyright {} { return [join [c_get_copyright_r] [LB]] } ## # # ## ### ##### ######## return |
Changes to modules/doctools/mpformats/fmt.text.
︙ | ︙ | |||
216 217 218 219 220 221 222 | c_pass 1 fmt_manpage_begin {title section version} NOP c_pass 2 fmt_manpage_begin {title section version} { Off set module [dt_module] set shortdesc [c_get_module] set description [c_get_title] | < | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | c_pass 1 fmt_manpage_begin {title section version} NOP c_pass 2 fmt_manpage_begin {title section version} { Off set module [dt_module] set shortdesc [c_get_module] set description [c_get_title] set hdr [list] lappend hdr "$title - $shortdesc" lappend hdr [c_provenance] lappend hdr "[string trimleft $title :]($section) $version $module \"$shortdesc\"" set hdr [join $hdr \n] |
︙ | ︙ |
Changes to modules/doctools/mpformats/idx.markdown.
︙ | ︙ | |||
139 140 141 142 143 144 145 | Text "|[SetAnchor $k]|" } proc References {k} { global key dot set refs {} foreach {ref label} $key($k) { | | | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | Text "|[SetAnchor $k]|" } proc References {k} { global key dot set refs {} foreach {ref label} $key($k) { lappend refs [ALink $ref $label] } Text [join $refs $dot] return } proc EndKey {} { Text "|\n" |
︙ | ︙ |
Changes to modules/doctools/tests/fmt/markdown/00.
1 2 3 4 5 6 7 8 9 10 11 12 13 | [//000000001]: # (TEST - ) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (TEST(z) 3.14.15.926 .MODULE. "") # NAME TEST - # DESCRIPTION # COPYRIGHT | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | [//000000001]: # (TEST - ) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (TEST(z) 3.14.15.926 .MODULE. "") # NAME TEST - # DESCRIPTION # COPYRIGHT Copyright © .COPYRIGHT. |
Changes to modules/doctools/tests/fmt/markdown/01.
1 2 3 4 5 6 7 8 9 10 11 | [//000000001]: # (TEST - ) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (TEST(z) 3.14.15.926 .MODULE. "") # NAME TEST - # DESCRIPTION | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | [//000000001]: # (TEST - ) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (TEST(z) 3.14.15.926 .MODULE. "") # NAME TEST - # DESCRIPTION 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](Uri):: Variable ::__Variable__:: Widget ::__Widget__:: # COPYRIGHT Copyright © **Copyright** |
Changes to modules/doctools/tests/fmt/markdown/02.
︙ | ︙ | |||
20 21 22 23 24 25 26 | # KEYWORDS KEYA, KEYZ # COPYRIGHT | | | 20 21 22 23 24 25 26 27 | # KEYWORDS KEYA, KEYZ # COPYRIGHT Copyright © .COPYRIGHT. |
Changes to modules/doctools/tests/fmt/markdown/03.
︙ | ︙ | |||
31 32 33 34 35 36 37 | At -> AaA. At -> __undefined__. # COPYRIGHT | | | 31 32 33 34 35 36 37 38 | At -> AaA. At -> __undefined__. # COPYRIGHT Copyright © .COPYRIGHT. |
Changes to modules/doctools/tests/fmt/markdown/04.
︙ | ︙ | |||
16 17 18 19 20 21 22 | Inlined Example \ Next Line FERTIG # COPYRIGHT | | | 16 17 18 19 20 21 22 23 | Inlined Example \ Next Line FERTIG # COPYRIGHT Copyright © .COPYRIGHT. |
Changes to modules/doctools/tests/fmt/markdown/05.
︙ | ︙ | |||
11 12 13 14 15 16 17 | a-command # DESCRIPTION OK | | | | | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | a-command # DESCRIPTION OK - integer *argument-1* verification - string *argument-2* (out) mogrification - __command-a__ explanation - __command-b__ elucidation - term definition |
︙ | ︙ | |||
51 52 53 54 55 56 57 | - 2 2a 2b | | | | | | | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | - 2 2a 2b - __option-1__ meaning - __option-2__ value elaboration - Command-Line Switch: __background__ Database Name: __Background__ Database Class: __Color__ candy - Command-Line Switch: __foreground__ Database Name: __Foreground__ Database Class: __Color__ caramel KO # COPYRIGHT Copyright © .COPYRIGHT. |
Changes to modules/doctools/tests/fmt/markdown/06.
︙ | ︙ | |||
43 44 45 46 47 48 49 | 5 6 # COPYRIGHT | | | 43 44 45 46 47 48 49 50 | 5 6 # COPYRIGHT Copyright © .COPYRIGHT. |
Changes to modules/doctools/tests/fmt/markdown/07.
︙ | ︙ | |||
35 36 37 38 39 40 41 | - 22 - 3 # COPYRIGHT | | | 35 36 37 38 39 40 41 42 | - 22 - 3 # COPYRIGHT Copyright © .COPYRIGHT. |
Changes to modules/doctools/tests/fmt/markdown/08.
︙ | ︙ | |||
15 16 17 18 19 20 21 | CMDNAME ... CMDNAME ... CMDNAME ... # DESCRIPTION | | | | | | | | | | | | | | | | | | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | CMDNAME ... CMDNAME ... CMDNAME ... # DESCRIPTION - __NAME__ DESCRIPTION ::__Command__:: - __NAME__ DESCRIPTION :::: - __NAME__ DESCRIPTION ::__Constant__:: # API - TERM DESCRIPTION ::*Emphasis*:: - TERM DESCRIPTION ::"File/Path":: * Command-Line Switch: __NAME__ Database Name: __DBNAME__ Database Class: __CLASS__ DESCRIPTION -> NARGLE * Command-Line Switch: __NAME__ Database Name: __DBNAME__ Database Class: __CLASS__ DESCRIPTION ::__Function__:: * Command-Line Switch: __NAME__ Database Name: __DBNAME__ Database Class: __CLASS__ DESCRIPTION ::__Method__:: - TERM DESCRIPTION - CMDNAME ... DESCRIPTION ::__Namespace__:: * TYPE *NAME* DESCRIPTION ::*Argument*:: * TYPE *NAME* DESCRIPTION ::__Option__:: * TYPE *NAME* (MODE) DESCRIPTION ::?Optional?:: THE ARGUMENT IS USED IN THIS AND/OR THAT MANNER - CMDNAME ... DESCRIPTION ::__Package__:: - CMDNAME ... DESCRIPTION ::__SystemCommand__:: * __NAME__ DESCRIPTION ::*Term*:: * __NAME__ DESCRIPTION ::__Type__:: * __NAME__ ARGUMENT DESCRIPTION ::[Uri](Uri):: ## NARGLE 1. PARAGRAPH ::[UriLabel](Uri):: |
︙ | ︙ | |||
122 123 124 125 126 127 128 | # KEYWORDS KEYA, KEYZ # COPYRIGHT | | | 122 123 124 125 126 127 128 129 | # KEYWORDS KEYA, KEYZ # COPYRIGHT Copyright © **Copyright** |
Changes to modules/doctools/tests/fmt/markdown/09.
︙ | ︙ | |||
29 30 31 32 33 34 35 | 5 lorem ipsum dolores dolores # COPYRIGHT | | | 29 30 31 32 33 34 35 36 | 5 lorem ipsum dolores dolores # COPYRIGHT Copyright © .COPYRIGHT. |
Changes to modules/doctools/tests/fmt/markdown/10.
︙ | ︙ | |||
21 22 23 24 25 26 27 | lorem ipsum dolores lorem ipsum dolores # COPYRIGHT | | | 21 22 23 24 25 26 27 28 | lorem ipsum dolores lorem ipsum dolores # COPYRIGHT Copyright © .COPYRIGHT. |
Changes to modules/doctools/tests/fmt/markdown/11.
︙ | ︙ | |||
21 22 23 24 25 26 27 | lorem ipsum dolores lorem ipsum dolores # COPYRIGHT | | | 21 22 23 24 25 26 27 28 | lorem ipsum dolores lorem ipsum dolores # COPYRIGHT Copyright © .COPYRIGHT. |
Changes to modules/doctools/tests/fmt/markdown/12.
︙ | ︙ | |||
27 28 29 30 31 32 33 | lorem ipsum dolores lorem ipsum dolores # COPYRIGHT | | | 27 28 29 30 31 32 33 34 | lorem ipsum dolores lorem ipsum dolores # COPYRIGHT Copyright © .COPYRIGHT. |
Changes to modules/doctools/tests/fmt/markdown/13.
︙ | ︙ | |||
23 24 25 26 27 28 29 | C lorem ipsum dolores - lorem ipsum dolores # COPYRIGHT | | | 23 24 25 26 27 28 29 30 | C lorem ipsum dolores - lorem ipsum dolores # COPYRIGHT Copyright © .COPYRIGHT. |
Changes to modules/doctools/tests/fmt/markdown/14.
︙ | ︙ | |||
23 24 25 26 27 28 29 | C3 lorem ipsum dolores 1. lorem ipsum dolores # COPYRIGHT | | | 23 24 25 26 27 28 29 30 | C3 lorem ipsum dolores 1. lorem ipsum dolores # COPYRIGHT Copyright © .COPYRIGHT. |
Changes to modules/doctools/tests/fmt/markdown/15.
︙ | ︙ | |||
31 32 33 34 35 36 37 | - lorem ipsum dolores # COPYRIGHT | | | 31 32 33 34 35 36 37 38 | - lorem ipsum dolores # COPYRIGHT Copyright © .COPYRIGHT. |
Changes to modules/doctools/tests/idx/markdown/01.
︙ | ︙ | |||
9 10 11 12 13 14 15 | ---- #### <a name='cL'></a>Keywords: L ||| |---|---| | | | 9 10 11 12 13 14 15 16 | ---- #### <a name='cL'></a>Keywords: L ||| |---|---| |<a name='lorem'></a>lorem|[dolores](ipsum)| |
Changes to modules/doctools/tests/idx/markdown/02.
︙ | ︙ | |||
9 10 11 12 13 14 15 | ---- #### <a name='cD'></a>Keywords: D ||| |---|---| | | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ---- #### <a name='cD'></a>Keywords: D ||| |---|---| |<a name='dolores'></a>dolores|[ipsum](lorem) · [lorem](dolores) · [dolores](ipsum)| #### <a name='cL'></a>Keywords: L ||| |---|---| |<a name='lorem'></a>lorem|[dolores](ipsum) · [ipsum](lorem)| |