00001 /*----------------------------------------------------------------------------*/ 00002 /* */ 00003 /* Copyright (c) 2004-2009 William Data Systems Ltd. and Geoff Stevens. */ 00004 /* All rights reserved. */ 00005 /* */ 00006 /* This program and the accompanying materials are made available under */ 00007 /* the terms of the Common Public License v1.0 which accompanies this */ 00008 /* distribution. A copy is also available at the following address: */ 00009 /* http://www.opensource.org/licenses/cpl1.0.php */ 00010 /* */ 00011 /* Redistribution and use in source and binary forms, with or without */ 00012 /* modification, are permitted provided that the following conditions */ 00013 /* are met: */ 00014 /* */ 00015 /* Redistributions of source code must retain the above copyright */ 00016 /* notice, this list of conditions and the following disclaimer. */ 00017 /* */ 00018 /* Redistributions in binary form must reproduce the above copyright */ 00019 /* notice, this list of conditions and the following disclaimer in the */ 00020 /* documentation and/or other materials provided with the distribution. */ 00021 /* */ 00022 /* Neither the name or trademarks of William Data Systems nor the names */ 00023 /* of its contributors may be used to endorse or promote products */ 00024 /* derived from this software without specific prior written permission. */ 00025 /* */ 00026 /* DISCLAIMER */ 00027 /* */ 00028 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ 00029 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ 00030 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ 00031 /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ 00032 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ 00033 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ 00034 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ 00035 /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ 00036 /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ 00037 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ 00038 /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 00039 /* */ 00040 /*----------------------------------------------------------------------------*/ 00041 -- HTML page output static classes 00042 -- 00043 -- These could be recast as routines, but making them class methods keeps them 00044 -- out of the namespace 00045 -- 00046 00047 -- html components 00048 ::REQUIRES 'fsobjects.cls' 00049 -- html components 00050 ::REQUIRES 'nodes.cls' 00051 -- html utility 00052 ::REQUIRES 'htmlutil.cls' 00053 00054 -- static class to emit html page for a rexx class 00055 -- all methods are class methods 00056 ::CLASS htmltext PUBLIC 00057 00058 -- emit html pages for text document 00059 -- @param htmlout - hthtmlout object 00060 -- @param folder - the folder of the file 00061 -- @param file - the file 00062 ::METHOD emit CLASS 00063 use arg htmlout, folder, file 00064 00065 tp = .head_html~new~text 00066 tp~queue('<title>'file~filename'</title>') 00067 tp~queue(.nodes~prodssheet) 00068 tp~queue('<link rel="stylesheet" href="tabs.css">') 00069 -- head is complete 00070 tp~queue('</head>') 00071 tp~queue('<body>') 00072 00073 -- set up menus 00074 .htmlutil~tabshead(tp, htmlout~topmenu, 'petfiles') 00075 00076 tp~queue('<h2>'file~filename'</h2>') 00077 tp~queue('path:' folder~folderpath) 00078 tp~queue('<div class="fragment"><pre class="fragment">') 00079 00080 linenumber = 0 00081 do i over file~document~text 00082 linenumber = linenumber+1 00083 tp~queue(linenumber~right(5,'0') .htmlutil~htmlizestring(i)) 00084 end 00085 tp~queue('</pre></div>') 00086 00087 00088 .htmlutil~trailer(htmlout, tp) 00089 00090 tp~queue('</body></html>') 00091 -- write page as html 00092 towrite = htmlout~hdest||file~document~hsrcurl 00093 .htmlutil~writepage(tp, towrite) 00094 00095 00096
Generated on 31 Aug 2010 05:20:27 for RexxLiterate by 0.0.1 |