Now have accurate version information built into jquery.js - will build it into the...
[jquery.git] / build / docs / docs.js
1 load("build/js/json.js", "build/js/xml.js", "build/js/writeFile.js", "build/js/parse.js");
2
3 var dir = arguments[1];
4
5 var c = parse( read(arguments[0]) );
6 output( c, "docs" );
7
8 c = categorize( c );
9 output( c, "cat" );
10
11 function output( c, n ) {
12         var json = Object.toJSON( c );
13
14         writeFile( dir + "/data/jquery-" + n + "-json.js", json );
15         writeFile( dir + "/data/jquery-" + n + "-jsonp.js", "docsLoaded(" + json + ")" );
16
17         Object.toXML.force = { desc: 1, code: 1, before: 1, result: 1 };
18         
19         var xml = Object.toXML( n == "docs" ? { method: c } : c, "docs" );
20
21         writeFile( dir + "/data/jquery-" + n + "-xml.xml", 
22                 "<?xml version='1.0' encoding='ISO-8859-1'?>\n" + xml );
23
24         writeFile( dir + "/" + ( n == "docs" ? "index" : n ) + ".xml",
25                 "<?xml version='1.0' encoding='ISO-8859-1'?>\n" +
26                 "<?xml-stylesheet type='text/xsl' href='style/" + n + ".xsl'?>\n" + xml
27         );
28 }