~zorba-coders/zorba/new-website

« back to all changes in this revision

Viewing changes to doxygen2html.xq

  • Committer: sorin.marian.nasoi
  • Date: 2013-09-26 07:54:41 UTC
  • Revision ID: spungi@gmail.com-20130926075441-yq5eojtyp3q1vfo0
- XQDoc examples, schemas and actual modules are picked up and added to the website
- added fix for the XQuery/Jsoniq language definitions in the module prologs

Show diffs side-by-side

added added

removed removed

Lines of Context:
179
179
  
180
180
  let $file := trace($file, "ID")
181
181
  let $destination := trace(string-join(("documentation", $version, $api, $id), $slash) || ".html", "Dest")
182
 
  let $folder := trace(string-join(("documentation", $version, $api), $slash), "Folder")
 
182
  let $folder := string-join(("documentation", $version, $api), $slash)
183
183
 
184
184
  let $body :=
185
185
    <html>
189
189
      <div id="view">
190
190
      <link media="all" rel="stylesheet" href="../../../css/home.css" type="text/css" class="ng-scope" ></link>
191
191
      <link media="all" rel="stylesheet" href="../../../css/xqdoc.css" type="text/css" />
192
 
      <table class="main-container"><tr valign="top"><td class="left-menu">
193
 
      {$sidebar}
194
 
      </td><td  class="container">
 
192
      <table class="main-container">
 
193
      <tbody>
 
194
        <tr valign="top">
 
195
          <td class="left-menu">{$sidebar}</td>
 
196
          <td class="container">
195
197
      <section>
196
198
      {
197
199
        if ($file = $moduleindex) then local:generateIndex() else ()
232
234
      }
233
235
      </section>
234
236
      </td>
235
 
      </tr></table>
 
237
      </tr></tbody></table>
236
238
      </div>
237
239
      <footer>
238
240
          <h3>Zorba is supported by the <a href="/flwor/index">FLWOR Foundation</a> and distributed under <a
288
290
  (: copy all Doxygen XMLs :)
289
291
  for $api in $doxygenfiles
290
292
  return
291
 
  ( fs:create-directory($doxyassetspath || $slash || $api),
292
 
    fs:copy(($doxypath || $slash || $api || $slash || "xml"),
293
 
            ($doxyassetspath || $slash || $api))),
 
293
    if(fs:exists(($doxypath || $slash || $api || $slash || "xml")))
 
294
    then( fs:create-directory($doxyassetspath || $slash || $api),
 
295
          fs:copy(($doxypath || $slash || $api || $slash || "xml"),
 
296
                 ($doxyassetspath || $slash || $api)))
 
297
    else (),
294
298
  
295
299
  (: copy all XQDoc XMLs :)
296
300
  fs:create-directory($xqdocassetspath),
297
 
  fs:copy(($xqdocpath || $slash || "xml"), $xqdocassetspath)
 
301
  fs:copy(($xqdocpath || $slash || "xml"), $xqdocassetspath),
 
302
  fs:copy(($xqdocpath || $slash || "examples"), $xqdocassetspath)
298
303
  )
299
304
};
300
305
 
313
318
          fs:create-directory($xqdocdest),
314
319
          fs:copy(($xqdocsrc || $slash || "modules.svg"), $xqdocdest))
315
320
};
 
321
(: copy XML's for the Doxygen pages :)
316
322
let $zorbaapi as xs:string* := ("c", "csharp", "cxx", "java", "php", "python", "xqj", "ruby")
317
323
return local:copy-XMLs(($zorbaapi,"zorba"));
318
324
 
326
332
let $base := ("assets" || $slash || "modules" || $slash)
327
333
for $file in fs:list($base, true(), "*.xml")
328
334
let $doc := doc($base || $file)
329
 
let $moduleUri := trace($doc/xqdoc:xqdoc/xqdoc:module/xqdoc:uri/text(),"module uri")
330
 
let $project := trace($doc/xqdoc:xqdoc/xqdoc:module/xqdoc:comment/xqdoc:custom[@tag="project"]/text(),"project")
 
335
let $moduleUri := $doc/xqdoc:xqdoc/xqdoc:module/xqdoc:uri/text()
 
336
let $project := $doc/xqdoc:xqdoc/xqdoc:module/xqdoc:comment/xqdoc:custom[@tag="project"]/text()
331
337
return (local:toHTML($base || $file),
332
 
        local:collectModule($moduleUri,$project));
 
338
        if(exists($moduleUri))
 
339
        then local:collectModule($moduleUri,$project) else ());
333
340
 
334
341
(:create the index page by passing a fake module URI:)
335
342
local:toHTML($moduleindex);