Documentation Source Text

Check-in [a5ef7d9aff]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improved rendering of CodeBlock in fancy-format.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | mobile-friendly
Files: files | file ages | folders
SHA1: a5ef7d9aff51538c6235e6559d82f5cb51b60016
User & Date: drh 2016-09-02 01:04:06.308
Context
2016-09-02
01:19
Fix the font-size of CodeBlock to 1em. (check-in: a12a0dd1b0 user: drh tags: mobile-friendly)
01:04
Improved rendering of CodeBlock in fancy-format. (check-in: a5ef7d9aff user: drh tags: mobile-friendly)
00:30
Improve the cross-platform display of show/hide lists. (check-in: 84b8acdf6c user: drh tags: mobile-friendly)
Changes
Unified Diff Ignore Whitespace Patch
Changes to pages/fancyformat.tcl.
178
179
180
181
182
183
184
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
  append ret "</p>"
}

set ::Requirements [list]

proc CodeBlock {txt} {
  set txt [string trim $txt "\n"]
  set    out {<div class=codeblock style="margin:0 15ex">}
  append out {<table width=100% style="border:1px solid #80a796;padding:0 1ex;background-color:#EEEEEE"><tr><td><pre style="font-size:1.1em">}

  foreach line [split $txt "\n"] {
    if {![string is space $line]} {
      set nSpace [expr {
        [string length $line] - [string length [string trimleft $line]]
      }]
      if {[info exists nMinSpace]==0 || $nSpace<$nMinSpace} {
        set nMinSpace $nSpace
      }
    }
  }
  foreach line [split $txt "\n"] {
    set line [string range $line $nMinSpace end]
    append out "$line\n"
  }
  append out "</pre></table></div>"
  return $out
}


#-------------------------------------------------------------------------
# Return the <script>...</script> block containing the code for persistent
# show/hide on the TOC block. This is inserted into each page immediately







|
<















|







178
179
180
181
182
183
184
185

186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
  append ret "</p>"
}

set ::Requirements [list]

proc CodeBlock {txt} {
  set txt [string trim $txt "\n"]
  set    out {<div class=codeblock><pre>}


  foreach line [split $txt "\n"] {
    if {![string is space $line]} {
      set nSpace [expr {
        [string length $line] - [string length [string trimleft $line]]
      }]
      if {[info exists nMinSpace]==0 || $nSpace<$nMinSpace} {
        set nMinSpace $nSpace
      }
    }
  }
  foreach line [split $txt "\n"] {
    set line [string range $line $nMinSpace end]
    append out "$line\n"
  }
  append out "</pre></div>"
  return $out
}


#-------------------------------------------------------------------------
# Return the <script>...</script> block containing the code for persistent
# show/hide on the TOC block. This is inserted into each page immediately
Changes to rawpages/sqlite.css.
143
144
145
146
147
148
149









150
151
152
153
154
155
156
.content    { margin: 5%; }
.content dt { font-weight:bold; }
.content dd { margin-bottom: 25px; margin-left:20%; }
.content ul { padding:0px; padding-left: 15px; margin:0px; }

/* Things for "fancyformat" documents start here. */
.fancy img+p {font-style:italic}









.fancy .codeblock i { color: darkblue; }
.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
.fancy th {white-space:xnowrap;text-align:left;border-bottom:solid 1px #444}
.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
.toct { color: #044a64 ! important; }
#toc_sub a        { color: #044a64; text-decoration: none }
#toc_sub { display: none; margin-top: 1em; }







>
>
>
>
>
>
>
>
>







143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
.content    { margin: 5%; }
.content dt { font-weight:bold; }
.content dd { margin-bottom: 25px; margin-left:20%; }
.content ul { padding:0px; padding-left: 15px; margin:0px; }

/* Things for "fancyformat" documents start here. */
.fancy img+p {font-style:italic}
.fancy .codeblock {
  display: table;
  border: 1px solid #80a796;
  padding: 1ex;
  background-color: #eee;
}
.fancy .codeblock pre {
  display: table-cell;
}
.fancy .codeblock i { color: darkblue; }
.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
.fancy th {white-space:xnowrap;text-align:left;border-bottom:solid 1px #444}
.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
.toct { color: #044a64 ! important; }
#toc_sub a        { color: #044a64; text-decoration: none }
#toc_sub { display: none; margin-top: 1em; }
183
184
185
186
187
188
189

190
191
192
193
194
195
196
197
198
199
200

201
202
203
204
205
206
207
  .toct {margin-left:4ex;}
  .fancy-toc1 {margin-left:6ex;}
  .fancy-toc2 {margin-left:12ex;}
  .fancy-toc3 {margin-left:18ex;}
  .fancy-toc4 {margin-left:24ex;}
  .fancy-toc5 {margin-left:30ex;}
  .fancy-toc6 {margin-left:36ex;}

}
@media screen and (max-width: 600px){
  /* Indentation amounts for narrow mobile screens */
  .toct {margin-left:0;}
  .fancy-toc1 {padding-left:4ex;text-indent:-2ex;}
  .fancy-toc2 {padding-left:8ex;text-indent:-4ex;}
  .fancy-toc3 {padding-left:12ex;text-indent:-6ex;}
  .fancy-toc4 {padding-left:16ex;text-indent:-8ex;}
  .fancy-toc5 {padding-left:20ex;text-indent:-10ex;}
  .fancy-toc6 {padding-left:24ex;text-indent:-12ex;}
  .lessindent {padding-left: 1em; margin-left: 0;}

}
/* End of "fancyformat" specific rules. */

/* <ul> elements used for multi-column lists */
.multicol_list {padding-left:1em;margin-left:0;}

.yyterm {







>











>







192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
  .toct {margin-left:4ex;}
  .fancy-toc1 {margin-left:6ex;}
  .fancy-toc2 {margin-left:12ex;}
  .fancy-toc3 {margin-left:18ex;}
  .fancy-toc4 {margin-left:24ex;}
  .fancy-toc5 {margin-left:30ex;}
  .fancy-toc6 {margin-left:36ex;}
  .fancy .codeblock {margin:0 10ex;}
}
@media screen and (max-width: 600px){
  /* Indentation amounts for narrow mobile screens */
  .toct {margin-left:0;}
  .fancy-toc1 {padding-left:4ex;text-indent:-2ex;}
  .fancy-toc2 {padding-left:8ex;text-indent:-4ex;}
  .fancy-toc3 {padding-left:12ex;text-indent:-6ex;}
  .fancy-toc4 {padding-left:16ex;text-indent:-8ex;}
  .fancy-toc5 {padding-left:20ex;text-indent:-10ex;}
  .fancy-toc6 {padding-left:24ex;text-indent:-12ex;}
  .lessindent {padding-left: 1em; margin-left: 0;}
  .fancy .codeblock {margin:0 1ex;}
}
/* End of "fancyformat" specific rules. */

/* <ul> elements used for multi-column lists */
.multicol_list {padding-left:1em;margin-left:0;}

.yyterm {