Documentation Source Text

Check-in [4180b2cf6f]
Login

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

Overview
Comment:Remove unnecessary javascript from the header. Improvements to rendering of C APIs.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4180b2cf6ffda2e9cf0a607cba269d1faef0dc61
User & Date: drh 2016-09-02 16:30:15
Context
2016-09-02
16:57
Rename the output_list proc to hd_list_of_links and move its implementation from capi3ref.in into wrap.tcl, since it is used as common code. check-in: c3c40d6711 user: drh tags: trunk
16:30
Remove unnecessary javascript from the header. Improvements to rendering of C APIs. check-in: 4180b2cf6f user: drh tags: trunk
15:25
Remove some unnecessary leading whitespace from generated page content. check-in: 03b286c8ac user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to document_header.tcl.

    70     70         window.onbeforeunload = function(e){div_off("submenu");}
    71     71   
    72     72         /* Disable the Search feature if we are not operating from CGI, since */
    73     73         /* Search is accomplished using CGI and will not work without it. */
    74     74         if( !location.origin.match(/http/) ){
    75     75           document.getElementById("search_menubutton").style.display = "none";
    76     76         }
    77         -      
    78         -      /* Set the cookie named "name" to value "value". Expires in "days" days. */
    79         -      function createCookie(name,value,days) {
    80         -        if (days) {
    81         -          var date = new Date();
    82         -          date.setTime(date.getTime()+(days*24*60*60*1000));
    83         -          var expires = "; expires="+date.toGMTString();
    84         -        }else{
    85         -          var expires = "";
    86         -        }
    87         -        document.cookie = name+"="+value+expires+"; path=/";
    88         -      }
    89     77   
    90         -      /* 
    91         -      ** Return the value of cookie "name".
    92         -      */
    93         -      function readCookie(name) {
    94         -        var nameEQ = name + "=";
    95         -        var ca = document.cookie.split(';');
    96         -        for(var i=0;i < ca.length;i++) {
    97         -          var c = ca[i];
    98         -          while (c.charAt(0)==' ') c = c.substring(1,c.length);
    99         -          if (c.indexOf(nameEQ)==0) return c.substring(nameEQ.length,c.length);
   100         -        }
   101         -        return null;
   102         -      }
   103         -
   104         -      /* 
   105         -      ** Delete cookie "name".
   106         -      */
   107         -      function eraseCookie(name) {
   108         -        createCookie(name,"",-1);
   109         -      }
   110         -
           78  +      /* Used by the Hide/Show button beside syntax diagrams, to toggle the */
           79  +      /* display of those diagrams on and off */
   111     80         function hideorshow(btn,obj){
   112     81           var x = document.getElementById(obj);
   113     82           var b = document.getElementById(btn);
   114     83           if( x.style.display!='none' ){
   115     84             x.style.display = 'none';
   116     85             b.innerHTML='show';
   117     86           }else{

Changes to pages/capi3ref.in.

   660    660     foreach {key title type keywords body code} $c break
   661    661     set kw [preferred_keyword [lsort $keywords]]
   662    662     if {$kw==""} {error "no keyword for $c"}
   663    663     hd_fragment $kw
   664    664     hd_open_aux c3ref/[convert_keyword_to_filename $kw]
   665    665     hd_header $title
   666    666     hd_enable_main 0
   667         -  hd_puts {<div class=nosearch>}
   668         -  hd_puts {<a href="intro.html"><h2>SQLite C Interface</h2></a>}
          667  +  hd_putsnl "<!-- keywords: $keywords -->"
          668  +  hd_putsnl {<div class=nosearch>}
          669  +  hd_putsnl {<a href="intro.html"><h2>SQLite C Interface</h2></a>}
   669    670     hd_enable_main 1
   670    671     eval hd_keywords $keywords
   671    672   
   672         -  hd_puts "<h2>$title</h2>"
   673         -  hd_puts {</div>}
   674         -  hd_puts "<blockquote><pre>"
   675         -  hd_puts "$code"
   676         -  hd_puts "</pre></blockquote>"
          673  +  hd_putsnl "<h2>$title</h2>"
          674  +  hd_putsnl {</div>}
          675  +  hd_putsnl "<blockquote><pre>"
          676  +  hd_putsnl [string trim $code]
          677  +  hd_putsnl "</pre></blockquote>"
   677    678     if {$supported($kw)==1} {
   678    679       hd_resolve {<p><b>Important:</b> This interface is [experimental] }
   679    680       hd_resolve {and is subject to change without notice.</p>}
   680    681     }
   681    682     regsub -all "\n\n+" $body "</p>\n\n<p>" body
   682    683     set body <p>$body</p>
   683    684     while {[regexp {^(.*?)\[\[([^]]*)\]\](.*)$} $body all fore anchor aft]} {
   684    685       hd_resolve $fore
   685    686       set anchor [string trim $anchor]
          687  +puts stderr "FRAGMENT: [list [hd_fragname $anchor] $anchor]"
   686    688       hd_fragment [hd_fragname $anchor] $anchor
   687    689       set body $aft
   688    690     }
   689    691     hd_resolve $body
   690    692     show_methods_of_object c:$kw Constructor
   691    693     show_methods_of_object d:$kw Destructor
   692    694     show_methods_of_object m:$kw Method

Changes to wrap.tcl.

   683    683     lappend revglink($y) $x
   684    684   }
   685    685   hd_puts "</ul>"
   686    686   hd_close_main
   687    687   
   688    688   hd_open_main doc_target_crossref.html
   689    689   hd_header {Target Crossreference} $DOC/wrap.tcl
   690         -hd_puts "<ul>"
          690  +hd_putsnl "<ul>"
   691    691   foreach y [lsort [array names revglink]] {
   692         -  hd_puts "<li><a href=\"$y\">$y</a> - [lsort $revglink($y)]</li>"
          692  +  hd_putsnl "<li><a href=\"$y\">$y</a> &rarr; [lsort $revglink($y)]</li>"
   693    693   }
   694         -hd_puts "</ul>"
          694  +hd_putsnl "</ul>"
   695    695   hd_close_main
   696    696   
   697    697   hd_open_main doc_backlink_crossref.html
   698    698   hd_header {Backlink Crossreference} $DOC/wrap.tcl
   699    699   hd_puts "<ul>"
   700    700   foreach kw [lsort -nocase [array names backlink]] {
   701         -  hd_puts "<li>$kw -"
          701  +  hd_puts "<li>$kw &rarr;"
   702    702     set prev {}
   703    703     foreach ref [lsort $backlink($kw)] {
   704    704       if {$ref==$prev} continue
   705    705       set prev $ref
   706         -    hd_puts "  <a href=\"$ref\">$ref</a>"
          706  +    hd_putsnl "  <a href=\"$ref\">$ref</a>"
   707    707     }
   708    708   }
   709         -hd_puts "</ul>"
          709  +hd_putsnl "</ul>"
   710    710   hd_close_main
   711    711   
   712    712   hd_open_main doc_pagelink_crossref.html
   713    713   hd_header {Pagelink Crossreference} $DOC/wrap.tcl
   714         -hd_puts "<p>Target Page - Which pages reference it.</p>"
          714  +hd_puts "<p>Key: Target_Page &rarr; pages that have hyperlinks to the target page.</p>"
   715    715   hd_puts "<p>Pages matching (news|changes|releaselog|\[0-9]to\[0-9]|&#94;doc_.*_crossref) are skipped.</p>"
   716    716   hd_puts "<ul>"
   717    717   foreach y [lsort [array names revglink]] {
   718    718     regsub {#.*} $y {} y2
   719    719     foreach kw [lsort $revglink($y)] {
   720    720       if {[info exists backlink($kw)]} {
   721    721         foreach ref [lsort $backlink($kw)] {
................................................................................
   723    723           lappend pagelink($y2) $ref2
   724    724         }
   725    725       }
   726    726     }
   727    727   }
   728    728   foreach y [lsort [array names pagelink]] {
   729    729     if {[regexp {(news|changes|releaselog|[0-9]to[0-9]|^doc_.*_crossref)} $y]} continue
   730         -  hd_puts "<li><a href=\"$y\">$y</a> - "
          730  +  hd_putsnl "<li><a href=\"$y\">$y</a> &rarr; "
   731    731     set prev {}
   732    732     foreach ref [lsort $pagelink($y)] {
   733    733       if {$ref==$prev} continue
   734    734       if {$ref==$y} continue
   735    735       if {[regexp {(news|changes|releaselog|[0-9]to[0-9]|^doc_.*_crossref)} $ref]} continue
   736    736       hd_puts "<a href=\"$ref\">$ref</a> "
   737    737       set prev $ref
   738    738     }
   739         -  hd_puts "</li>"
          739  +  hd_putsnl "</li>"
   740    740   }
   741    741   hd_puts "</ul>"
   742    742   hd_close_main
   743    743   db eval COMMIT