Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Continued generation of markdown: doctools. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | doc-fixup-and-markdown |
Files: | files | file ages | folders |
SHA3-256: |
352aea205e9ea9fed3b6f4261eb4bc49 |
User & Date: | aku 2019-03-19 03:50:03.953 |
Context
2019-03-19
| ||
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 | |
03:49 | Markdown: Updated test results, added index for easier inspection check-in: d6174df5a0 user: aku tags: doc-fixup-and-markdown | |
Changes
Changes to modules/doctools/doctools.test.
︙ | ︙ | |||
313 314 315 316 317 318 319 | # ------------------------------------------------------------------------- ## Series of tests for all available backends, check their formatting. set k 11 foreach format { html tmml nroff | | | 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | # ------------------------------------------------------------------------- ## Series of tests for all available backends, check their formatting. set k 11 foreach format { html tmml nroff latex text wiki markdown desc list null } { set n 0 foreach src [TestFilesGlob tests/fmt/man/*] { # Get the expected result set dst [localPath [file join tests fmt $format [file tail $src]]] set map {} ; lappend map @USR@ $tcl_platform(user) |
︙ | ︙ |
Added modules/doctools/mpformats/fmt.markdown.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 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 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 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | # -*- 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 dt_source _markdown.tcl rename PostProcess PostProcessT proc PostProcess {text} { string map [list [LB] " \n"] [PostProcessT $text] } proc LB {} { return "\1\n" } proc LB. {} { return "\1" } # # ## ### ##### ######## ## Override crucial parts of the regular text formatter proc NewExample {} { return [ContextNew Example { VerbatimOn ; Example! ; Prefix! " " }] ; # {} } proc NewUnorderedList {} { # Itemized list - unordered list - bullet # 1. Base context provides indentation. # 2. First paragraph in a list item. # 3. All other paragraphs. ContextPush set base [ContextNew Itemized { set bullet "[WPrefix?] [IBullet]" }] ; # {} set first [ContextNew First { List! bullet $bullet [set ws "[BlankM $bullet] "] }] ; ContextSet $base ; # {} set next [ContextNew Next { WPrefix! $ws Prefix! $ws }] ; ContextSet $base ; # {} OUL $first $next ContextCommit ContextPop ContextSet $base return } proc NewOrderedList {} { # Ordered list - enumeration - enum # 1. Base context provides indentation. # 2. First paragraph in a list item. # 3. All other paragraphs. ContextPush set base [ContextNew Enumerated { set bullet "[WPrefix?] [EBullet]" }] ; # {} set first [ContextNew First { List! bullet $bullet [set ws "[BlankM $bullet] "] }] ; ContextSet $base ; # {} set next [ContextNew Next { WPrefix! $ws Prefix! $ws }] ; ContextSet $base ; # {} OUL $first $next ContextCommit ContextPop ContextSet $base return } proc NewDefinitionList {} { # Definition list - terms & definitions # 1. Base context provides indentation. # 2. Term context # 3. Definition context ContextPush # Markdown has no native definition lists. We translate them into # itemized lists, rendering the term part as the first paragraph # of each entry, and the definition as all following. set base [ContextNew Definitions { set bullet "[WPrefix?] [IBullet]" }] ; # {} set term [ContextNew Term { List! bullet $bullet [set ws "[BlankM $bullet] "] VerbatimOn }] ; ContextSet $base ; # {} set def [ContextNew Def { WPrefix! $ws Prefix! $ws }] ; ContextSet $base ; # {} TD $term $def ContextCommit ContextPop ContextSet $base return } c_pass 1 fmt_usage {cmd args} {c_hold synopsis "[join [linsert $args 0 $cmd] " "][LB.]"} c_pass 1 fmt_call {cmd args} {c_hold synopsis "[join [linsert $args 0 $cmd] " "][LB.]"} c_pass 1 fmt_require {pkg {version {}}} { set result "package require $pkg" if {$version != {}} {append result " $version"} c_hold require "$result " return } c_pass 2 fmt_tkoption_def {name dbname dbclass} { 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. # formatting based on the available data ... set img [dt_imgdst $text {png gif jpg}] if {$img != {}} { if {$label != {}} { return "!\[\]($img \"$label\")" } else { return "!\[\]($img)" } } set img [dt_imgdata $text {txt}] if {$img != {}} { # Show ASCII image like an example (code block => fixed font, no reflow) # A label is shown as a pseudo-caption (paragraph after image). fmt_example $img if {$label != {}} { Text [String "IMAGE: $label"] CloseCurrent } } return $img } 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 copyright [c_get_copyright] MDComment "$title - $shortdesc" MDComment [c_provenance] MDComment "[string trimleft $title :]($section) $version $module \"$shortdesc\"" MDCDone Section NAME Text "$title - $description" CloseParagraph return } ## # # ## ### ##### ######## return |
Added modules/doctools/tests/fmt/markdown/00.
> > > > > > > > > > > > > > | 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 (c) .COPYRIGHT. |
Added modules/doctools/tests/fmt/markdown/01.
> > > > > > > > > > > > > > > > > > > > > | 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 (c) **Copyright** |
Added modules/doctools/tests/fmt/markdown/02.
> > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | [//000000001]: # (TEST - ..THE_MODULE..) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (TEST(z) 3.14.15.926 .MODULE. "..THE_MODULE..") # NAME TEST - ..THE_TITLE.. # SYNOPSIS package require AAA package require BBB VVV # DESCRIPTION # SEE ALSO ELSE, OTHER # KEYWORDS KEYA, KEYZ # COPYRIGHT Copyright (c) .COPYRIGHT. |
Added modules/doctools/tests/fmt/markdown/03.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 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 38 | [//000000001]: # (TEST - ) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (TEST(z) 3.14.15.926 .MODULE. "") # NAME TEST - # DESCRIPTION # AaA 1 # BbB 22 ## BbB.cCc 333 ## BbB.dDd 4444 # EeE 5555 At -> AaA. At -> __undefined__. # COPYRIGHT Copyright (c) .COPYRIGHT. |
Added modules/doctools/tests/fmt/markdown/04.
> > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | [//000000001]: # (TEST - ) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (TEST(z) 3.14.15.926 .MODULE. "") # NAME TEST - # DESCRIPTION BEGINNE HIER Example Block More Lines Inlined Example \ Next Line FERTIG # COPYRIGHT Copyright (c) .COPYRIGHT. |
Added modules/doctools/tests/fmt/markdown/05.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 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 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 | [//000000001]: # (BASIC - ) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (BASIC(a) 5 .MODULE. "") # NAME BASIC - # SYNOPSIS a-command # DESCRIPTION OK - integer argument-1 verification - string argument-2 (out) mogrification - command-a explanation - command-b elucidation - term definition - a-command semantic 1. A 1. B C D - 1 - 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 (c) .COPYRIGHT. |
Added modules/doctools/tests/fmt/markdown/06.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 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 38 39 40 41 42 43 44 45 46 47 48 49 50 | [//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 1. a b c * foo snafu * bar barf * roo gork 1. a b c - 4 5 6 # COPYRIGHT Copyright (c) .COPYRIGHT. |
Added modules/doctools/tests/fmt/markdown/07.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 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 38 39 40 41 42 | [//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 1. a 1. b * foo snafu * bar barf * roo gork 1. bb 1. a - 22 - 3 # COPYRIGHT Copyright (c) .COPYRIGHT. |
Added modules/doctools/tests/fmt/markdown/08.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 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 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 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | [//000000001]: # (ALL - ..THE_MODULE..) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (ALL(a) 5 .MODULE. "..THE_MODULE..") # NAME ALL - ..THE_TITLE.. # SYNOPSIS package require AAA package require BBB VVV package require CCC ?VVV? 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):: 1. PARAGRAPH ::__Variable__:: 1. PARAGRAPH ::__Widget__:: - PARAGRAPH ::__Class__:: - PARAGRAPH - PARAGRAPH # SEE ALSO ELSE, OTHER # KEYWORDS KEYA, KEYZ # COPYRIGHT Copyright (c) **Copyright** |
Added modules/doctools/tests/fmt/markdown/09.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 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 | [//000000001]: # (TEST - ) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (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/fmt/markdown/10.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | [//000000001]: # (test-itemized - ) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (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/fmt/markdown/11.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | [//000000001]: # (test-enumerated - ) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (test-enumerated(1) n .MODULE. "") # NAME test-enumerated - # 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/fmt/markdown/12.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | [//000000001]: # (test-definitions - ) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (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/fmt/markdown/13.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | [//000000001]: # (test-itemized-examples - ) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (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/fmt/markdown/14.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | [//000000001]: # (test-enumerated-examples - ) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (test-enumerated-examples(1) n .MODULE. "") # NAME test-enumerated-examples - # DESCRIPTION lorem ipsum dolores 1. A1 lorem ipsum dolores 1. lorem ipsum dolores B2 lorem ipsum dolores 1. lorem ipsum dolores 1. lorem ipsum dolores C3 lorem ipsum dolores 1. lorem ipsum dolores # COPYRIGHT Copyright (c) .COPYRIGHT. |
Added modules/doctools/tests/fmt/markdown/15.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 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 38 | [//000000001]: # (test-definition-examples - ) [//000000002]: # (Generated from file '.FILE.' by tcllib/doctools with format 'markdown') [//000000003]: # (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. |
Added modules/doctools/tests/fmt/markdown/index.
> > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | * [00.md](00.md) * [01.md](01.md) * [02.md](02.md) * [03.md](03.md) * [04.md](04.md) * [05.md](05.md) * [06.md](06.md) * [07.md](07.md) * [08.md](08.md) * [09.md](09.md) * [10.md](10.md) * [11.md](11.md) * [12.md](12.md) * [13.md](13.md) * [14.md](14.md) * [15.md](15.md) |